AgentBadge 在 DNS 發佈 x402 收款地址證明,並發現檢查器解析錯誤
We Published Our Own Payout Address in DNS - and the Check Caught a Bug Before the Rule Even Existed
AgentBadge 團隊為 agentbadge.xyz 發佈 x402 收款地址證明,並在自行驗證時發現檢查器把兩個 DoH 解析器回傳的 TXT 格式判作不同記錄。
This is part of the Arc campaign series. Previous episode: agents can
finally say "this is broken" - and every verdict comes back stamped
ADVISORY_HUMAN (EPIC-230 - feedback & review
core). This article is EPIC-258: payout proofs for x402.
The problem: the person quoting the address is the person who profits from it
For a junior: x402 is the protocol where an API answers 402 Payment - "pay this much crypto to this address, come back with a
Required
receipt, get your answer." Our scanner asks a site for its payment
quote and sees payTo: 0x....
Here is the uncomfortable part. Everything in that quote is
self-reported by the seller. A compromised endpoint - or a dishonest
one - can answer with any address. The agent signs, the crypto moves,
no chargeback. Checking the endpoint's reputation does not help: the
endpoint can be honest today and hijacked tomorrow.
The flip: prove it out-of-band, where the endpoint cannot reach
x402payto1 is a draft spec (under review in
x402-foundation/x402#4320,
authored by Ben McAlilly)
with a simple shape: the business - the domain owner - publishes a
signed list of its payout addresses in places the endpoint does not
control:
- a DNS TXT record at
_x402-payto.<domain>(v=x402payto1; a=0x...; d=2026-11-22; s=0xsignature), and/or - a JSON file at
/.well-known/x402-payto.json.
The check then runs outside the agent's payment path: do the
addresses the live 402 challenge quotes actually appear in the proof
set the domain published? The endpoint cannot fake a DNS record it
does not own, and it cannot edit a well-known file served from the
domain itself.
Dogfood first: we published our own before writing the rule
Our convention is dogfood-before-rule: we cannot ask anyone to run a
check we have not run on ourselves. So on 2026-11-22 we published a
proof for agentbadge.xyz - a signed TXT record plus the well-known
file - and ran the verification script against ourselves.
It caught a bug immediately - in our check, not our record.
Two public DNS-over-HTTPS resolvers format TXT answers differently:
dns.google returns the data field bare, cloudflare-dns returns it
wrapped in RFC-1035 quotes. A strict parser reads them as two different
records - and a "both resolvers must agree" safety check fails on a
perfectly honest proof. We found this on our own domain, before the
rule existed - the kind of bug that would have failed every
legitimate deployment and passed every crafted one.
We reported it. The spec now requires verifiers to normalize quoted
and bare DoH TXT data - credited. A second finding landed the same
way: the live accepts[] in a 402 challenge are authoritative; the
/.well-known/x402.json manifest is only a hint. Both are in the
draft now.
What the rule actually checks (three flavors of "no")
The shipped checkers (AB-188 for x402 quotes, AB-189 for MPP/L402
payment challenges) do not answer "verified or not." They answer one
of several very different things:
-
VERIFIED - every live-quoted payout address appears in the proof
set (
dns,dns_signed,sitelevels reported separately). - CONFLICT - the site quotes an address that is provenly absent from the set. This is the "endpoint is paying someone else" case.
- GAP - no proof published. Most of the web today; we attach a fix hint.
- NOT_APPLICABLE / unchecked - we could not verify (resolver failure, probe failed). Unchecked is not absent. A flaky DNS day is not evidence of anything.
That last distinction is the one that saves you from crying wolf.
Freshness: "a valid old proof" is not "a current proof"
The first reply we got after describing this on LinkedIn - from a
founder who had independently built the same shape - cut straight to
it: the check date matters, and it has to live outside the agent.
So every evidence row now carries observed_at (when we saw the
quote, per probe, with probe_id and observer labels), and the
report computes issued_age_days + a stale_issued flag when the
proof is older than 30 days - informational, never a downgrade. An old
proof still verifies; a stale one is just a stale one. And a proof
dated in the future gets flagged, not trusted.
Recheck: what happens when an address leaves the set
Then three different reviewers - independently, within two days - hit
the direction everyone misses: rotation. A business rotates a wallet
or drops an address; a standing allowlist keeps paying the old one
until a human edits it.
So we built the second half: diffPaytoReports, a pure function that
takes two scan reports and classifies every member of the proof set:
-
still_verified/still_absent- nothing moved; -
newly_proven/REAPPEARED- an address joined (or came back); -
DROPPED- an address that was proven is now gone - but only on confirmed absence (a live lookup, resolvers agreeing, not a cache hit); -
ROTATED- drop + add in one move, paired both ways; -
SCOPE_CHANGED- same payee, different provenance (child->parent record move is not "the same proof"); -
recheck_unchecked- the critical one: a SERVFAIL or resolver flap is never a revocation. Absence != revocation != loss-of-observability - three different events, three different responses. -
CONFLICT- signature that was valid went invalid.
A DROPPED transition renders as a medium alert:
0x23dd... was proven 2026-11-20, absent 2026-11-24 - possible rotation. The scanner itself stays stateless: history is an
or compromise
input (two snapshots), not hidden state.
Production evidence
-
Self-scan, live:
agentbadge scan https://agentbadge.xyz-> AB-188 VERIFIED (dns_signed) - both live accepts (eip155:5042 and eip155:5042002) match the DNS proof, signature valid,issued_age_days: 2,absence_confirmed: true. AB-189 VERIFIED on the MPP path; AB-190 VERIFIED (extension declared). -
Dogfood re-run:
VERIFIED (dns_signed)on both tiers, both public DoH resolvers agreeing, run-log appended as evidence. -
Negative matrix: 30+ e2e scenarios green - mismatch->CONFLICT,
malformed->GAP+hint, absent->GAP, resolver disagreement->unchecked,
double-probe divergence->possible_per_payment (not a mismatch),
SERVFAIL->
recheck_uncheckedneverdropped. - Adoption: the draft is live on ~3 domains (ours, settlewatch, madebydevx, api.teppi.xyz) and under foundation review.
-
Arc Studio audit: we ran an external adversarial review over
the whole proof surface before shipping this. Verdict: BLOCK -
2 Critical, 4 High, 14 Medium, every critical/high reproduced in a
scratch harness. The best catch: a well-known fetch timeout used
to silently mark a site-tier proof
DROPPED- a false revocation on a flaky day. All reproduced findings were fixed and re-tested (1342 scanner tests + 63 lib tests green); the evaluators you install today are@agentbadge/x402-payto-proof@0.2.2.
Try it
Your own domain is one TXT record plus one offline signature away:
publish v=x402payto1; a=<your payout address>; d=<today>; s=<sig>
at _x402-payto.<your-domain> and run
agentbadge scan https://<your-domain> - AB-188 tells you whether the
check would pass. The evaluator is open source as
@agentbadge/x402-payto-proof -
zero-IO, deterministic, you supply the clock.
The honest limit: this proves the published set, not the seller's
honesty. An address can be proven and the endpoint can still lie about
price. That is what the counterparty layer (https://agentbadge.xyz/blog/arc-c58-counterparty-trust) is for - evidence
at both ends, neither trusting the other's word.
來源:DEV Community · dev.to






