← Blog
November 20, 2026 · 8 min

x402 2.31.0: three SDKs, three answers to the same amount

x402 published 2.31.0 on 12 November. A week later, thirty-three pull requests had merged and none had shipped. The gap between the release and the queue is where this week's bugs are, and the main one is that the same amount string means a different number in each SDK.

The npm registry dates @x402/core 2.31.0 at 2026-11-12 22:09:52 UTC and @x402/evm 2.31.0 at 22:15:21 UTC. PyPI dates x402 2.28.0 at 22:19:18 UTC the same night. The Go proxy reports go/v2.31.0 at 22:04:42 UTC, tag commit 07c4caf. That is eight days after 2.30.0, which we covered in the 6 November roundup. Python numbering is independent, so 2.28.0 is the counterpart of 2.31.0.

Volume, for scale: @x402/core moved 2,527,049 downloads in the 30 days to 19 November, and @x402/evm 1,648,190. A change to how amount is parsed reaches a lot of agents in one publish.

What amount means, measured

The exact EVM facilitator compares two integers and nothing else. In the published 2.31.0 bundle, verifyEIP3009 contains:

if (BigInt(eip3009Payload.authorization.value) !== BigInt(requirements.amount)) {
  return {
    response: { isValid: false, invalidReason: ErrAuthorizationValueMismatch, payer },
    classification
  };
}

We signed a real EIP-3009 TransferWithAuthorization for 10,000 atomic USDC on Base, then changed only requirements.amount and called verify with simulate: false against @x402/evm 2.31.0. Four spellings that no sender would write on purpose verify as 10,000:

// @x402/evm 2.31.0, signed payload value = "10000"
"10000"    isValid: true
"0x2710"   isValid: true   // hex literal, BigInt() accepts it
" 10000 "  isValid: true   // surrounding whitespace is trimmed
"+10000"   isValid: true   // unary plus
"010000"   isValid: true   // leading zero
"1_000"    // SyntaxError thrown out of verify()
"1e4"      // SyntaxError thrown out of verify()
"10000.0"  // SyntaxError thrown out of verify()

Two of those outcomes are worse than a rejection. A thrown SyntaxError leaves verify entirely. In the TypeScript HTTP layer processHTTPRequest catches the throw and builds a fresh 402 whose top-level error field is the exception message — Cannot convert 1_000 to a BigInt — so the seller's logs carry a JavaScript engine string where a spec code belongs, and the payer sees nothing actionable. And "0x2710" passing means the amount in the requirements is not the amount anyone reads off the wire.

Python 2.28.0 uses int(requirements.amount), which is a different function with different rules. "0x2710", "1e4" and "10000.0" raise ValueError straight out of verify. " 10000 ", "+10000" and "010000" pass. And "1_000" passes, because int() reads underscores as digit separators: we sent a payload authorizing "1000" against requirements "1_000" and the shipped Python facilitator returned is_valid: True. The same requirement string is an error in both other SDKs, so a 402 that a Python facilitator considers well-formed can never settle on a TypeScript or Go one.

Go 2.31.0 uses new(big.Int).SetString(requirements.Amount, 10). It accepts "+10000" and "010000", and rejects "0x2710", " 10000 ", "1_000", "1e4". So in the published set: TypeScript and Go disagree on "0x2710" and " 10000 "; Python disagrees with both on "1_000".

The spec does not settle it. scheme_exact_evm.md on main shows "amount": "10000" in its examples and says verify must check that the authorization parameters meet the PaymentRequirements. It never says the string is canonical decimal. Every SDK therefore inherited its language's integer parser, and the three languages inherited three.

The fix merged, the fix has not shipped

Three PRs, one per language, close it. They merged on 16 and 17 November, four to five days after the release, and none is in 2.31.0 or 2.28.0. We checked: v2.31.0 of the Go module has no ParseUint256String anywhere, and grepping the published @x402/evm 2.31.0 bundle for invalid_exact_evm_required_amount returns only the upto sibling constant, which predates this.

The TypeScript PR also changes the server side in a way worth reading closely, because it is where a seller can be surprised. parsePrice previously returned any AssetAmount object untouched. Now an undotted amount must pass the canonical check, and a dotted amount is deferred to enhancePaymentRequirements, which converts it using the registered decimals for a known default asset and throws otherwise:

// @x402/evm 2.31.0: both are returned verbatim
await server.parsePrice({ amount: "0.01", asset: BASE_USDC }, "eip155:8453");
// { amount: "0.01", asset: "0x8335..." }  -> enhance converts to "10000"

await server.parsePrice({ amount: "1e4", asset: BASE_USDC }, "eip155:8453");
// { amount: "1e4" }                       -> enhance throws after #4303

So a seller that hand-builds requirements with a human amount is safe only if the asset is in the default table. That matters more than usual this week, because the default table is the next item.

Eight chains where the default asset is also the buyer's allowlist

PR #4337 (Shikhyy, merged 19 November) adds Circle-issued USDC as the default stablecoin on eight networks in all three SDKs: OP Mainnet (10), Unichain (130), Sonic (146), HyperEVM (999), Ink (57073), Linea (59144), Codex (81224) and Plume (98866).

We probed each token on its live chain rather than trusting the diff, the same check we ran on the table in the August default-assets audit. Name, symbol, decimals and the EIP-712 version() all match what the PR writes into the tables, including OP Mainnet's "USD Coin" against the others' "USDC" — a difference that matters because the domain name is part of the signed struct.

Why the default table is a security boundary. Since the spend-controls work in August, the TypeScript client filters incoming 402s before signing: an asset not in DEFAULT_ASSETS and not in spendControls.allowedAssets is dropped, and if everything is dropped it throws instead of paying. Adding a chain to the table is not only a convenience for "$0.01" pricing. It is the client declaring that it will sign payments in that token without the operator opting in.

The asymmetry is the point. In 2.31.0 — the version that is actually installable — DEFAULT_ASSETS has 32 entries and none of these eight chains is among them. We confirmed with selectPaymentRequirements against a live client: a 402 offering OP Mainnet USDC throws All payment requirements were rejected by spendControls, while the identical shape on Base is accepted, and adding the OP token to allowedAssets makes it pass. So today, a seller who prices in OP Mainnet USDC — or the sellers who will, once #4337 ships — is unpayable by a default-configured TypeScript agent until that agent's operator reads an error string and adds an entry.

That is a defensible default: nobody pays in an unknown token because a stranger's 402 asked. It is a bad sequencing: the seller-side defaults and the buyer-side allowlist move in the same PR, so the release that adds the chains is also the release that makes them payable. Until that ships, the two sides disagree, and the disagreement surfaces as a client exception rather than a 402 rejection with a reason code.

One more from the same PR: the seller-side default is what makes "$0.01" resolvable. On 2.31.0, parsePrice("$0.01", "eip155:10") throws No default asset configured for network eip155:10. On Base it returns 10000. Same code, same call, one network's worth of difference.

Three answers to a throwing afterVerify hook

The second thread of the week is the other half of what we audited in gate hook throws: the after hooks. Those ran through the same three SDKs and produced three different behaviors in the published versions, all verified by reading the installed sources.

PR #4249 (PhilBot402, merged 13 November) harmonizes them on the TypeScript behavior: log and skip, keep the verify outcome. Its own changelog keeps one exception — an async afterVerify hook registered on the synchronous server still raises. It also adds a sentence to the lifecycle-hooks doc that is the most useful line in the whole diff: a hook that must gate access, such as a ledger claim, should catch its own errors and return { abort: true }, because a throw is logged and the request continues.

Read that as a design constraint, not a footnote. Any hook whose failure should stop a payment must express that as a return value. In two of the three SDKs, an exception is not a veto.

Also merged, not shipped

Two more from the window are worth naming because they change behavior rather than comments.

#4222 (phdargen, merged 19 November) is marked breaking in its changeset. SVM batch-settlement /settle becomes one-shot: it succeeds only if the call itself broadcast and confirmed the transaction, or finished a settlement_pending record it found at the start. A reservation replaces the previous batch-local pending store, and the cost drops from seven to fifteen storage operations per settle to about two. Same-day follow-up #4357 reconciles refunds for settlement_pending records. This also lands spec text requiring a server to adopt extra.channelStates[] only when the entries are bound to the requested network, name exactly the channels it submitted, and satisfy payoutWatermark <= totalClaimed <= balance.

#4319 and #4316 tighten batch-settlement voucher signatures: only 65-byte, low-s, v of 27 or 28 is accepted, and the client-side recovery path no longer stores a voucher the onchain contract cannot recover. That is the same class of bug as amount parsing — a signature format that one library accepts and the consumer rejects — caught before it produced an unclaimable voucher.

Full census for the window 13 to 20 November: 33 merged pull requests, 13 from PhilBot402, 18 from outside the core maintainer and automation set. Since the 2.31.0 tag, 33 merged and zero published.

What it means for LLM4Agents

Our gateway quotes a price, the seller signs requirements, and the facilitator compares integers. This week's measurements say the third step is the one where a mismatch hides.

For the gateway, the concrete exposure is the quote-to-requirements path. If we ever emit requirements.amount from anything other than an integer we computed ourselves — a config value, a price table entry, a client-supplied hint — the published SDKs will interpret it differently, and the failure shows up as an invalid_exact_evm_payload_authorization_value_mismatch that looks like the payer's fault. The rule we can hold to now: emit only ^[0-9]+$, computed in integer units, never a formatted decimal, and never a value echoed from a 402 we received.

For the buyer side, the spend-control coupling is the one to plan around. The eight chains in #4337 become payable by default TypeScript clients only at the next release. Until then, a route priced in OP Mainnet, Unichain, Sonic, HyperEVM, Ink, Linea, Codex or Plume USDC is invisible to a default-configured agent, and becomes visible on a patch bump with no code change on the agent's side. That is a cost decision an operator should make deliberately, not discover.

For our own hooks — the ones we register on the resource server for billing and ledger claims — the lesson is to return { abort: true } rather than throw, and to treat a thrown exception in a Python server as a 5xx-shaped escape from verify_payment until 2.28.1 lands #4249.

Staying on the frontier

Ordered by cost of delay.

  1. Pin and audit the amount path this week. Check every place we construct PaymentRequirements for a value that is not produced by integer arithmetic on atomic units. Add a validation at the boundary that rejects anything outside ^[0-9]{1,78}$ with a 402 we generated ourselves, rather than letting a scheme throw. Do not wait for #4303/#4304/#4291 to ship: they only fix the receiving side, not the emitting side.
  2. Decide the default-asset posture before the release lands. Either accept the eight new chains as payable by default and say so in the operator docs, or set allowedAssets explicitly on every client we ship. The window between #4337 merging and shipping is the only time the decision is cheap.
  3. Write the hook contract down. Enumerate our resource-server hooks and mark each one as advisory (may fail, log and continue) or gating (must return an abort). Convert the gating ones to return values on all three SDKs, then add a test that throws inside each and asserts the payment is stopped.
  4. Track #4222 as a breaking change for any self-hosted SVM batch-settlement facilitator. A settle that previously succeeded across a retry will now succeed once and report duplicate_settlement or settlement_pending thereafter. The reservation change is worth the trade in storage cost, but it needs a retry policy that reads the response, not one that retries blindly.
  5. Re-verify on the next published tag, not on main. Every claim above about behavior comes from an installed package or module tag, because the merged state and the published state have disagreed for a full week now.

Run an agent that pays per call

OpenAI-compatible gateway, x402 settlement in USDC, spend caps you set.

Register an agent