feat(go): authCapture EVM scheme and escrow spec#2298
Draft
avidreder wants to merge 14 commits into
Draft
Conversation
|
@avidreder is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
Introduces the `escrow` scheme for x402, built on Base's Commerce Payments Protocol. Supports two settlement paths: authorize (funds held in escrow) and charge (direct to receiver), both refundable post-settlement. Refs: x402-foundation#834, x402-foundation#1011 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Generalize scheme_escrow.md to be network-agnostic - Tighten verification: strict amount equality, tokenCollector recipient check, settlement simulation - Add error codes section and assetTransferMethod note - Simplify nonce derivation explanation
- Rename escrow → commerce per reviewer feedback - Add expiry fields to PaymentRequirements example - Align expiry field descriptions and example values Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Adds the commerce payment scheme using ReceiveWithAuthorization with AuthCaptureEscrow for authorize/charge settlement. Key differences from exact: deterministic nonce from PaymentInfo, funds flow through tokenCollector, exact amount matching, and escrow-based settlement. Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
- Delete specs/schemes/commerce/ spec files; add specs/schemes/authCapture/ - Remove SchemeCommerce constant; rename CommercePaymentInfo → AuthCapturePaymentInfo, ComputeCommerceNonce → ComputeAuthCaptureNonce; drop deprecated CommercePayload types - Move go/mechanisms/evm/commerce/ → go/mechanisms/evm/authCapture/ (client/server/facilitator); rename CommerceEvmScheme → AuthCaptureEvmScheme and all constructors accordingly - Delete stale examples/go/commerce/; update core-select-requirement example to authCapture - Update ultravioleta-dao metadata.json schemes array Co-authored-by: Cursor <[email protected]>
Include .env-example, .gitignore for the built binary and local env, and a minimal client demonstrating authCapture payments. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Move ComputeAuthCaptureNonce, PaymentInfoTypehash, and AuthCaptureEscrow contract ABIs from package evm into authCapture/core for parity with batch-settlement packaging. HashReceiveWithAuthorization stays in eip712.go. Co-authored-by: Cursor <[email protected]>
Require fee bounds and validate typed deadline/fee inputs so generated authCapture payloads match the current scheme requirements. Co-authored-by: Cursor <[email protected]>
Use the Base Commerce Payments v1.0.0 deployment addresses and validate authCapture amounts against the on-chain uint120 bound before signing. Co-authored-by: Cursor <[email protected]>
d8c3976 to
e09b33e
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.
Summary
main(no duplicate spec edits in this branch).specs/schemes/commerce/in favor of authCapture.examples/go/clients/authcapture/(with.gitignorefor the built binary and.env).ultravioleta-dao) schemes list to useauthCapture.Scope
go/mechanisms/evm/authCapture/, shared helpers inconstants.go,eip712.go,types.go, and related example server updates.Testing
go test ./mechanisms/evm/authCapture/...Made with Cursor