Payment flows
Payment Flows
Payment Flows
ChainPe supports two payment paths. Both settle on Avalanche C-Chain in USDC; they differ in who signs what and who pays gas.
Standard x402 flow (EIP-3009)
The most common path. The agent wallet signs a USDC transferWithAuthorization and the facilitator submits it on-chain:
- Initiation — agent sends request; server returns 402 with payment requirements
- Signing — agent signs an EIP-3009 authorization off-chain (no gas)
- Settlement — facilitator submits the signed authorization; Avalanche confirms in ~1-2s
- Response — server returns 200 with
X-PAYMENT-RESPONSEheader
PolicyVault flow (EIP-712)
For agents that operate under an owner-defined spending policy:
- Funding — owner deposits USDC into PolicyVault and sets a policy
- Signing — agent signs an EIP-712
Spendauthorization off-chain (no gas) - Relay — relayer submits
PolicyVault.spend()and pays gas - On-chain enforcement — contract checks all policy constraints before transferring
Cross-chain ICM flow
For agents on one Avalanche L1 hiring services on another:
- Intent — agent calls
ChainPeICMSender.sendPaymentIntent()on source L1 - Teleporter delivery — ICM relays the message to destination L1 (~seconds)
- Receipt —
ChainPeICMReceiver.receiveTeleporterMessage()records the intent - Settlement — off-chain relayer or destination service processes the intent