Skip to content

x402 session sapient signer - #107

Draft
Agusx1211 wants to merge 4 commits into
masterfrom
x402-sapient
Draft

Agusx1211 wants to merge 4 commits into
masterfrom
x402-sapient

Conversation

@Agusx1211

@Agusx1211 Agusx1211 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Draft implementation of X402SessionSapientSigner — a digest-aware sapient signer that lets a Sequence wallet authorize x402 exact Permit2 payments under a committed, session-scoped policy.

  • Payments: reconstructs the canonical x402 Permit2 witness-transfer digest, validates it against the policy (token, per-payment cap, payment count via a deterministic Permit2 nonce word/slot, expiry, chain), and requires a wallet-bound session-key signature.
  • Setup: also authorizes a single token.approve(PERMIT2, max) transaction (KIND_TRANSACTIONS) so a session can self-provision its Permit2 allowance.

Design rationale and trust assumptions in docs/X402_SMART_SESSIONS.md. 39 tests, including end-to-end execute/isValidSignature paths.

@Agusx1211

Agusx1211 commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

Live Polygon x402 checks:

Otto AI, real third-party Permit2 payment

Bought https://x402.ottoai.services/crypto-news for 1000 Polygon USDC base units (0.001 USDC) from Sequence wallet 0xCD2604e4C01EfCfB133A240cA2fA7caf1D44B468.

This exercised:

Sequence wallet -> sapient signer ERC-1271 -> Permit2 nonce -> x402 exact Permit2 proxy -> Otto merchant

Txs:

Settlement went through proxy 0x402085c248EeA27D92E8b30b2C58ed07f9E20001 and transferred 1000 USDC to Otto 0x0E84dDEdAaE6A779c462C22a59F301EC31B6b808.

Comparison: real x402 but EIP-3009, not sapient signer

PayAI Polygon endpoint only advertised the default USDC/EIP-3009 route:

Earlier self-payment smoke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant