Skip to content

feat(go): authCapture EVM scheme and escrow spec#2298

Draft
avidreder wants to merge 14 commits into
x402-foundation:mainfrom
avidreder:avidreder/pr-1425-escrow-scheme-spec
Draft

feat(go): authCapture EVM scheme and escrow spec#2298
avidreder wants to merge 14 commits into
x402-foundation:mainfrom
avidreder:avidreder/pr-1425-escrow-scheme-spec

Conversation

@avidreder
Copy link
Copy Markdown
Contributor

Summary

  • Adds the escrow scheme specification and follow-up spec revisions.
  • Implements the authCapture EVM payment scheme in Go (client, server, facilitator), aligned with the authCapture specs already on main (no duplicate spec edits in this branch).
  • Removes the interim commerce scheme naming and specs/schemes/commerce/ in favor of authCapture.
  • Adds a minimal Go client example under examples/go/clients/authcapture/ (with .gitignore for the built binary and .env).
  • Updates ecosystem metadata (ultravioleta-dao) schemes list to use authCapture.

Scope

  • Go: go/mechanisms/evm/authCapture/, shared helpers in constants.go, eip712.go, types.go, and related example server updates.
  • TypeScript: no authCapture client implementation in this PR (EVM package unchanged for authCapture).

Testing

  • go test ./mechanisms/evm/authCapture/...

Made with Cursor

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

@avidreder is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added ecosystem Additions to ecosystem site go sdk Changes to core v2 packages examples Changes to examples website and removed ecosystem Additions to ecosystem site website labels May 13, 2026
A1igator and others added 14 commits May 15, 2026 11:38
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]>
- 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]>
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]>
@avidreder avidreder force-pushed the avidreder/pr-1425-escrow-scheme-spec branch from d8c3976 to e09b33e Compare May 15, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Changes to examples go sdk Changes to core v2 packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants