| Internet-Draft | x402 DNS Discovery | August 2026 |
| Hawkins | Expires 5 February 2027 | [Page] |
x402 is an application-level protocol for internet-native payments built on the HTTP 402 (Payment Required) status code. This document defines how a domain publishes its x402 payment capability out-of-band, so that clients, autonomous agents, and indexers can discover it without prior configuration or a central directory. It specifies a JSON capability manifest served at the well-known URI "/.well-known/x402" and an optional DNS TXT record at the underscored node name "_x402" that points to the manifest. A consumer resolves a bare domain name to verified x402 capability with at most one DNS query and one HTTPS GET.¶
This note is to be removed before publishing as an RFC.¶
This document is a successor to the expired individual submission draft-jeftovic-x402-dns-discovery-00, whose author is credited in the Acknowledgments; an offer of co-authorship remains open. Discussion of this document takes place in the x402 Foundation community (https://github.com/x402-foundation/x402), where a corresponding extension specification is under review.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 2 February 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The x402 protocol [X402] makes payment terms self-describing at the moment a client encounters an HTTP 402 response: the response body enumerates acceptable payment schemes, networks, assets, and amounts. What x402 does not define is how a client that has never contacted a host learns that the host participates in x402 at all, in what role, and with what capabilities. In practice this gap has been filled by hand-curated lists and directory sites, which rot, do not scale, and centralize what is naturally edge-published data.¶
Electronic mail solved the same problem with DNS records (MX, SPF [RFC7208], DMARC [RFC7489]), and most directly with MTA-STS [RFC8461], in which an unauthenticated DNS TXT record points to an authenticated HTTPS policy document. This document applies that pattern to x402:¶
A consumer resolves a bare domain name to verified capability with at most one DNS query and one HTTPS GET (Section 5). Curated directories become optional caches, regenerable by crawling, rather than load-bearing infrastructure.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
A host participating in x402 SHOULD serve a JSON [RFC8259] manifest at:¶
https://<host>/.well-known/x402¶
The manifest MUST be served over HTTPS with media type "application/json". Cross-origin GET SHOULD be permitted; the manifest is public data. Hosts SHOULD serve the manifest with HTTP caching headers.¶
{
"x402Version": 2,
"kind": "facilitator",
"name": "Example Facilitator",
"description": "One-line human description.",
"facilitator": {
"baseUrl": "https://pay.example.com",
"endpoints": {
"supported": "/supported",
"verify": "/verify",
"settle": "/settle"
},
"kinds": [
{ "x402Version": 2, "scheme": "exact",
"network": "eip155:114" }
],
"assets": [
{
"network": "eip155:114",
"address": "0x1F930B6A9F68c91aB23db07a9c4A5Dc166eF8011",
"symbol": "EXUSD",
"decimals": 6,
"standard": "EIP-3009"
}
]
},
"resources": [
{
"url": "https://pay.example.com/demo/card",
"method": "POST",
"description": "x402-paywalled demo resource"
}
],
"attestation": { "type": "none" },
"docs": "https://pay.example.com/",
"contact": "ops@example.com",
"updated": "2026-08-04T00:00:00Z"
}
¶
Unknown fields MUST be ignored, for forward compatibility.¶
A domain MAY additionally publish a TXT record [RFC1035] at the underscored node name "_x402" [RFC8552]:¶
_x402.example.com. IN TXT ( "v=x402-1; " "wk=https://pay.example.com/.well-known/x402; " "k=facilitator; net=eip155:114; scheme=exact" )¶
The RDATA is a single character-string sequence interpreted as semicolon-separated key=value pairs, order-insensitive:¶
A domain MUST publish at most one record with "v=x402-1" at a given owner name. Consumers that find more than one MUST treat the name as unresolvable rather than choosing between them: "first record wins" is a race that anyone able to add a single TXT record can win by ordering -- a shared DNS control panel, a delegated subdomain, a partial compromise. SPF [RFC7208] and DMARC [RFC7489] both make duplicate records a hard error for precisely this reason.¶
The TXT record is a pointer, not an authority: all capability data comes from the manifest, which is retrieved over HTTPS. This split -- unauthenticated DNS pointer to authenticated HTTPS policy -- is the MTA-STS [RFC8461] pattern, and it keeps the mechanism useful even where DNSSEC [RFC4033] is absent.¶
Hosts without control of their DNS (for example, hosts on platform-assigned subdomains) simply publish the manifest alone; resolution step 2 below still finds them.¶
Given a domain name D, a consumer resolves x402 capability as follows:¶
Steps 1-2 answer "does this domain speak x402, and in what role" with at most one DNS query and one HTTP GET. Indexers crawl the same way and SHOULD periodically re-verify records.¶
Consumers MUST bound the manifest fetch with a request timeout and a maximum response size. An unbounded read is a denial of service handed to anyone who can publish a TXT record: a hostile host serves an arbitrarily large body, or trickles bytes indefinitely, and the crawler exhausts memory or hangs. Size limits MUST be applied to the bytes actually received, not to the Content-Length header, which is the server's claim rather than a measurement. (One deployed implementation uses a 256 KiB size cap, a 10-second deadline, and at most 3 redirect hops.)¶
Before every fetch this document invites -- the manifest, each redirect hop, resources[] probes, and the live "supported" cross-check -- a consumer MUST refuse a URL whose host is, or resolves to, a loopback, link-local, or private-range address. The HTTPS and in-domain rules do not cover this case: the publisher controls their own DNS, so an in-domain hostname can resolve to a link-local metadata address or an address inside the crawler's network, and DNS-based certificate issuance grants valid certificates to names that never point anywhere public. The check MUST be re-applied on every redirect hop; a public first hop redirecting to an internal name is the classic bypass. Resolution-time checks remain subject to DNS rebinding between check and connect; consumers needing a stronger guarantee SHOULD pin the resolved address for the connection. Deployments intentionally operating on private networks MAY relax this rule, explicitly.¶
Discovery is not endorsement. A manifest proves that a host claims a capability; it transfers no trust. Clients MUST validate settlement the way the x402 protocol already requires, and SHOULD apply their own reputation or allowlist policy on top of discovery.¶
DNS spoofing: the TXT record is unauthenticated without DNSSEC. That is why it may only point into the same domain, and why the manifest -- served under the domain's TLS certificate -- is the authority. An attacker who can forge the TXT record but not the domain's HTTPS gains nothing.¶
The same-origin constraint on "wk" prevents a domain from claiming another operator's facilitator as its own, and prevents the record from being used as an open redirect for crawler traffic. This holds only if consumers enforce it on every redirect hop and on facilitator.baseUrl, not on the requested URL alone.¶
Servers MUST NOT derive manifest URLs from request-controlled input. A manifest endpoint that builds its own baseUrl or resource URLs from the Host or X-Forwarded-Host request headers lets any caller make the document -- served under the operator's own TLS certificate -- advertise an attacker's host, and a cacheable response without a matching Vary header can then be replayed to other consumers. The public origin MUST be pinned in configuration. This is the same attack the "wk" rule addresses, arriving on the side this document calls authoritative, and it is easy to introduce precisely because deriving the origin from the request looks like good hygiene.¶
DNSSEC upgrades the TXT record from a hint to an assertion. Unsigned, the record is a convenience that the HTTPS manifest must backstop. Signed, a validating resolver can prove the record was not tampered with. Operators SHOULD sign zones carrying "_x402" records and SHOULD monitor RRSIG expiry: an expired signature fails validation exactly like a forged one, so the record -- and the discovery path -- disappears on a timer.¶
Manifest/live divergence: consumers MUST prefer live "supported" data over the manifest's mirror of it; indexers SHOULD flag divergent hosts.¶
Attestation claims in the manifest are claims like everything else: an execution-integrity attestation is only meaningful if the verifier URL lets the client independently check an attestation token chain against a published, reproducible build. Absent such verification, consumers treat the attestation as absent.¶
Crawler load: manifests are static JSON; hosts SHOULD serve them with cache headers and rate-limit them as any public endpoint.¶
IANA is requested to register the following entry in the "Well-Known URIs" registry defined by [RFC8615]:¶
This section is to be removed before publishing as an RFC.¶
This section records the status of known implementations per [RFC7942].¶
DNS-based and well-known-URI-based discovery for x402 has been proposed independently several times in the x402 community, most completely in [JEFTOVIC], which used the same "_x402" TXT label and substantially the same resolution approach. That document expired without revision in May 2026. This document is offered as a successor that consolidates those proposals and adds the manifest schema, duplicate-record rule, redirect and private-destination constraints, and IANA registrations. Co-authorship remains open to the authors of the prior proposals.¶
Mark E. Jeftovic proposed "_x402" TXT-record discovery for x402 first, in [JEFTOVIC] and in x402 community discussion; this document deliberately builds on that work, and the offer to fold this text into a revision of his draft -- or to add him as co-author here -- stands. The authors of the other independent discovery proposals in the x402 community (repository issues 1348, 2582, and 2831) reached similar designs and are acknowledged likewise. Reviewers on x402 Foundation pull request 2979 materially improved the security considerations, in particular the redirect re-validation and duplicate-record rules.¶