initial pilot implementation: 6 Anchor programs#1
Closed
A1igator wants to merge 1 commit into
Closed
Conversation
Faithful SVM port of base/commerce-payments authCapture primitives plus
x402r-specific extensions:
programs/auth-capture-escrow AuthCaptureEscrow analog: 6 lifecycle
instructions + protocol-fee config init.
CPIs into ITokenCollector for fund moves.
programs/spl-token-collector ITokenCollector for SPL Token. Two
instructions: collect_authorize +
collect_refund. Future Token-2022,
bridge, streaming collectors slot in
via the same interface.
programs/payment-operator x402r factory + slot dispatch. One
program acting as factory of per-merchant
OperatorState PDAs (whose addresses
double as paymentInfo.operator). Wraps
escrow ixs with pre-action conditions +
post-action hooks via invoke_signed CPI.
programs/static-address-condition Generic ICondition reference impl.
programs/receiver-condition Stateless ICondition (= payment_info.receiver).
programs/payer-condition Stateless ICondition (= payment_info.payer).
Plus tests/, fuzz/, migrations/, codama/ scaffolding.
Architectural symmetry table is in README.md. Spec lives at
x402r-scheme/specs/schemes/authCapture/scheme_authCapture_svm.md.
Pilot, unaudited. Mainnet usage at users' own risk.
Every Rust source file carries SPDX-License-Identifier: BUSL-1.1, matching
x402r-contracts. Each Cargo.toml declares license = "BUSL-1.1".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 14, 2026
Contributor
Author
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.
Summary
Adds the full pilot implementation in one commit. Architectural symmetry with
base/commerce-payments(so each piece has a one-to-one EVM counterpart) plus x402r-specific extensions on top:auth-capture-escrowAuthCaptureEscrowanalog). 6 lifecycle ixs (authorize/charge/capture/void/refund/reclaim) + 1 admin (initialize_protocol_fee_config). CPIs intoITokenCollectorfor fund movement.spl-token-collectorITokenCollectorimpl. SPL Token transfers forcollect_authorize+collect_refund. Future Token-2022 / cross-chain / streaming collectors slot in via the same interface.payment-operatorOperatorStatePDAs at[b"operator", authority](PDA address IS the operator pubkey). Wraps escrow ixs with pre-action conditions + post-action hooks viainvoke_signed.static-address-conditionIConditionreference impl.receiver-conditionICondition: outer signer ==payment_info.receiver.payer-conditionICondition: outer signer ==payment_info.payer.reclaimlives only on the escrow and is called by the payer directly — bypasses the operator program because the deadline-based escape hatch must not be defeasible.Licensing
SPDX-License-Identifier: BUSL-1.1and// CONTRACTS UNAUDITED: USE AT YOUR OWN RISK(matchesx402r-contracts).Cargo.tomldeclareslicense = "BUSL-1.1".x402r-contracts: Change Date 2029-12-09, Change License MIT, Hackathon Promotional Rights grant retained.Layout
Status
Pilot, unaudited. Mainnet usage is at users' own risk.
Things that need to follow before this builds end-to-end:
anchor buildto produce IDLs (toolchain not installed locally)pnpm codama:generateto swap stubs in the@x402r/svmSDK (companion: @x402r/svm: implement authCapture for SVM (pilot) x402r-scheme#46)target/idl/*.jsonexpect.fail("TODO")scaffolding covering all flows + error paths)migrations/deploy.ts+migrations/pin-program-ids.tsCompanion PRs (in x402r-scheme)
🤖 Generated with Claude Code