Who owns this payTo? Auditing x402 payout proofs
An x402 402 tells an agent where to send money, and nothing in the protocol ties that address to the domain the agent called. An open proposal fixes that with a signed DNS record. We measured how many of 4,050 live sellers publish one, verified the records, and ran the published client guard against a compromised server. The record holds up. The guard checks the domain the attacker names.
The proposal is issue #4320, "Payout-address proofs", opened on 2026-11-18 by benmcalillycreative. Its draft spec lives in the author's x402-trust-board repository. We read it at commit 68206f3, pushed 2026-11-22. The issue has six comments, all from the author and one other contributor. No maintainer has answered. A companion docs PR, #4318, adds the author's client guard to the third-party utilities table. It is one line and has no reviews.
We asked one question: if an attacker controls the HTTP response, does a payout proof stop an agent from paying the attacker?
payTo is just a string in a 402
The x402 v2 specification defines payTo as "Recipient wallet address or role constant". Its security section, section 10, has two parts: replay protection through EIP-3009 nonces, and integration with sign-in systems such as SIWE. Neither says anything about whether the address belongs to whoever runs the endpoint.
In the exact EVM scheme the address goes straight into the signed authorization. The buyer signs transferWithAuthorization with to set to payTo, and the facilitator settles what was signed. Anyone who can rewrite the 402 can rewrite to. That includes a compromised server, a hijacked deployment, a proxy, or a poisoned catalog listing. The draft's own framing is blunt: "clients pay a stranger, and the payment is final."
The Offer and Receipt extension looks like it covers this, but it binds something else. It lets a server sign its terms and publish the signing key in a _controllers TXT record or a did:web document. That proves the terms came from the domain's key. It also says "Production deployments SHOULD use a dedicated signing key separate from the payTo address". So a valid offer proves who signed it, not that the address inside it belongs to the domain. A server whose key is in use by an attacker can sign an offer naming the attacker's wallet. We covered that extension's signer-authorization gap in our receipts audit.
The proposal: one TXT record per address
The draft asks sellers to publish each payout address in DNS, signed by the payout wallet itself:
; one record per address; a parent record covers every subdomain
_x402-payto.example.com. TXT "v=x402payto1; a=0xAbC…; d=2026-11-04; s=0x…"
// the EIP-191 personal_sign message, "\n" separated, no trailing newline
x402 payout verification
Domain: example.com
Pay-to: 0xabc…
Issued: 2026-11-04
The signature is optional. The draft argues the binding comes from whoever controls the DNS, so an unsigned record still binds. A valid signature raises the level from dns to dns_signed. EOAs are checked with ecrecover. Smart-contract wallets use ERC-1271 on the payout network. Undeployed ERC-6492 wallets are out of scope for v1.
Four rules carry most of the weight. A record on example.com covers all its subdomains. Records on shared-hosting parents in the private section of the Public Suffix List, such as vercel.app or workers.dev, must be ignored. Sellers there fall back to /.well-known/x402-payto.json, which is weaker because a hijacked web server can rewrite it. And when a domain publishes any DNS proof, only DNS counts.
The check before paying has five outcomes: verified, mismatch, malformed, absent and unchecked. Only mismatch should stop a payment. Absence proves nothing, so it never blocks. The draft also describes a monitor that keeps history and holds a newly listed address for 72 hours, because a domain takeover looks like a wallet change at first.
This is a clean design. It needs no protocol change, no registry and no transaction. The open questions are adoption, and whether clients check the right domain.
Adoption, measured
We pulled the full CDP Bazaar catalog (39,624 resources) and the PayAI catalog (17,832) on 2026-11-22 between 09:02 and 09:10 UTC. For each host we sent one unpaid request to its most-called non-template resource, between 09:10 and 09:14 UTC. We signed and paid nothing. Of 4,543 hosts, 4,094 answered 402 and 4,050 quoted at least one payTo.
We then looked up _x402-payto TXT records for every host and each parent down to its registrable domain, using the Public Suffix List. That was 7,567 lookups, with 7 resolver errors. We also fetched /.well-known/x402-payto.json from every host without following redirects.
| Measure, 4,050 live hosts quoting a payTo | Result |
|---|---|
v=x402payto1 DNS records found | 2 (madebydevx.com, api.settlewatch.com) |
| Live hosts covered by a DNS record | 11 |
| Outcome for those 11 | 10 verified, 1 mismatch |
Hosts with no DNS proof (absent) | 4,039 |
| Hosts on a PSL private suffix (DNS proof impossible) | 1,530 (37.8%) |
| Draft-shaped well-known files | 9, all one operator, all unsigned |
_controllers records (3,234 registrable domains) | 1 |
Both DNS records carry signatures. We rebuilt the message and both recovered to the listed address with viem's recoverMessageAddress. Both also passed verifyMessage against Base. Both addresses are EOAs with no code. The madebydevx.com record was issued 2026-11-06 and the api.settlewatch.com record on 2026-11-19. Both authoritative servers serve them with a 300-second TTL. Neither domain has a DS record at its parent, so no validating resolver can authenticate either record. madebydevx.com does publish a DNSKEY, but without the DS the chain of trust never closes. The draft recommends DNSSEC-validating resolvers or DNS-over-HTTPS to a trusted resolver, which mitigates the path to the resolver but not an unsigned zone.
The well-known path is noisier than the counts suggest. 106 hosts answered 200 there. Nine returned a draft-shaped file: nine subdomains of grindfree.net, each listing the address its live 402 quotes, each marked unsigned. Six more returned JSON that mentions a payTo in other shapes. Four hosts of one operator serve their service manifest at any .well-known path; we confirmed it on one of them with a made-up filename. One serves a generic service manifest, and one uses its own format with no domain field. The other 91 returned something that is not a proof. A catch-all route that answers 200 everywhere is exactly why the draft ranks this file below DNS.
The author's own board agrees with us. Settle Watch's payouts.json, generated 2026-11-21 at 23:49 UTC across 1,132 hosts, lists 11 host entries with DNS proofs and 9 with site proofs. The issue counted 10 of 3,363 services with a signed proof on 2026-11-18, the day before the api.settlewatch.com record was issued. The draft credits madebydevx.com's record with covering its ten services. The numbers line up: one operator with ten subdomains, plus the board itself.
Shared hosting is the structural ceiling. 1,530 of the 4,050 live hosts sit under a PSL private suffix. The guard's built-in list of shared suffixes matches 1,506 live hosts. None of these sellers can publish a DNS proof that counts. In today's CDP catalog, one address collects payments for 295 hosts, 294 of them separate *.vercel.app deployments. If one operator runs them, it would need a well-known file on each one and could never reach the stronger level.
The one mismatch
agentgas.madebydevx.com quotes 0xD31Ba7B6…227E on Base. Its parent's record lists only 0xb3cd…f247. Under the draft's parent rule that is a mismatch. The CDP catalog showed the same address for that host on 2026-11-15 and 2026-11-22, our two snapshots that list it.
We ran x402-trust-guard against the real endpoint. The first request went to the live server. We intercepted the paid retry locally so it never left the machine. The guard returned avoid with dns_outcome: mismatch and produced no signature. Its sibling voice.madebydevx.com, which quotes the listed address, came back verified at the dns_signed level.
Either that subdomain is hijacked, or the operator runs a second wallet the record does not list. A pre-payment check cannot tell the two apart, and the draft says it should not try. It is still the lesson of the census: once a parent publishes a record, every wallet any subdomain quotes must be in it. The fix is a second TXT record.
Addresses move more than you would think
Any check that compares a quoted address against something remembered will meet legitimate change. We measured how much.
| Comparison | Compared | No address in common |
|---|---|---|
| Live 402 vs catalog listing, same resource, today | 4,050 hosts | 30 (147 more partly differ) |
| Catalog, 2026-11-15 vs 2026-11-22, per resource | 29,932 | 71 |
| Catalog, 2026-11-15 vs 2026-11-22, per host | 3,046 | 5 |
| Catalog, 2026-10-16 vs 2026-11-22, per resource | 11,239 | 395 |
| Catalog, 2026-10-16 vs 2026-11-22, per host | 1,811 | 34 |
| Live, two requests about 2 to 4 minutes apart | 4,044 hosts | 1 (3 changed) |
A catalog listing is a stale copy of the 402. On 30 live hosts it names an address the seller no longer quotes at all. A check that trusts the listing over the live 402 flags those sellers, and a poisoned listing could do the reverse.
Three hosts quoted a different EVM address on the second request: api.cardhedger.com, x402.browserbase.com and x402.tavily.com. Only the first switched to an entirely different set; the other two kept at least one address. That pattern may come from per-payment or rotating deposit addresses, which the draft names as an exception. A seller like that cannot list every address in advance, and a strict guard would block it on the first proof it published.
The addresses themselves vary too. Of 2,381 distinct live EVM payTo addresses, we read the code on Base for all but 10. 1,818 are plain EOAs. 452, 19%, are EOAs with an EIP-7702 delegation. 101 are contracts. A 7702 account still holds its key, so an EIP-191 proof still recovers. A contract needs an ERC-1271 call on the right chain. The reference guard has no chain access and reports contract signatures as unverifiable, which the draft allows. Our census measured code on Base only.
The guard checks the domain the server names
x402-trust-guard is the reference client. Version 0.4.0 was published on 2026-11-21 at 21:04 UTC, three days after 0.1.0. It registers one onBeforePaymentCreation hook on an x402Client. It reads the seller's DNS proof itself through Cloudflare DNS-over-HTTPS and asks the Settle Watch board for a verdict. The DNS check happens in index.js:
// x402-trust-guard 0.4.0, index.js
client.onBeforePaymentCreation(async ({ paymentRequired, selectedRequirements }) => {
const url = paymentRequired?.resource?.url;
if (!url || url.startsWith(o.api)) return; // never check the checker
const payTo = selectedRequirements?.payTo;
const target = parseTarget(url);
const live = o.dnsProofs && target ? await proofs.check(target.host, payTo) : null;
...
The domain comes from paymentRequired.resource.url. That field is part of the 402, the same message an attacker is assumed to control. The guard is not careless here. It has no better input. In @x402/core 2.32.0, published 2026-11-20, the hook context holds exactly two fields: paymentRequired and selectedRequirements. The URL the agent requested is not among them.
The transport does know it. wrapFetchWithPayment in @x402/fetch 2.32.0 computes response.url || request.url, but passes it only to x402HTTPClient.onPaymentRequired hooks. That is a different hook, built for extensions such as SIWX, and it runs before payment creation.
The harness
We used a real seller URL whose domain has a signed proof, https://voice.madebydevx.com/v1/tts. The guard made live DNS-over-HTTPS lookups and read the live board in free mode, so it paid nothing. We replaced the seller's transport with a local "compromised server". It answers 402 with an attacker's payTo and a chosen resource, then accepts any payment header and returns 200. The client used @x402/fetch, @x402/core and @x402/evm 2.32.0 with a throwaway key on Base. We counted the EIP-3009 authorizations it produced and the recipient each one named. Nothing reached a facilitator.
We ran four configurations. "Request-bound" is a variant that keys the same DNS check on the requestUrl that onPaymentRequired receives. "Call-bound" keys it on the URL the agent passed into the fetch call, carried through an AsyncLocalStorage. Both reuse the guard's own ProofCache, so the only difference is which domain gets checked.
| Server's 402 | No guard | x402-trust-guard 0.4.0 | Request-bound | Call-bound |
|---|---|---|---|---|
| Control: proven payTo | signs | signs (verified) | signs | signs |
| Swapped payTo, resource = requested URL | attacker | blocked | blocked | blocked |
Swapped, resource omitted | attacker | attacker (no check) | blocked | blocked |
| Swapped, resource.url = checker's API | attacker | attacker (no check) | blocked | blocked |
| Swapped, resource.url = domain with no proof | attacker | attacker (absent) | blocked | blocked |
| Swapped, resource.url not a URL | attacker | attacker (no check) | blocked | blocked |
| Swapped, 402 served after a redirect to a host with no proof | attacker | blocked | attacker | blocked |
"Attacker" means the client produced a valid authorization with to set to the attacker's address. The published guard stops two of six swaps. It stops the naive one, and the redirect, because there the server left resource.url pointing at the real seller. It misses four, and none of them is clever. Delete one field, or write any other domain into it.
A v1 challenge gets past it with no tampering at all. In v1, resource lives inside each accepts entry, not at the top level. With a v1 402 and a swapped address, the guard never produced a verdict and the client signed to the attacker. In our census, 107 of the 4,050 live challenges have no top-level resource, and 106 of those carry it per entry. For those sellers the guard does not run, attacker or not.
The redirect row matters for anyone writing their own guard. After a redirect, response.url is the final URL. That is what onPaymentRequired receives. But @x402/fetch sends the paid retry to the original request. In every row, the paid request went to voice.madebydevx.com. A guard keyed on requestUrl checks the redirect target's DNS while the money goes to the original server. Only the call-bound variant checks the domain that will actually receive the payment header.
Binding the check to the call
The call-bound guard is about fifteen lines on top of the reference ProofCache:
import { AsyncLocalStorage } from "node:async_hooks";
function withCallBoundProof(client) {
const proofs = new ProofCache({});
const als = new AsyncLocalStorage();
client.onBeforePaymentCreation(async ({ selectedRequirements }) => {
const host = als.getStore();
if (!host) return { abort: true, reason: "payment outside a guarded call" };
const live = await proofs.check(host, selectedRequirements.payTo);
if (live.outcome === "mismatch") return { abort: true, reason: `payTo not in ${host} proof` };
});
// wrap the paying fetch: the host comes from the agent's own argument
return (pay) => (input, init) =>
als.run(new URL(input instanceof Request ? input.url : input).hostname, () => pay(input, init));
}
It blocked all six swaps and let the control pay. We also ran 20 rounds of two concurrent payments on one client, one to the proven seller with a swapped address and one to a host with no proof. It signed none of the first and all of the second. The request-bound variant passed the same concurrency test. Its weakness is the redirect, not the race.
Ignoring resource.url costs honest sellers almost nothing. Of the 4,050 live challenges, 3,852 echo the exact URL we requested and 41 more echo the same host with a different path or query. Only 50 name a different host, and six of those point at 0.0.0.0 or localhost. Those 50 are proxies and custom domains. A guard keyed on resource.url checks the wrong domain for every one of them.
The clean fix is upstream. The x402 client could pass the original request URL into PaymentCreationContext. Then every onBeforePaymentCreation guard could bind to the call without wrapping fetch. It is one field, and it would also serve the price-expectation checks we covered in our spend-cap audit.
What the record does not prove
A payout proof answers "is this address the one this domain publishes?" It does not answer "is this the domain I meant to pay?" If an agent found the URL in a catalog, a poisoned listing can point to an attacker's domain that carries the attacker's own valid proof. The check then returns verified. The draft says this under "Lookalike domains": clients still need to call the domain they meant to call. For agents that discover sellers through Bazaar, that is the harder half. We saw how loosely listings track the live endpoint in our dynamic routes census.
DNS is only as strong as the zone and the resolver. Neither proof domain has a working DNSSEC chain today. A registrar takeover lets an attacker publish their own signed record. The draft's answer is continuity: a monitor that remembers earlier addresses holds a new one for 72 hours. A fresh client process has no such memory, so it depends on that monitor.
Finally, the record is opt-in, and absence must never block. With 11 of 4,050 hosts covered, almost every check today ends in absent. The protection reaches only sellers who publish. And only when the buyer runs a guard that checks the domain it called.
What it means for LLM4Agents
We are a seller in this picture. An agent that pays our gateway per request over x402 gets a 402 that quotes USDC on Base. Our 402 for POST https://api.llm4agents.com/v1/chat/completions quotes one payTo, 0x0D74…8C12, an EOA with no code. Its resource.url echoes the request URL exactly. llm4agents.com has no _x402-payto record, no _controllers record and no DNSSEC.
So today an agent has no way to tell our address from a swapped one, except by pinning it out of band. In our response-encryption audit we said we should publish a pinnable payTo. This draft is the most concrete way to do it. We are not on shared hosting, so we can reach the stronger DNS level. Our address was the same in every 402 we fetched, so a strict guard would not misfire on us.
The draft also clarifies a risk we carry as an operator. Anyone who can change our HTTP responses can redirect agent payments, and the protocol itself would not notice. A DNS record moves the point of failure off the request path and onto the DNS account, which is easier to lock down.
For agents that pay many sellers, including the ones that route through us, the harness result is the useful part. A guard that reads the domain from the 402 protects against careless attackers only. The binding has to come from the agent's own call.
Staying on the frontier
First, publish _x402-payto.llm4agents.com with our payout address, signed once with that wallet off the request path. One record on the apex covers api.llm4agents.com. If any subdomain ever quotes a different wallet, list it too. The agentgas case shows what happens otherwise.
Second, enable DNSSEC on llm4agents.com and keep the TTL at a few minutes. Write a rotation runbook from the draft's section 7: publish the new address, wait one TTL plus the 72-hour hold, switch payTo, then remove the old record.
Third, document a call-bound guard for agents paying us, along the lines of the snippet above. It should key the check on the URL the agent requested, never on resource.url, and pin our address as a fallback.
Fourth, take the findings upstream. On #4320, the census numbers and the shared-hosting ceiling. To x402-trust-guard, the four bypasses and the v1 gap. To the x402 core client, a request URL in PaymentCreationContext. All three are small changes.
Fifth, keep the census running. Re-measure record adoption, catalog-versus-live drift and per-request rotation each month. If records grow, a mismatch becomes a real signal, and our own monitoring should alert on it.
Sixth, if we adopt Offer and Receipt signing later, keep that signing key separate from the payout wallet, as that spec recommends. Publish it in _controllers. The two records bind different things, and a verifier can require both.
Pay per call. Know who you are paying.
LLM4Agents is an OpenAI-compatible gateway where autonomous agents pay per request in stablecoins over x402, and we audit the checks that decide where that money goes.
Register an agent