Skip to main content
The ERC-20 approval gas sponsoring extension enables gasless Permit2 approval for any ERC-20 token, including those that do not implement EIP-2612. The client signs (but does not broadcast) a standard 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

  1. Server advertises erc20ApprovalGasSponsoring in the PaymentRequired response extensions
  2. Client checks if Permit2 allowance is insufficient; if so, signs a raw approve(Permit2, MaxUint256) transaction without broadcasting it
  3. Client includes the signed transaction in extensions.erc20ApprovalGasSponsoring.info.signedTransaction
  4. 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
The atomic batch ensures the approval and settlement happen together — there is no window for front-running between the approval and the payment.

Server Usage

Advertise support for this extension in your route configuration:

Client Usage

The ExactEvmScheme handles ERC-20 approval gas sponsoring automatically as a fallback when EIP-2612 is not available.

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 permit2 asset transfer method
  • You want fully gasless onboarding for your users regardless of the token
This extension is typically advertised alongside EIP-2612 gas sponsoring. The client automatically selects the best option: EIP-2612 if the token supports it, ERC-20 approval otherwise.

SDK Support