x402 facilitator
Arclight runs an open x402 v2 facilitator on Arc. A seller returns HTTP 402 with payment requirements, the buyer signs a USDC or EURC authorization (EIP-3009), and the facilitator verifies it and settles it on chain. Both assets have 6 decimals, so amounts are in 6-decimal units either way.
Endpoints
Payment requirements for Arc
This is what your server puts in the 402 response. The extra block is the EIP-712 domain of the asset you are charging in, and it must match that asset.
{
"scheme": "exact",
"network": "eip155:5042",
"asset": "0x3600000000000000000000000000000000000000",
"amount": "10000",
"payTo": "0xYourReceivingAddress",
"maxTimeoutSeconds": 60,
"extra": { "name": "USDC", "version": "2" }
}To charge in euros instead, change those two fields:
"asset": "0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1",
"extra": { "name": "EURC", "version": "2" }Seller in two lines
Any x402 v2 server SDK works. Set the facilitator URL and the network; the SDK builds the requirements and calls verify and settle for you.
import { HTTPFacilitatorClient } from '@x402/core/server'
import { ExactEvmScheme } from '@x402/evm/exact/server'
import { paymentMiddlewareFromConfig } from '@x402/hono'
const facilitator = new HTTPFacilitatorClient({ url: 'https://x402.arclight.finance' })
app.use('/api/answer', paymentMiddlewareFromConfig(
{
'GET /api/answer': {
accepts: {
scheme: 'exact',
network: 'eip155:5042',
payTo: '0xYourReceivingAddress',
price: { amount: '10000', asset: '0x3600000000000000000000000000000000000000' },
maxTimeoutSeconds: 60,
extra: { name: 'USDC', version: '2' },
},
description: 'One answer',
mimeType: 'application/json',
},
},
facilitator,
[{ network: 'eip155:5042', server: new ExactEvmScheme() }],
))Buyer: an agent paying for a call
- An EVM key holding USDC, or EURC, on Arc (chain id 5042, RPC https://rpc.mainnet.arc.io).
- A seller whose 402 lists network eip155:5042. The Arclight API demo is priced at 0.001 USDC per call.
- Nothing from us. The facilitator has no keys, no signup and no allowlist.
import { wrapFetchWithPayment, x402Client } from '@x402/fetch'
import { ExactEvmScheme } from '@x402/evm/exact/client'
import { privateKeyToAccount } from 'viem/accounts'
const signer = privateKeyToAccount(process.env.AGENT_KEY as `0x${string}`)
const client = new x402Client().register('eip155:*', new ExactEvmScheme(signer))
const fetchWithPayment = wrapFetchWithPayment(fetch, client)
const res = await fetchWithPayment('https://api.arclight.finance/v1/x402/demo')Buyer: a NEAR account, with no Arc key
NEAR's MPC network controls one root key and signs for a derived key only when the call comes from the NEAR account that derives it. The facilitator sees an ordinary secp256k1 signature.
Limits
- Verify: 10 a second per IP.
- Settle: 2 a second per IP, 60 a minute per receiving address, 20 a minute per payer.
- Body: 32 KB.
- One settle at a time per authorization.
Sponsored gas and ARCLIGHT
Arclight pays the gas on every settlement. Each receiving address gets 100 sponsored settlements a UTC day at no cost and with nothing staked.
- Nothing staked: 100 settlements a day.
- 250,000 ARCLIGHT: 500 a day.
- 1,000,000 ARCLIGHT: 1,500 a day.
- 5,000,000 ARCLIGHT: no per-seller cap.
What the facilitator never does
- Hold your funds. The transfer goes from the payer to the seller in one call; our wallet only pays the gas.
- Retry a reverted settle.
- Ask for a key or a deposit.
- Charge a fee. Gas is paid by Arclight inside a daily budget.
Status: x402.arclight.finance/health. Live demo: /x402.