x402 · USDC on Base + Solana

x402-domains

Authoritative domain availability and expiry intel via RDAP — keyless, live, per lookup. No API key, no subscription: agents pay $0.001 per check, in USDC, on Base or Solana.

git clone https://github.com/nirholas/x402-domains && cd x402-domains && npm install && npm run dev
GitHub Tutorial API Reference For AI Agents

Pricing

RoutePriceWhat lands in the 200 body
GET /check/:domain$0.001Availability, registrar + IANA ID, created / updated / expiry dates, nameservers, EPP status flags, DNSSEC delegation — live from the TLD's authoritative RDAP server
POST /bulk$0.005The same record for up to 50 domains, plus registered / available / unknown counts
GET / · /health · /skill.md · /.well-known/x402 · /openapi.jsonfreeService card, health, agent skill file, discovery manifest, OpenAPI 3.1

How a paid call works

Agent GET /resource 402 Payment Required accepts: [ two rails ] USDC on Base EIP-3009 signature USDC on Solana signed SPL transfer the client picks X-PAYMENT facilitator: verify → settle 200 artifact
One round trip of overhead. Every 402 quotes both rails; the client signs whichever chain it holds USDC on.

Two rails, one price

USDC on Base
network base-sepolia / base
scheme exact · EIP-3009 transferWithAuthorization
payTo 0x40252CFDF8B20Ed757D61ff157719F33Ec332402
USDC on Solana
network solana / solana-devnet
scheme exact · SPL transferChecked, fee sponsored
payTo WwwuGbqHrwF5RG89KhUbmRWEvjnRH9k5kVM5p7T3WwW

Both rails appear in the accepts array of every 402. Settlement runs through the x402 facilitator, and the 200 carries an X-PAYMENT-RESPONSE receipt naming the rail and the transaction.

Quickstart

# 1. run it — the suite's default payTo addresses are already in .env.example
npm install && npm run dev            # http://localhost:4021

# 2. ask without paying → the dual-rail challenge
curl -s localhost:4021/check/example.com | jq '.accepts[] | {network, payTo, maxAmountRequired}'
# { "network": "base-sepolia", "payTo": "0x40252CF…2402", "maxAmountRequired": "1000" }
# { "network": "solana",       "payTo": "WwwuGbqH…T3WwW", "maxAmountRequired": "1000" }

# 3. pay and get the record (EVM rail via x402-fetch)
import { wrapFetchWithPayment } from "x402-fetch";
const pay = wrapFetchWithPayment(fetch, wallet);
const res = await pay("http://localhost:4021/check/example.com");
console.log(await res.json());
// { domain: "example.com", status: "registered", registrar: "…",
//   expiresAt: "2025-08-13T04:00:00Z", nameservers: [...], dnssecSigned: true }

Where the data comes from

RDAP (RFC 9082/9083) is the IANA-standard replacement for WHOIS. This service resolves the authoritative RDAP server for a TLD through the IANA bootstrap registry (cached for a day) and queries it live on every call. Nothing is scraped, nothing is cached between requests, and there is no fixture mode — the answer comes from the registry that issued the domain.

Why pay per lookup

An agent naming a startup checks forty candidates once and never comes back. A subscription and an API key are the wrong shape for that: they front-load cost, add signup, and make the agent a key custodian. x402 prices the question at $0.001 and settles it from a wallet the agent already has. Fifty checks in one POST /bulk cost half a cent.