How x402 Works
Payment Flow
Buyer-initiated (MPC Signing)
Seller Settlement (Facilitator)
Upto Scheme (Variable Amount)
EIP-712 Typed Data Signing
x402 uses EIP-712 structured data signing to create payment authorizations. This ensures:- Domain separation — Signatures are bound to a specific chain and contract
- Human-readable — Wallets can display the authorization details before signing
- Replay protection — Each authorization has a unique nonce
Domain Separator
name: Token name (e.g., “USD Coin” or “Circle USDC”)version: Token version (e.g., “2”)chainId: Chain ID (e.g., 84532 for Base Sepolia)verifyingContract: USDC contract address
Authorization Hash
Transfer Methods
ERC-3009 (TransferWithAuthorization)
The native USDC transfer method. The payer signs an authorization that allows anyone to submit it on-chain:- Exact scheme only — The
valueis bound in the signature - Gasless for payer — The seller (or Facilitator) pays gas to execute
- Single transaction — Direct token transfer, no approval needed
Permit2 (PermitWitnessTransferFrom)
A universal method that works with any ERC-20 token via the Uniswap Permit2 contract:- Exact and Upto schemes — The
amountin permit is the maximum; actual transfer can be less - Proxy contracts — Paratro calls the x402 Permit2 proxy which handles the Permit2 interaction
- Witness data — Includes recipient address and validAfter timestamp
| Scheme | Proxy Contract | Address |
|---|---|---|
| exact | x402ExactPermit2Proxy | 0x402085c248EeA27D92E8b30b2C58ed07f9E20001 |
| upto | x402UptoPermit2Proxy | 0x4020a4f3b7b90CCA423b9FabCC0CE57c6c240002 |
Solana (Pre-signed Transaction)
For Solana, the payer constructs and signs a complete SPL TokenTransferChecked transaction:
- The Facilitator validates the transaction instructions (mint, amount, destination)
- Settlement broadcasts the pre-signed transaction to Solana RPC
- No additional signing needed — the transaction is ready to submit
MPC Threshold Signing
Paratro uses a 3-of-3 threshold signature scheme (TSS) to sign EIP-712 hashes:- Gateway computes the EIP-712 hash and dispatches to the TSS engine
- Three signing nodes independently compute partial signatures
- Partial signatures are combined into a valid ECDSA signature (v, r, s)
- No single node ever holds the complete private key
On-Chain Settlement
After the Facilitator submits the settlement transaction:- The smart contract verifies the EIP-712 signature on-chain
- USDC is transferred from payer to recipient
- An
AuthorizationUsedevent (ERC-3009) orTransferevent (Permit2) is emitted - Paratro monitors the event and updates the transaction status to
SETTLED - The payer’s locked balance is deducted; the recipient’s balance is credited