transferWithAuthorization. It is written
for sellers, buyers, and AI coding agents implementing either side of the
payment flow.
This path applies to chains such as Base, Ink, HyperEVM, Optimism, Polygon, and
Unichain when the selected payment token natively supports EIP-3009. Do not use
Permit2 on these chains for the normal USDC x402 flow. Permit2 is only for
chains whose payment token does not expose EIP-3009, such as MegaETH, BSC, and
BOT Chain.
For USDC routes supported by Across, this same EIP-3009 path can settle
cross-chain. The seller exposes one paymentRequirements entry per source
chain the buyer can pay from, and uses extra.destinationChainId when the
recipient should be paid on a different chain.
How the flow works
paymentRequirements.payTois the Meridian facilitator, not the seller walletpaymentRequirements.assetis the token that implements EIP-3009paymentRequirements.networkis the source chain the buyer pays fromauthorization.tois the Meridian facilitator- The EIP-712 verifying contract is
paymentRequirements.asset - The EIP-712 primary type is
TransferWithAuthorization paymentRequirements.extra.destinationChainIdenables an Across-backed destination chain when it differs from the source chainpaymentRequirements.extra.creditedRecipientcan carry the seller’s final recipient address when it differs from the facilitator-boundpayTo- The buyer does not approve Permit2, the facilitator, or any proxy
- The buyer does not sign a Permit2 witness payload
- The seller keeps the Meridian API key on the backend
Prerequisites
Seller:- A Meridian organization
- An organization API key from
https://mrdn.finance/dev/api-keys - A backend endpoint that can receive
paymentPayloadfrom the buyer
- A wallet on the selected chain
- Balance of the selected EIP-3009 payment token
@uniswap/permit2-sdk for this flow.
Network constants
The token addresses below are Meridian’s default EIP-3009 payment tokens for common networks. If your application accepts another token on the same chain, only use this flow after confirming that token implements EIP-3009transferWithAuthorization. Otherwise use the non-EIP-3009 Permit2 guide.
Seller setup
1. Create a Meridian API key
Seller-side setup starts in Meridian:- Connect the seller wallet at
https://mrdn.finance - Open
https://mrdn.finance/dev/api-keys - Create an organization-scoped API key
- Store the public
pk_...key on the server
Authorization header when calling Meridian:
2. Choose the network and amount
Amounts must use the selected source token’s base units. USDC-style EIP-3009 tokens usually have 6 decimals, but still bind the amount to the configured source token.3. Build paymentRequirements
Use the EIP-3009 token address as asset. Keep payTo pointed at the Meridian
facilitator.
4. Expose multiple source-chain routes
If the seller wants to accept payments from several chains, return onepaymentRequirements object per accepted source chain in accepts. The buyer
or SDK selects the entry matching the buyer’s connected wallet chain.
For a seller that wants to receive on Base but accept payment from Base, Ink,
and Optimism:
network: "ink" requirement. The
buyer signs on Ink against Ink USDC, Meridian pulls funds into the Ink
facilitator, and Across routes the output to Base before final settlement to
creditedRecipient.
Do not return only a Base requirement if you expect buyers to pay from Ink,
Optimism, or another chain. A paymentRequirements object is source-chain
specific because the EIP-712 signature domain includes the source chain and
source token contract.
Across currently uses exact-input routing in this flow. If the seller must
receive an exact destination-chain amount, quote the route and set each
source-chain maxAmountRequired high enough to cover Across fees.
5. Receive paymentPayload
The buyer sends raw JSON, not a transaction they submit on-chain.
Build or retrieve the matching paymentRequirements server-side; do not trust
buyer-supplied requirements for pricing, recipient, network, or token selection.
6. Settle with Meridian
CallPOST /v1/settle from the seller backend. Do not expose the Meridian API
key to an untrusted client.
Buyer setup
1. Select a payment requirement
Use the seller-provided requirement for the network and token the buyer will pay with. If the seller returned severalaccepts entries, choose the route
whose network matches the buyer’s connected source chain.
paymentRequirements.network.
2. Sign TransferWithAuthorization
The buyer signs typed data against the token contract. There is no ERC-20
approval, no Permit2 allowance, and no witness object.
3. Send paymentPayload to the seller
Serialize bigint values as decimal strings. Keep the nonce as the original
32-byte hex string.
Checklist for AI agents
- Read the seller’s existing route structure before adding payment handling
- Keep settlement on the backend
- Use this guide for Base, Ink, HyperEVM, and other EIP-3009 token chains
- Use
asset = EIP-3009 token address - Use
payTo = Meridian facilitator - For multi-chain sellers, return one
acceptsentry per source chain - For Across routes, keep
network,asset, andpayTosource-chain based - For Across routes, set
extra.destinationChainIdto the settlement chain id - Put the final seller recipient in organization settings or
extra.creditedRecipient - Use
authorization.to = Meridian facilitator - Use
domain.verifyingContract = paymentRequirements.asset - Use
primaryType = TransferWithAuthorization - Generate a fresh 32-byte nonce per payment
- Convert every bigint in
paymentPayloadto a string before JSON encoding - Do not add Permit2 approval, Permit2 SDK code, or Permit2 witness fields
Common mistakes
- Using Permit2 on Base, Ink, HyperEVM, or another native EIP-3009 token chain
- Setting
payToto the seller wallet - Setting
authorization.toto the seller wallet - Returning only a Base requirement when buyers need to pay from Ink or another source chain
- Signing with the destination chain id for a cross-chain payment
- Signing with the facilitator as the EIP-712 verifying contract
- Using the wrong token name or version in the EIP-712 domain
- Reusing an EIP-3009 nonce
- Sending raw
bigintvalues through JSON - Putting the Meridian API key in browser code