approve(Permit2, MaxUint256) transaction, and the facilitator broadcasts it atomically before settling the Permit2 payment.
Overview
This is the universal fallback for gasless Permit2 onboarding. While EIP-2612 gas sponsoring is preferred for tokens that support it, this extension works with every ERC-20 token:- For Buyers: No gas needed — sign an approval transaction off-chain and the facilitator broadcasts it
- For Sellers: Advertise this extension to support the widest range of ERC-20 tokens
- For Facilitators: Broadcast the pre-signed approval and settle in an atomic batch, optionally funding the client’s gas if needed
How It Works
- Server advertises
erc20ApprovalGasSponsoringin thePaymentRequiredresponse extensions - Client checks if Permit2 allowance is insufficient; if so, signs a raw
approve(Permit2, MaxUint256)transaction without broadcasting it - Client includes the signed transaction in
extensions.erc20ApprovalGasSponsoring.info.signedTransaction - Facilitator executes an atomic batch:
- Funds the client’s wallet with gas (if needed)
- Broadcasts the client’s signed approval transaction
- Calls
x402ExactPermit2Proxy.settle()to complete the payment
Server Usage
Advertise support for this extension in your route configuration:- TypeScript
- Go
- Python
Client Usage
TheExactEvmScheme handles ERC-20 approval gas sponsoring automatically as a fallback when EIP-2612 is not available.
- TypeScript
- Go
- Python
When to Use
Use this extension when:- You want to support any ERC-20 token, not just those with EIP-2612
- You’re using the
permit2asset transfer method - You want fully gasless onboarding for your users regardless of the token
SDK Support
| SDK | Supported |
|---|---|
| TypeScript | ✅ |
| Go | ✅ |
| Python | ✅ |