Ask402

What is EIP-3009, and why does x402 use it?

Short answer

EIP-3009, Transfer With Authorization, lets the owner of a token approve a transfer by signing a message instead of sending a transaction. Someone else can then submit that signature and pay the network fee. x402 uses it as the default way to pay on EVM networks, which is why a buyer can pay in USDC without holding any ETH. USDC supports it.

The problem it solves

Normally, moving a token on Ethereum means sending a transaction, and sending a transaction costs gas, paid in the network's own coin. A buyer with only USDC could not pay for anything.

EIP-3009 separates the two jobs. The owner signs a message that says what transfer they allow. Anyone can then carry that signed message to the token contract, which checks the signature and moves the tokens. Whoever carries it pays the gas.

In x402, the carrier is the facilitator.

Key facts

Full titleERC-3009: Transfer With Authorization
AuthorsPeter Jihoon Kim, Kevin Britz, David Knott
CreatedSeptember 28, 2020
StatusDraft
Builds onERC-20 tokens and EIP-712 typed signatures
Main functiontransferWithAuthorization

What the buyer signs

Six values:

FieldMeaning
fromThe buyer's address
toThe seller's address
valueThe amount, in the token's smallest unit
validAfterThe earliest time the transfer may happen
validBeforeThe time after which it is void
nonceA random 32-byte number that makes this authorization unique

The signature covers all six. Change any one and the signature no longer matches, so the token contract refuses it. The x402 specification states that the facilitator cannot modify the amount or the destination.

Why random nonces

Ethereum transactions use a counter: 1, 2, 3. That forces them to be processed in order. EIP-3009 uses random nonces instead, so, in the words of the standard, users can "create as many transactions as they want at the same time". An agent can sign many payments to many sellers at once and none of them blocks another.

The token contract remembers every nonce it has seen from each address. A used nonce is rejected, which is how a payment is prevented from being submitted twice. See replay protection.

How x402 uses it

  1. The 402 reply names the token and includes its EIP-712 name and version in the offer's extra field. The client needs both to build the signature.
  2. The client signs the authorization and sends it, with the six values, in the PAYMENT-SIGNATURE header.
  3. The facilitator checks that the signature belongs to from, that the balance is enough, that the amount and time window match the offer, and simulates the transfer.
  4. The facilitator calls transferWithAuthorization on the token and pays the gas.

Tokens without EIP-3009

Not every token has it. For those, x402 falls back to Permit2, which works with any ERC-20 token but needs a one-time approval first. There is also ERC-7710 for smart accounts that delegate.

If you are choosing a token to charge in, one with EIP-3009 gives buyers the smoothest path. USDC has it.

EIP-3009 and EIP-2612

Both let a signature stand in for a transaction. EIP-2612, usually called "permit", signs an allowance that someone can then spend from, and uses a counter for its nonce. EIP-3009 signs the transfer itself and uses random nonces. The EIP-3009 text encourages tokens to implement both.

One caution for contract authors

The standard also defines receiveWithAuthorization, which checks that the caller is the payee. Smart contracts that accept these transfers should use it, because a signed transferWithAuthorization seen in the public queue can be submitted by someone else first.

Sources

Facts checked against these sources on . Protocols change, so the official specification wins if it disagrees with this page. Read this page as Markdown.

Who writes this. Ask402 is published by Havok Holdings LLC, which also runs Agent402, one of the x402 services covered here. Agent402 is labelled wherever it appears. Everything else is described from each project’s own documentation, and nobody pays to be listed.