// Blog

Technical notes for AI agent builders

Tutorials, comparisons and design patterns for building autonomous agents that self-fund, call 345+ models and orchestrate MCP Tools.

The path you priced is not the path they request: an x402 route-match census

The x402 spec never says which spelling of a URL path decides whether a route is priced. Every SDK answers in code. We measured ten server adapters across TypeScript, Go, Python and Java with 49 raw request targets and a router-only control: the v2 SDKs charge for all of them, the deprecated v1 package on npm serves ten unpaid, and the Java filter serves eight.

14 min read →

Below 400 means paid: the x402 settle gate across six adapters

The x402 spec says funds move only after the resource "completes successfully". All nine server adapters read that as a status below 400, observed through framework-specific write paths and then rebuilt with the receipt. We ran seven handler shapes through Express, Hono, Fastify, FastAPI and Flask on the 2026-11-20 releases with a real EIP-3009 buyer. Express settles a 500 written with writeHead and sends a success receipt. Hono on Node's native Response settles a 204 or 304, then answers 402 with no receipt, and a buyer that retries pays every time. FastAPI drops a second Set-Cookie. Three open PRs fix exactly those cells. Redirects, 304s and errors inside a 200 settle everywhere by design, and a paid redirect loses its receipt in the stock fetch client.

16 min read →

Who owns this payTo? Auditing x402 payout proofs

Nothing in x402 ties payTo to the endpoint's operator. Issue #4320 proposes a signed _x402-payto TXT record. We probed 4,050 live sellers: 2 records exist, covering 11 hosts (10 verified, 1 mismatch), both signatures recover, neither domain has a working DNSSEC chain, and 37.8% of hosts sit on shared hosting where DNS proofs cannot count. In a harness with a compromised server, x402-trust-guard 0.4.0 stopped 2 of 6 payTo swaps and never ran on v1 challenges, because it reads the domain from resource.url. A 15-line guard bound to the agent's own call stopped all 6. Plus catalog-vs-live drift, per-request rotation, EIP-7702 payTo, and what it means for our gateway.

16 min read →

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

Weekly roundup, 13 to 20 November. We unpacked @x402/evm 2.31.0 and x402 2.28.0 and ran a signed EIP-3009 payment against the shipped TypeScript facilitator: "0x2710", " 10000 ", "+10000" and "010000" all verify as 10000, and "1_000" throws out of verify. Go rejects a different subset. The three canonical-amount PRs merged on 16 and 17 November, after the release. Also: eight chains where the new default asset is also the buyer's spend-control allowlist, and three different answers to a throwing afterVerify hook.

8 min read →

x402's Java SDK rejects the payload the spec tells clients to send

The x402 monorepo ships a Java module that is not in the reference SDK list, has no e2e coverage, and is not on Maven Central; the README tells you to build it locally. We ran it against its own tests and against real reference code. The servlet filter rejects the exact-scheme payload defined in scheme_exact_evm.md before it ever reaches the facilitator, because it looks for a resource key that v1 exact payloads do not carry. Its HTTP facilitator client posts paymentHeader, a field no other SDK and no public facilitator accepts, so the resource server and facilitator cannot agree on a body. Its SettlementResponse reads txHash/networkId/error while the spec names transaction/network/errorReason, so a spec-shaped receipt decodes to empty strings. Malformed headers return 500 with an unparseable body. Eight concurrent replays of one authorization produce eight handler executions and one settlement. The documented query-string price-table keying silently makes a route free. And the advertised 90% coverage gate fails at 71.875% branch coverage, which the README's badge does not mention.

15 min read →

x402's invalidReason: 89 codes, 17 shared, 8 in the spec

Section 9 of the x402 v2 spec tells clients to branch on invalidReason and never read message text. We fed 28 identical signed payments to the TypeScript, Go and Python exact-EVM facilitators at commit b0073878: only 9 produced the same string in all three, 10 named the same condition with different strings, and 9 named a different condition because the check order differs. A census of the error tables finds 89 distinct codes across the three SDKs, 17 present in all three, 37 in exactly one, and 81 absent from the spec; 8 of the spec's own 16 codes are never produced by any of them. Two gaps sit behind this: a 6-second validBefore floor every SDK enforces but the spec never states (measured boundary: rejected at now+5, accepted at now+6, zero clock skew), and a signature form USDC reverts on that all three SDKs accept, because the 65-byte EIP-2 rule covers s but not v. Python and Go also disagree on whether a garbage signature is terminal or retryable.

17 min read →

x402 response encryption: the buyer's key rides in the nonce

Issue #4223 (design draft, no maintainer reply) binds a per-request buyer key into the EIP-3009 nonce so only the payer can read a paid response. Their TypeScript suites (77 + 57 tests) and Python verifier pass, and our own Node-crypto implementation matched all 17 vector checks. A stock @x402/fetch 2.29.0 buyer signs once, settles nothing and gets a 402 that blames an invalid ephemeral key. The x402 client hard-codes its nonce, while auth-capture and batch-settlement already derive theirs from commitments, and the open upto proxy PR does too. A 688-token completion grows to 4,875 bytes sealed, 2.9x its gzipped size, and streaming is not covered. Plus what it means for our gateway and six steps.

16 min read →

x402's 402 doesn't say which version it speaks, or why

An x402 challenge carries no version signal and no machine-readable reason. Across 3,923 live 402s, 2,173 hosts keep two copies of their offer, 173 distinct error values greet first contact, and 962 hosts answer a malformed payment exactly as if nothing was sent. 1,464 return the TypeScript SDK's exception text. With a v2 header and a v1 body that disagree, the three v2 SDKs sign one price and x402-fetch 1.2.0 signs the other.

15 min read →