Repository navigation
Conversation
Extend BSV exact with reusable maximum authorization and delayed settlement through existing x402 interfaces. Include transaction validation, role orchestration, and offline and opt-in live tests. Specification approval and live validation remain required before merge.
linzhm
marked this pull request as ready for review
September 5, 2026 06:41
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.
Description
Depends on #4. This is the TypeScript implementation preview for the proposed BSV
uptospecification, submitted to the BSV fork only. Please review the specification first; this Draft is not a simultaneous request for implementation approval.Adds
uptoalongside the existing@x402/bsvexactscheme: the payer signs a reusable maximum authorization, the Resource Server supplies the actual amount through existingSettlementOverrides, and the recipient constructs and verifies the terminal transaction. Complete terminal Atomic BEEF returns through the existing settlement response so the payer can validate and internalize its outputs.The usual case reserves fee headroom (
E > M). Stream compatibility means applications can form increasing, fully signed conflicting candidates using unchanged payer cap signatures; only one selected terminal is settled. This adds no streaming scheme, endpoint, or extra x402 round trip.Dependency and temporary base
Both this PR and #4 use
feat/bsv-exact-schemeatdf5fdb3csolely to show focused diffs. This PR contains no specification file; the dependency is explicit, not a Git-enforced stack.Do not merge either PR into this branch while it carries the active upstream exact PR (number 2890). A BSV maintainer must first establish a separate integration base, or use an appropriate base after exact lands. Retarget and recheck the diffs, approve/merge #4 first, then reconcile this implementation with the approved specification. Opening this fork Draft does not claim completion of the upstream spec-first process.
Scope and review order
60 files, +11,911/−12: BSV implementation, unit/integration tests, README, changeset, and TypeScript E2E catalog/role registration. No core, HTTP, MCP, legacy, generic specification, existing exact source, or TypeScript workspace lockfile changes. E2E MCP exclusion files prevent unsupported BSV combinations; they do not add MCP support.
Within
typescript/packages/mechanisms/bsv/, review:src/upto/types.ts,internal/authorization.ts, andinternal/source.ts: signed fields, BEEF validation, and joint-source ancestry conflicts.internal/transaction.ts,internal/terminal.ts, andinternal/outputs.ts: reusable cap signatures, recipient signatures, owner net amounts, fee/refund arithmetic, and full terminal validation.server/,facilitator/, andclient/: admission/amount binding, terminal selection before wallet effects, and payer receipt validation. Fresh verification is not response recovery; repeated facilitator settlement has the narrower replay contract in docs(specs): define the upto scheme for BSV #4.test/integrations/ande2e/BSV.md: opt-in dual-wallet and authenticated three-role setup.The enforcement split remains subject to #4's review: cap signatures mechanically limit total exposure
E, not service maximumM; control signatures require the recipient's completion authority but do not covenant allocation rules; cap signatures do not expire cryptographically. Persistent coordination and recipient-controlled settlement authentication remain deployment requirements, not guarantees supplied by the transport.Tests
Validation recorded on 2026-09-05 against the unchanged uploaded file hashes:
pnpm test --forcepassed on Node 22.23.2 and 24.19.0: 57/57 tasks each, no cached tasks.Checklist
@x402/bsvchangeset includedAI assistance
Significant AI assistance was used for implementation, tests, and review. This remains Draft; human verification and the unresolved specification/live-validation gates are not represented as complete. No reviewers or upstream changes are requested by opening this preview.