← Blog
December 3, 2026 · 17 min

x402 auth-capture on Arc: when the gas token is the payment token

On Arc, USDC is both what the agent pays with and what the facilitator burns as gas. x402's auth-capture facilitator assumed those were different things. As a result, a collect that confirmed on chain was reported as failed. We re-read the transaction, ran both SDK versions against concurrent traffic, and found that the open fix covers the case in the report and nothing around it.

Issue #4554 was opened on 1 December 2026 by a team running a custom-operator auth-capture facilitator on Arc testnet with @x402/evm 2.32.0. Their collect transaction succeeded, and the payer's USDC moved into escrow. Then /settle returned invalid_auth_capture_evm_simulation_failed, so the resource server refused to serve. The cause is a single line: the facilitator's token balance must never go down. On Arc it always does, by the gas fee.

Two fix PRs followed within six hours, both from PhilBot402 and co-authored by phdargen: #4561 for TypeScript (head 3182539) and #4560 for Go (head ee83baf). Both are open with no maintainer review. The x402 auth-capture scheme itself is the one we audited in our auth-capture escrow post. Arc, Circle's L1, is the chain we compared with Tempo and Kite in the stablecoin-chains post. This post is where the two meet.

Here is what we did. We re-read the reported transaction on Arc testnet, block by block. We read the spec and both SDK checks at main c0b465d. We ran eight extra cases through the TypeScript test harness against main and against the PR head. And we probed Arc's simulation endpoint to see whether gas can be priced before broadcast. The bug in the report is real and the fix is correct for it. Underneath it sits a broader problem the fix does not touch: the facilitator compares balances, not transactions.

One balance, two decimals, two logs

Arc has no ETH. In the words of Arc's DeFi integration guide, "Arc uses USDC for gas fees, not ETH." The native balance has 18 decimals (msg.value, address.balance). An ERC-20 interface at 0x3600000000000000000000000000000000000000 exposes the same balance in 6 decimals. The guide says it plainly: "Both views draw from the same underlying balance." The contract addresses page lists that address on mainnet and testnet alike, as an "optional ERC-20 interface for interacting with the native USDC balance."

Logs come in two forms as well. According to Arc's USDC system events reference, a system emitter at 0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE "logs a Transfer for every explicit USDC transfer" at 18 decimals. Arc describes this as its implementation of EIP-7708, shipped ahead of Ethereum. The ERC-20 contract emits its own 6-decimal Transfer for interface calls, so one transfer() produces two logs. And the line that matters most here: "Gas fees and block rewards are not emitted as Transfer events."

x402 already treats Arc as a payment network. The TypeScript, Go and Python default-asset tables list 0x3600…0000 as USDC (EIP-712 name USDC, version 2, 6 decimals) for both eip155:5042 and eip155:5042002. Mainnet is live. rpc.mainnet.arc.io answered chain id 5042 when we queried it. The commerce-payments v1.1 AuthCaptureEscrow (0xf968…B19c, 10,978 bytes) and its EIP-3009 token collector (0x8612…ab88, 3,982 bytes) are deployed at the same addresses on both networks. So the auth-capture path is open on Arc mainnet today.

The transaction, re-read

The report names one transaction: 0xe681…c32c, block 74,933,980 on Arc testnet, mined on 30 November 2026 at 19:14:26 UTC. We pulled the receipt and every balance from a public Arc testnet RPC.

# receipt
status 1 · type 2 · gas limit 1,000,000 · gasUsed 390,572
baseFee 20 gwei · tip 38.215 gwei · effectiveGasPrice 58,215,299,998 wei
fee = 22,737,266,150,818,856 wei = 22,737.27 USDC units (6 dp)

# balanceOf at block 74,933,979 -> 74,933,980 (6 dp)
facilitator  0x00F8…D9f8   2,000,000 -> 1,977,262   (-22,738)
payer        0x4b07…f36c   8,000,000 -> 7,990,000   (-10,000)
token store  0xef66…7abb           0 ->    10,000   (+10,000)

# native balance, same blocks (18 dp)
facilitator  2.000000000000000000 -> 1.977262733849181144

The payer and token-store deltas are exact. The facilitator lost 22,738 units, which is the gas. The payment was 10,000 units, or 0.01 USDC. Gas for the collect cost 0.0227 USDC, more than twice the payment. Most of that was the tip: at the 20 gwei base fee alone the same gas would have cost 7,811 units. The facilitator's nonce before this transaction was 0, so this was its first transaction.

The receipt has seven logs. There is an operator event, the escrow's event from the v1.1 AuthCaptureEscrow, and an EIP-3009 AuthorizationUsed from 0x3600. The rest are two pairs of Transfer logs, payer to collector and collector to token store, each pair emitted once by the system address in 18 decimals and once by the token in 6. None of the seven mentions the facilitator. The fee shows up in the balance and nowhere in the logs, just as Arc's docs describe.

Look again at the native balance. After the fee, the facilitator holds 1.977262733849181144 USDC. balanceOf reports 1,977,262 units. The ERC-20 view drops the last twelve digits, so the 0.73 units below its precision are invisible to any check that reads it.

Where the check lives

The auth-capture EVM binding treats a "custom" operator as untrusted contract code. A facilitator that relays into it must cap the gas and "assert the outcome, not the absence of a revert". It must confirm the escrow's event, the exact payment-state transition, and that "the net token movements match the operation." Then comes the sentence that breaks on Arc: "No token movement may originate from a facilitator-controlled address." The same checks run again after confirmation: "a successful receipt status alone is insufficient."

The two SDKs implement this with balance snapshots. In TypeScript, collect.ts reads the payer, token store and facilitator balances before broadcast. It reads them again after the receipt arrives and calls hasExpectedCollectBalanceChanges. Its first test is after.facilitator < before.facilitator, which returns false. In Go, custom.go does the same in checkTransition, with the message "custom operator call reduced the facilitator's token balance". Python ships no auth-capture mechanism.

On Arc the payment token and the gas token are one asset, so the facilitator's balance falls on every collect it submits. The rule as written cannot pass. TypeScript reports the failure as invalid_auth_capture_evm_simulation_failed and Go as an unexpected payment state. Both attach the hash of a transaction that succeeded. Delegated operators are not affected, because that path has no balance check.

The pre-broadcast simulation passes because simulation charges nothing. We confirmed this on Arc testnet. We sent eth_simulateV1 three calls from the reporting facilitator's address: a balanceOf, a 1-unit transfer, and another balanceOf. In the default mode (validation: false) the simulated block reported a base fee of 0x0. The balance went from 1,510,614 to 1,510,613, exactly the transfer. Gas was free.

What a failed settle leaves behind

Custom operators are collect-only. The spec makes them async: the collect puts the payer's funds in escrow, and capture, void and refund happen out of band against stored payment state. The server is supposed to record the hold and capture later. With a failed settle there is nothing to record, because the SDK said the payment failed.

We read what the TypeScript server core does with that answer. The reported collect is an authorize, which belongs to the escrow payment flow, and the core settles that flow before the handler runs. When that settle fails, the core returns the failure at once. The response is status 402, with a PAYMENT-RESPONSE header encoding success: false and the transaction hash. The handler never runs. The charge path (the authorization flow) settles after the handler instead, and there the Express adapter throws away the buffered response. Either way the buyer gets no resource. The payer's 0.01 USDC sits in the operator's token store. The spec gives two ways out: the operator voids the hold out of band, or the payer calls reclaim once the capture deadline has passed. The agent has paid, gets nothing, and waits for a deadline before it can recover the funds.

This failure has the same shape as the one in our settle-gate adapter audit, from the opposite direction. There, money moved and the response was lost. Here, money moved and the system declared it hadn't. A buyer that reads a 402 as "not charged" and signs again opens a second hold. NSPG13, in the first comment on the issue, flagged this directly. Any fix should "keep the already-confirmed transaction attached to the failure/reconciliation path so callers do not treat this as proof that no money moved."

The fix, and the rounding it gets right

Both PRs take the same approach. A new map, NATIVE_GAS_TOKENS in TypeScript and NativeGasTokens in Go, maps eip155:5042 and eip155:5042002 to 0x3600…0000. The signer's receipt type gains gasUsed and effectiveGasPrice. When the payment token is the network's gas token and both fields are present, the facilitator may lose up to ceil(gasUsed × effectiveGasPrice / 10^12) units. Payer, token-store and receiver deltas stay exact. Any other token, or a receipt missing either field, keeps the old rejection. Simulation keeps rejecting any facilitator drop, because it has no receipt.

The ceiling is the right bound, and it is worth seeing why. balanceOf floors an 18-decimal balance to 6 decimals. Write the fee as F + f units, with f the fraction below one unit. Write the facilitator's prior sub-unit remainder as r. The visible drop is then F when r ≥ f and F + 1 when r < f. In the reported transaction the balance started at exactly 2.000000 USDC, so r = 0, f = 0.27, and the drop was 22,738, the ceiling. A floor-based allowance would fail whenever the dust left by earlier fees is smaller than the new fee's fraction. Each settle changes that dust, so a floor bound would pass or fail depending on the previous transaction.

We checked out the TypeScript PR head and ran its auth-capture facilitator test file. All 181 of its tests pass, along with our additions. Its own cases pin the edge exactly: 22,738 accepted on both Arc networks, 22,739 rejected, a 1-unit drop of a non-gas token rejected, and a missing gas field rejected. A later commit in the PR also merges roles that share an address, so a facilitator that is also the receiver is checked against its summed delta. On the Go PR, NSPG13 found one robustness bug: calling SetMinedGas with a price and then with nil keeps the old price. The PR's own call sites build fresh receipts, so it doesn't trigger there.

Neither PR changes the spec. The sentence "No token movement may originate from a facilitator-controlled address" stays as it is. A facilitator written from the spec alone, which is the reader the spec addresses, still fails every custom collect on Arc.

A balance delta is not a transaction's effect

Then we looked at where the snapshots are taken. In TypeScript, the "before" read is a readContract with no block tag, so it reads the latest state before broadcast. The "after" read is the same call made after the receipt arrives, again at the latest state. Go is the same: customSnapshotFor runs a Multicall at latest both times. It even retries the second read while the node still shows the pre-collect payment state. Neither SDK pins a read to the receipt's block. The check compares two points in time, and anything else that moves those balances in between counts as part of this collect.

Several things can land in that window. The token store belongs to the operator (getTokenStore(operator)), so every payment through that operator flows into the same address. The payer is an agent that may be paying other sellers at the same moment. And on Arc, every transaction the facilitator sends costs it USDC.

We tested this with the SDK's own harness. The auth-capture test file mocks the RPC, so a test can choose what the post-confirmation read returns. We added eight cases and ran them against main and against the PR head. These are unit runs with mocked reads, not on-chain reproductions.

case                                               main     PR #4561
exact deltas (control)                             success  success
token store also got a second 1 USDC collect       FAIL     FAIL
token store also got 1 unit of dust                FAIL     FAIL
payer also paid a second seller 1 USDC             FAIL     FAIL
payer also received a 5 USDC top-up                FAIL     FAIL
arc: facilitator down by one fee (22,738)          n/a      success
arc: one fee + a second concurrent settle's fee    n/a      FAIL
arc: one fee + a 21,000-gas transfer, same price   n/a      FAIL

every FAIL: invalid_auth_capture_evm_simulation_failed, transaction = mined hash

The first four failures occur on every chain. Two buyers paying through the same custom operator within one confirmation window can each see the other's deposit in the token store. Both collects can then be reported as failed after both have confirmed. A single unit of dust sent to the token store by anyone has the same effect. So does a payer whose balance moves for any reason between the two reads.

The last two failures are specific to Arc, and the fix does not reach them. The allowance is the fee of this transaction. If the facilitator submits a second settle and it lands inside the window, its balance falls by two fees and the check fails. The same happens with any other outgoing transaction. A facilitator serving real traffic submits many transactions from one key. We measured Arc testnet at 10,000 blocks in 5,050 seconds and mainnet at 10,000 blocks in 5,066 seconds, about one block every half second. The window covers broadcast, inclusion, receipt polling and two rounds of reads, so it spans several blocks. The block that held the reported collect contained four transactions.

Simulation cannot price it naively either

One idea is to move the gas into the simulation, so the pre-broadcast check sees the same drop as the receipt. We re-ran the same three-call probe with validation: true. Gas was charged: the simulated block reported the real 20 gwei base fee. The two balanceOf reads came back as 1,211,614 and 1,210,053, both about 299,000 units below the real balance.

The reads were sent from the facilitator's address, so each read paid for its own gas. Under validation, the full gas prepayment for the call is deducted before execution and refunded after. A read of the sender's own balance therefore sees the balance minus the prepayment. The difference between the two reads checks out: 1,561 units, which is the 1-unit transfer plus 29,296 gas for the first read and 48,710 gas for the transfer, at 20 gwei. The TypeScript SDK sends its whole simulated batch, reads included, with the facilitator as account. If that batch moved into a validating simulation unchanged, its balance reads would measure their own prepayments.

What per-transaction evidence looks like

The spec already allows a better source. It requires a simulation RPC with "enough pre- and post-call state to establish those conditions, whether through state diffs or stateful follow-up reads." Today's SDKs take the follow-up-read path at latest, which is the weakest form of that option. There are three stronger ones.

The receipt's own logs. A Transfer log belongs to exactly one transaction, so concurrent traffic cannot leak in. On Arc this view leaves out the gas by construction: the reported receipt carries no log for the facilitator, as Arc's docs say. The catch is Arc's double emission. Native sends appear only under the system emitter, and ERC-20 calls appear under both. A log-based check has to read both emitters and de-duplicate the pairs, or it will either miss native value or count every token transfer twice.

Reads pinned to the receipt's block. Reading at blockNumber − 1 and blockNumber narrows the window from several blocks to one. The public Arc RPC we used served both historical reads. It still does not isolate the transaction. Any other transaction in the same block that touched the token store, the payer or the facilitator would still show up.

A state diff of the transaction. debug_traceTransaction with prestateTracer in diff mode gives balance changes for one transaction only, with the gas included and attributable. It is the most exact option, and the least available. Both public Arc testnet endpoints we tried refused it. dRPC said "method is not available on free plan", and rpc.testnet.arc.io said "method not supported". A facilitator that wants this needs its own node or a paid tracing plan, and the spec already says a facilitator without these capabilities must not offer "custom".

Behind all three is a design choice the spec should make explicit. "No token movement may originate from a facilitator-controlled address" is a statement about the transaction's own token movements: transfers it made, not balance changes that happened nearby. Under that reading, a gas fee on Arc is not a movement the operator caused, and a concurrent deposit is not part of this collect. Under a balance reading, both are. The PRs fix one symptom of the balance reading on two networks. The network map also leaves a gap: a facilitator account that pays gas in USDC through a paymaster, the setup we examined in the Circle Paymaster audit, would see the same kind of drop on any chain, and the map would not cover it.

What it means for LLM4Agents

Our gateway is not exposed to this today. x402 walk-up payments on LLM4Agents settle USDC on Base through the exact scheme. There is no auth-capture path, no custom operator and no Arc. Nothing in this post changes how a paid request behaves on our side.

It does change how we plan the next payment flow. Auth-capture fits variable-cost inference well: hold the ceiling, capture what the call actually cost, void the rest. Our video tools already work as reserve-then-adjust on the Bearer balance, and auth-capture is the x402 form of that pattern. This audit shows where a hold-based flow can go wrong in a way exact cannot. The facilitator can lose track of whether money moved. A collect that confirmed but was reported as failed leaves an agent's funds held and its request unanswered. That is worse than a clean failure, because the agent has paid and cannot tell.

Arc itself is a rail worth adding. It has USDC-native gas, a live mainnet (chain id 5042), the commerce-payments contracts already deployed, and x402 default assets already listed. The cost is operational. On Arc the gas float and the revenue are the same asset. Fees are 18-decimal wei that must be converted with a ceiling to compare against 6-decimal balances. Every indexer has to tell two emitters apart. Each of these is a place where a reconciliation that is correct on Base gives the wrong answer on Arc.

Staying on the frontier

1. Treat a settle failure that carries a transaction hash as an open payment. A failure with a mined hash should not be read as "unpaid". Before returning a 402 that invites a second payment, we look up the hash, read the escrow's payment state, and either complete the request or record the hold for void. This applies to every scheme we add, not only auth-capture.

2. If we run a facilitator path with balance checks, check per transaction. Our order of preference is receipt logs first, with Arc's two emitters de-duplicated, then reads pinned to blockNumber − 1 and blockNumber. Unpinned reads at latest are not acceptable. The regression suite gets the eight cases above, especially the shared token store and the second facilitator fee.

3. Keep Arc's gas float separate from revenue. If we add Arc, the address that pays gas never receives payments. Fees are accounted from receipts as gasUsed × effectiveGasPrice in 18 decimals and converted with a ceiling. We watch the tip as well: the reported collect paid 38 gwei on top of a 20 gwei base fee, nearly tripling its cost.

4. Track #4560 and #4561 and the spec sentence. When they merge, we re-run the harness against the released @x402/evm. The test that matters is the one the PRs don't include: two collects through one operator within a single confirmation window. The remaining fix belongs in the spec: define "token movement" as the transaction's own transfers, and name gas on a gas-token network as outside it.

5. Check settlement against what actually happened on chain. This is the third x402 audit in which the problem was the gap between what /settle reports and what the chain holds. The finality audit covered success reported before the chain was final. The settle-gate audit covered money that moved while the response was lost. This one covers a confirmed collect reported as failed. The approach that held up in all three was to keep the transaction hash and reconcile against chain state.

One endpoint, per-call payment in stablecoins

LLM4Agents gives agents an OpenAI-compatible gateway to 345+ models and MCP tools, paid per use in USDC over x402 or from a prefunded balance.

Register your agent