ERC-3009: The Protocol Powering x402 Payments

Published: (December 10, 2025 at 03:24 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Introduction

At the heart of x402’s payment mechanism lies ERC‑3009, a standard that enables gasless token transfers through cryptographic signatures. Understanding this protocol is key to grasping how x402 achieves frictionless payments without requiring users to hold native tokens for gas.

UX Problems with the ERC‑20 Approve/TransferFrom Pattern

  • Two transactions required: first approve, then transferFrom.
  • Two gas fees: users pay twice.
  • Native token dependency: must hold ETH just to move USDC.
  • Sequential nonces: transactions must be ordered, creating bottlenecks.

How ERC‑3009 Solves These Issues

Instead of on‑chain approvals, the payer signs an off‑chain authorization message that can be submitted by anyone.

function transferWithAuthorization(
    address from,
    address to,
    uint256 value,
    uint256 validAfter,
    uint256 validBefore,
    bytes32 nonce,
    uint8 v,
    bytes32 r,
    bytes32 s
) external;

function receiveWithAuthorization(
    address from,
    address to,
    uint256 value,
    uint256 validAfter,
    uint256 validBefore,
    bytes32 nonce,
    uint8 v,
    bytes32 r,
    bytes32 s
) external;

Workflow

  1. Payer signs a message conforming to EIP‑712 typed data.
  2. Message is sent to a relayer or facilitator (off‑chain).
  3. Relayer submits the signature on‑chain.
  4. Contract verifies the signature and executes the transfer.
  5. Relayer pays gas, not the payer.

Random Nonces vs. Sequential Nonces

AspectERC‑2612 (Sequential)ERC‑3009 (Random)
Nonce format0, 1, 2, 3…Random bytes32
Parallel ops❌ Must be ordered✅ Fully independent
High‑frequency use❌ Bottleneck✅ Scales infinitely

For x402 and AI agents, this is transformative: an agent can generate thousands of concurrent payment authorizations without conflicts.

x402 Protocol Flow Using ERC‑3009

  1. Client requests a protected resource.
  2. Server returns a 402 response with payment requirements.
  3. Client constructs an ERC‑3009 authorization message and signs it with their wallet.
  4. Client retries the request with an X-PAYMENT header containing the signed message.
  5. Facilitator verifies the signature.
  6. Server responds with the requested content.
  7. Facilitator settles by calling transferWithAuthorization.

Token Support

TokenIssuerERC‑3009 Support
USDCCircle✅ Yes (v2+)
EURCCircle✅ Yes
USDTTether❌ No
DAIMakerDAO❌ No

This is precisely why x402 focuses on USDC rather than USDT.

Feature Comparison: ERC‑2612 vs. ERC‑3009

FeatureERC‑2612ERC‑3009
PurposeApprove allowanceDirect transfer
StepsSign → Approve → TransferSign → Transfer
Nonce typeSequentialRandom
Use caseDeFi protocolsPayments, x402

Further Reading

ERC‑3009 transforms how we think about token transfers. By moving authorization off‑chain, it enables the frictionless, gasless payments that make x402 possible.

Back to Blog

Related posts

Read more »