feat: BRC-138 single-use signed proofs (login in one request) - #6
Merged
Conversation
Adds the first Python implementation of BRC-138 (Single-Use Signed Proofs for Request Authentication), byte-compatible with the reference TypeScript @bsv/auth implementation: - bsv_brc.brc138: create_auth_proof / verify_auth_proof over the spec's canonical encoding, BRC-42/43 child-key derivation per proof (protocolID [2, name], keyID = nonce, counterparty = verifier), SHA-256 + DER signing matching @bsv/sdk createSignature. - SingleUseStore ABC + MemorySingleUseStore + SqliteSingleUseStore (atomic uniqueness, bounded retention). - AuthProofMiddleware (optional Starlette/ASGI auth gate). - crypto.keys.derive_signing_public_key: verifier-side BRC-43 derivation. - Cross-implementation proof vs @bsv/auth (live harness + pinned vectors). - docs/MODERNIZATION.md: BRC ecosystem gap analysis vs 2026-08 spec set; corrects stale BRC-101/108/116 claims in README/CLAUDE. Co-authored-by: dsh-peck/deepseek-v4-flash <dsh-peck@peck.to>
kryp2
force-pushed
the
feat/brc138-auth-proofs-2026-08-17
branch
from
August 18, 2026 01:25
99db065 to
e042c0b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent: dsh-peck/deepseek-v4-flash
Summary
Modernization round for bsv-brc-python against the 2026-08 BRC ecosystem
(spec set current to 2026-08-12, 150+ standards): the first Python
implementation of BRC-138 — Single-Use Signed Proofs for Request
Authentication, proven byte-compatible with the canonical TypeScript
reference
@bsv/auth.What's included
bsv_brc.brc138—create_auth_proof/verify_auth_proof/check_auth_proof_dataover the spec's canonical encoding, BRC-42/43child-key derivation per proof (
protocolID [2, name],keyID = nonce,counterparty = verifier), SHA-256 + DER ECDSA signing (matches@bsv/sdkcreateSignature). Wire form per spec (signature = bytevalues; hex accepted for wallet interop). Optional request-payload
binding (VarInt length-prefixed).
SingleUseStoreABC,MemorySingleUseStore(locked, lazy eviction),
SqliteSingleUseStore(atomicINSERT OR IGNORE, bounded retention).AuthProofMiddleware— optional Starlette/ASGI auth gate(
x-bsv-auth-proofheader or JSON bodyproofmember).crypto.keys.derive_signing_public_key— verifier-side BRC-43derivation (inverse of
derive_signing_key).examples/brc138_interop/live 4-way check against@bsv/auth+@bsv/sdk(Python↔Node, bodyless + body-bound), pluspinned certified vectors in
tests/test_brc138_interop.py(Node-freeregression).
docs/MODERNIZATION.md— full gap analysis vs the current BRC set:402 payment family (BRC-118 multipart, BRC-120 x402, BRC-121 simple 402),
BEEF V2 (BRC-96/158), overlay sync (BRC-76 GASP, BRC-136 BASM), BRC-35;
corrects the stale/factually-wrong "out of scope" claims in README/CHANGELOG
(BRC-101 is SHIP/SLAP facilitator URLs, BRC-108 is the Identity-Linked
Token Protocol, BRC-116 is Wallet Permissions — nothing sCrypt).
Verification
with latest
bsv-sdk2.3.3 (pin floor was 2.1.3 — suite was alreadygreen on the newer SDK).
@bsv/auth(Node): all 4directions pass.
Notes for review
feat/brc138-auth-proofs-2026-08-17examples/brc138_interop/package-lock.jsonpins@bsv/auth0.1.3 /
@bsv/sdk2.4.1 for reproducible interop runs;node_modules/is gitignored.
[2, "bsv auth proof"]matches@bsv/authso proofsinterop across languages out of the box.