# x402 Payment Facilitator - Ultravioleta DAO - full agent context # # Generated by scripts/build_llms_full.sh. Do not edit by hand: edit the # sources below and re-run it. Sources, in order: static/llms.txt static/index.md static/skill.md static/auth.md --- # x402 Payment Facilitator — Ultravioleta DAO > The settlement service behind the Ultravioleta DAO stack. It verifies x402 payment > authorizations and submits them on-chain, so a buyer signs a stablecoin payment and > never pays gas. It is the facilitator OTHER services point at — it does not charge > for its own routes. Language (idioma): this file is English (`en`), and so are `/index.md`, `/skill.md` and `/auth.md`; none of the four has a Spanish translation. The Spanish version exists only for the human pages (`/`, `/x402`, `/dx402`, `/erc8004`, `/bazaar`, `/networks`, `/mcp`, `/integrar`, `/stats`, `/events/live`), at the same URL as the English, behind each page's EN/ES selector. There is no `/es/` path. ## When to use this, and when not to Reach for this facilitator when the job is **checking or landing someone else's x402 payment**: - A client answered your `402` with a signed payment authorization and you have to decide whether it is good — `POST /verify`. - You decided it is good and the transfer has to land on-chain without the payer holding native gas — `POST /settle`. - You are building a `402` challenge and need to know which networks, tokens and schemes can actually be settled today — `GET /supported`, then `POST /accepts` to narrow a resource server's offer to what is settleable. - You are an MCP client and want the same four calls as tools, plus a buyer's reads around a payment (network directory, chain health, on-chain escrow state, DX402 evidence) — `POST /mcp`. - You want to read or write an agent's ERC-8004 identity and reputation without paying gas — `/identity/...`, `/reputation/...`, `POST /feedback`. - You want to discover x402-priced resources other people published — `GET /discovery/resources`. Do **not** reach for it when: - **You need a wallet.** It holds no funds for you and signs nothing on your behalf. The payer signs; this service only checks that signature and submits it. If you are trying to *make* a payment, you need a wallet and the `uvd-x402-sdk`, with this host as the facilitator you point them at. - **You are looking for something to buy.** This is not a marketplace. The Bazaar at `/discovery/resources` is a catalog of x402-priced endpoints other people registered; it takes no part in the transaction. - **You expect to be charged, or to charge here.** `/verify` and `/settle` never answer `402`. There is no fee, no account and no API key. The money that moves is the buyer's stablecoin going to the seller; the gas is paid by this service's own wallets. - **You want custody, refund arbitration or dispute resolution.** The escrow scheme is a two-phase lock/release the counterparties drive themselves. No human here adjudicates anything. - **You need a ledger.** `/events`, `/transactions` and `/api/stats` are an index written after settlement resolves, and rows are dropped rather than allowed to block a payment. The chain is the ledger. How to call it: no authentication, JSON in and JSON out, per-IP rate limits reported on every limited response in `RateLimit-Policy` and `RateLimit` (and `x-ratelimit-remaining`), and listed up front in the stack manifest. Every error is `{"error", "code", "hint"}` — branch on `code`. Start at https://facilitator.ultravioletadao.xyz/skill.md, which is the full manual. ## What this service is x402 is HTTP 402 Payment Required, made real: a server answers `402` with a set of payment requirements, the client signs an authorization (EIP-3009 on EVM, the equivalent primitive on each other family), and a *facilitator* checks that signature and lands the transfer on-chain. This is that facilitator. Two calls are the whole contract: - `POST /verify` — is this authorization valid, right now, for these requirements? - `POST /settle` — submit it on-chain and return the transaction hash. Both are also reachable as MCP tools at `POST /mcp` — the same handlers, not a second implementation. Everything else on this host exists to make those two answerable without guessing: which networks and tokens are live, which schemes each network supports, what the facilitator just did, and what it costs (nothing — the seller keeps the payment). ## Coverage - **Network families:** EVM, SVM (Solana/Fogo), NEAR, Stellar, Sui, Algorand, XRPL and native Hedera. Query `/supported` for enabled networks. - **Arc:** `arc` / `eip155:5042`, `arc-testnet` / `eip155:5042002`; direct EOA USDC/EURC `exact`, v1/v2. EURC prices in euros (6 decimals, domain `EURC` / `2`); gas remains USDC. Live EURC acceptance: a funded 0.01 EURC x402 v2 payment was verified and settled on Arc mainnet on 2026-09-22 (tx 0xd9de3864e11698cf730664147ac383acb763279056ac091bab57cfd3bf536128); funded Arc testnet acceptance is still pending. USDC has 6 payment decimals and domain `USDC` / `2`. - **Hedera:** `hedera:mainnet`, `hedera:testnet`; native `CryptoTransfer`, `exact`, v2 only. USDC only: mainnet `0.0.456858` and testnet `0.0.429274` have 6. Read the network-specific `extra.feePayer`. Current sponsor IDs: mainnet `0.0.10868300`, testnet `0.0.10576385`. - **Assets:** USDC, USDT, EURC, AUSD, PYUSD, USDG, RLUSD, native XRP; each network publishes its own supported subset. Hedera HBAR is reserved for sponsor network fees. - **Schemes:** `exact`, `upto`, `escrow`, `commerce`; availability is per network. Arc and Hedera additions support `exact` only. - **Extensions:** read `/supported` and the network guide; global extension discovery does not enable escrow on Hedera/Arc, nor ERC-8004 on Hedera. ERC-8004 is served on both Arc networks. Native Hedera rejects durable-evidence and other unsupported extensions. ## Machine-readable resources - **Agent-facing overview** (markdown): https://facilitator.ultravioletadao.xyz/index.md - **Agent manual** (how to call verify/settle): https://facilitator.ultravioletadao.xyz/skill.md - **Authentication guide for agents**: https://facilitator.ultravioletadao.xyz/auth.md - **A2A agent card**: https://facilitator.ultravioletadao.xyz/.well-known/agent-card.json - **A2A agent card (legacy path)**: https://facilitator.ultravioletadao.xyz/.well-known/agent.json - **x402 discovery**: https://facilitator.ultravioletadao.xyz/.well-known/x402 - **API catalog (RFC 9727)**: https://facilitator.ultravioletadao.xyz/.well-known/api-catalog - **Stack interop manifest** (`uvd.stack/1`): https://facilitator.ultravioletadao.xyz/.well-known/uvd-stack.json — who this service is, its API and MCP doors, its liveness and readiness URLs, and every per-IP rate limit it enforces - **Agent skills index**: https://facilitator.ultravioletadao.xyz/.well-known/agent-skills/index.json - **Agentic Resource Discovery catalog (ARD v0.91)**: https://facilitator.ultravioletadao.xyz/.well-known/ard.json - **MCP server card**: https://facilitator.ultravioletadao.xyz/.well-known/mcp/server-card.json - **MCP guide** (Markdown): https://facilitator.ultravioletadao.xyz/mcp - **Network table** (HTML, built from `/supported` in the browser): https://facilitator.ultravioletadao.xyz/networks - **Integration guide** (HTML): https://facilitator.ultravioletadao.xyz/integrar — the two paths (selling, buying), the four traps that bite first, and an explicit statement that there is NO SLA and no support commitment - **DX402 guide** (HTML): https://facilitator.ultravioletadao.xyz/dx402 — durable evidence: the response sealed to the payer's own public key, and the rule that it can never fail a payment - **ERC-8004 guide** (HTML): https://facilitator.ultravioletadao.xyz/erc8004 — our implementation, the authorship problem on `POST /feedback`, the proof-of-payment gate, and why an owner lookup answers 503 and 404 for different things - **x402 guide** (HTML): https://facilitator.ultravioletadao.xyz/x402 — the two calls, escrow and upto as sections, and BOTH settlement counters with the caveat `/api/stats` ships alongside them - **Auth metadata (RFC 9728)**: https://facilitator.ultravioletadao.xyz/.well-known/oauth-protected-resource - **Workflow manifest**: https://facilitator.ultravioletadao.xyz/workflows.json - **OpenAPI 3.1**: https://facilitator.ultravioletadao.xyz/openapi.json - **Swagger UI**: https://facilitator.ultravioletadao.xyz/docs - **Everything above concatenated**: https://facilitator.ultravioletadao.xyz/llms-full.txt - **This file**: https://facilitator.ultravioletadao.xyz/llms.txt ## Live endpoints Base URL: `https://facilitator.ultravioletadao.xyz/` - `GET /health` — liveness. `{"status":"healthy"}` - `GET /version` — the release this instance is running - `GET /supported` — every (scheme, network) pair the facilitator will accept. Each network is listed twice: once by its v1 name (`base`) and once by its CAIP-2 identifier (`eip155:8453`). They are the same network. - `POST /verify` — validate a payment authorization without settling - `POST /settle` — settle a verified authorization on-chain - `POST /accepts` — negotiate payment requirements (Faremeter-compatible) - `POST /mcp` — MCP server (Streamable HTTP, stateless). The x402 calls `x402_supported`, `x402_accepts`, `x402_verify`, `x402_settle`, and four reads that move and sign nothing: `x402_networks` (`/networks.json`), `x402_chain_health` (`/health/ready`), `x402_escrow_onchain_state` (`POST /escrow/state`, a view call on the escrow contract) and `x402_durable_evidence` (`/dx402/evidence/{paymentId}` or its receipt). Each one is dispatched through the REST handler it names, so an MCP call and the HTTP call it stands for cannot answer differently. `POST /mcp` shares the per-IP budget of `/verify` and `/settle` — one bucket, not two. - `GET /mcp` — the MCP guide, for a reader: transports, the tool contract, the errors and the measured traps. HTML, or this same guide as Markdown with `Accept: text/markdown`. A caller whose `Accept` names `application/json` or `text/event-stream` still gets the JSON 405 naming POST, because there is no SSE stream to open on a stateless server. - `GET /events` — server-sent stream, one message per verify/settle - `GET /transactions` — recent recorded operations (JSON, `limit` capped at 200) - `GET /api/stats` — aggregated totals per network and asset - `GET /blacklist` — blocked payer addresses - `GET /discovery/resources` — the Bazaar catalog of x402-priced resources - `GET /dx402/evidence/{paymentId}` — DX402 durable evidence for a settled payment (pointer, `contentHash`, `verified`), with `/dx402/receipt/{paymentId}`, `/dx402/blob/{paymentId}` and https://facilitator.ultravioletadao.xyz/dx402/stats. Off unless the operator enables it: when `durable-evidence` is absent from the `extensions` of `/supported`, these paths answer the generic 404 - `GET /identity/{network}/{agentId}` and `GET /reputation/{network}/{agentId}` — ERC-8004 Trustless Agents, live on 14 mainnets and 25 networks in total `/events`, `/transactions` and `/api/stats` are an index, not a ledger. Rows are written after settlement resolves and are dropped rather than allowed to block a payment. The chain is the ledger. ## Cost Calling this facilitator is free. It takes no fee and it is not an x402-priced API: `/verify` and `/settle` never answer 402. The gas for settlement is paid by the facilitator's own wallets, which is the point of the service. The money that moves is the buyer's stablecoin payment going to the seller. ## Using it from code - `uvd-x402-sdk` — the house x402 SDK, on npm (https://www.npmjs.com/package/uvd-x402-sdk) and on PyPI (https://pypi.org/project/uvd-x402-sdk/). Point it at this facilitator URL. - `x402-axum` — Rust server middleware that prices a route and calls this facilitator. - `x402-reqwest` — Rust client that answers a 402 challenge automatically. ## Operator Ultravioleta DAO — https://ultravioletadao.xyz Source: https://github.com/UltravioletaDAO/x402-rs (fork of https://github.com/x402-rs/x402-rs) --- # Take payment for a single HTTP request — no account, no API key, no gas This is the x402 payment facilitator Ultravioleta DAO runs: your endpoint answers 402, the caller signs a stablecoin authorization, and we put it on chain and pay the network fee — 0% facilitator fee. This host is a **facilitator**, not a paid API. It charges nothing for its own routes; the money that moves is the buyer's payment going to the seller. - **Networks:** EVM, SVM, NEAR, Stellar, Sui, Algorand, XRPL and native Hedera. Availability is read from `/supported`. - **Stablecoins:** USDC, USDT, EURC, AUSD, PYUSD, USDG, RLUSD — plus native XRP on XRPL. Hedera accepts USDC only. `GET /supported` is the only list that is true today; this one is a snapshot. - **Schemes:** `exact`, `upto`, `escrow`, `commerce` - **Release:** `GET /version` - **Language (idioma):** this page is English (`en`) and has no Spanish translation. The HTML landing page at `/` and the other human pages carry English and Spanish at the same URL, switched by their EN/ES selector; there is no `/es/` path. ## API Base URL: `https://facilitator.ultravioletadao.xyz/` - `POST /verify` — validate a payment authorization without settling it - `POST /settle` — settle a verified authorization on-chain, returns the transaction hash or native Hedera transaction ID - `GET /supported` — every (scheme, network) pair accepted, with its supported protocol version and identifiers (Hedera is v2 only) - `POST /accepts` — negotiate payment requirements (Faremeter-compatible) - `POST /mcp` — MCP server (Streamable HTTP, stateless): `x402_supported`, `x402_accepts`, `x402_verify`, `x402_settle`, and the reads `x402_networks`, `x402_chain_health`, `x402_escrow_onchain_state`, `x402_durable_evidence`, over the same handlers - `GET /mcp` — the MCP guide for a reader (HTML, or Markdown with `Accept: text/markdown`) - `GET /health` — `{"status":"healthy"}` - `GET /version` — the running release - `GET /events` — SSE, one message per verify/settle - `GET /transactions`, `GET /api/stats` — recorded operations and aggregates - `GET /identity/{network}/{agentId}`, `GET /reputation/{network}/{agentId}` — ERC-8004 Full contract: `/openapi.json` (Swagger UI at `/docs`). ## Agent resources - Agent manual: `/skill.md` - Authentication guide: `/auth.md` - A2A agent card: `/.well-known/agent-card.json` (legacy path `/.well-known/agent.json`) - x402 discovery: `/.well-known/x402` - API catalog (RFC 9727): `/.well-known/api-catalog` - Stack interop manifest (`uvd.stack/1`: doors, health, every rate limit): `/.well-known/uvd-stack.json` - Agent skills index: `/.well-known/agent-skills/index.json` - MCP server card: `/.well-known/mcp/server-card.json` (endpoint: `POST /mcp`) - MCP guide: `/mcp` - Network table, built from `/supported`: `/networks` - x402 guide (verify, settle, escrow, upto, and both counters): `/x402` - Integration guide, including what is not promised: `/integrar` - DX402 durable evidence: `/dx402` - ERC-8004 identity and reputation, and the describe.net boundary: `/erc8004` - Auth metadata (RFC 9728): `/.well-known/oauth-protected-resource` - Workflow manifest: `/workflows.json` - LLM context: `/llms.txt`, `/llms-full.txt` ## Links - Website: https://facilitator.ultravioletadao.xyz/ - Source: https://github.com/UltravioletaDAO/x402-rs - Operator: Ultravioleta DAO — https://ultravioletadao.xyz/ ## Arc and native Hedera | Network | Payment identifier | Asset | Facilitator fee payer | | --- | --- | --- | --- | | Arc mainnet | `arc` / `eip155:5042` | USDC/EURC (6 decimals) | `0x103040545AC5031A11E8C03dd11324C7333a13C7` | | Arc testnet | `arc-testnet` / `eip155:5042002` | USDC/EURC (6 decimals) | `0x34033041a5944B8F10f8E4D8496Bfb84f1A293A8` | | Hedera mainnet | `hedera:mainnet` | USDC `0.0.456858` (6) | `0.0.10868300` | | Hedera testnet | `hedera:testnet` | USDC `0.0.429274` (6) | `0.0.10576385` | Discover availability and the current network-specific `extra.feePayer` from `/supported`. These are facilitator accounts, not merchant destinations. Set `payTo` to the seller's own account. Arc supports direct EOA `exact` payments in x402 v1/v2; its ERC-20 USDC address is `0x3600000000000000000000000000000000000000`, with EIP-712 domain `USDC` / `2`. Its 18-decimal gas view is the same balance; payment amounts use 6 decimals. Hedera supports native `CryptoTransfer`, `exact`, **x402 v2 only**. It uses numeric accounts and native token IDs, not EVM chain IDs 295/296. Buyer and recipient must be associated with USDC. The sponsor pays HBAR fees without contributing payment principal. HBAR is not accepted as payment; new HBAR offers are rejected. Neither addition enables escrow, `upto` or Gateway on that network; ERC-8004 is served on both Arc networks, not on Hedera. Native Hedera also rejects durable-evidence and other unsupported extensions. ## Portable facilitator receipts (EVM and Hedera) Exact payments on the networks `GET /receipts` lists return `receipt` alongside verify/settle: on an EVM network, in the ERC-3009 tokens `/supported` lists for its `exact` kind; on Hedera, native USDC. Discover `/supported.facilitatorReceipts`, `/receipts`, `/schemas/facilitator-receipt-v1.json` and `/.well-known/receipt-keys.json`. For private lookup, persist a purchase context and send `X-UVD-Purchase` (base64 JSON: purchaseId, secret accessToken, method, url, bodySha256). The merchant must validate it against the actual request. Query `/receipts/{receiptId}` with `Authorization: Bearer `. Never log the context or create a fresh signature after uncertainty. An unknown receipt means poll/replay the original authorization, not a new payment. Receipt confirmation does not prove delivery. The original answer is replayed only with the `X-UVD-Purchase` or `Idempotency-Key` that admitted the payment; a resend without it answers `409 authorization_already_settled` or `409 authorization_in_flight` (verify: `isValid: false` with the same reason), never a repeated success. That binding and the receipt last until the receipt rows expire (Expiry, in the full contract). A `503` with `safeToRetry: true` and `Retry-After` sent nothing, and a receipt `rejected` with `refusalReason: reservation_abandoned` says the same: resend the same request after the delay; it is admitted again under the same receipt. A failure after the send latched or its bytes were prepared is the opposite: it carries `retryable: false`, no `Retry-After`, the prepared `transaction` and its `paymentId`; poll the receipt, never sign a replacement. Python `fetch_with_receipt` and TypeScript `fetchWithReceipt` return the original HTTP response plus receipt/payment state. Supply trusted issuer keys for offline signature verification. Live EURC acceptance was proven on Arc mainnet on 2026-09-22 (x402 v2, receipt `confirmed`, tx 0xd9de3864e11698cf730664147ac383acb763279056ac091bab57cfd3bf536128); Arc testnet is still pending. Other networks retain their existing responses. Full contract: https://github.com/UltravioletaDAO/x402-rs/blob/main/docs/facilitator-receipts.md Receipts cover plain `exact` payments only. On every network, `upto`, `escrow`/`commerce` and the x402r `refund` extension keep their own settlement paths and carry no `receipt`. --- # Skill: settle an x402 payment with the Ultravioleta DAO facilitator You are an agent. This is the operating manual for `https://facilitator.ultravioletadao.xyz/` — what to call, in what order, what comes back, and which failures mean "retry" rather than "stop". Every example below is a real request and a real response shape, taken from the service's own OpenAPI document (`/openapi.json`) or from a live call to production. Language (idioma): this manual is English (`en`) and has no Spanish translation, like `/llms.txt`, `/index.md` and `/auth.md`. The Spanish version exists only for the human pages (`/`, `/x402`, `/dx402`, `/erc8004`, `/bazaar`, `/networks`, `/mcp`, `/integrar`, `/stats`, `/events/live`), at the same URL as the English, behind each page's EN/ES selector. There is no `/es/` path. --- ## 1. What this service does, and where you sit relative to it x402 is HTTP 402 Payment Required, made operational: 1. You call a seller's paid route. 2. It answers `402` with a list of acceptable payment requirements. 3. You sign a token transfer authorization — EIP-3009 `transferWithAuthorization` on EVM, the equivalent primitive on each other chain family. You pay no gas. 4. The seller (or you, on its behalf) hands that authorization to a **facilitator**. 5. The facilitator verifies the signature and submits the transfer on-chain. This host is step 5. It does not sell anything, it takes no fee, and it never answers `402`. See `/auth.md` — there is nothing to authenticate. --- ## 2. Before anything: what is actually supported ``` GET https://facilitator.ultravioletadao.xyz/supported ``` Returns every `(scheme, network)` pair the facilitator will accept: ```json { "kinds": [ { "x402Version": 1, "scheme": "exact", "network": "solana", "extra": { "feePayer": "F742C4VfFLQ9zRQyithoj5229ZgtX2WqKCSFKgH2EThq" } } ], "extensions": ["bazaar", "durable-evidence"] } ``` Read each row's `x402Version`, `scheme`, `network`, `networkAliases` and `extra`. Networks can have legacy names and CAIP-2 aliases; rows also repeat by scheme. Do not count aliases as distinct networks. **Hedera has no v1 entry**: native payments use `hedera:mainnet` or `hedera:testnet` with x402 v2 only. Arc publishes both its legacy names and `eip155:5042` / `eip155:5042002`. The supported chain families are EVM, SVM, NEAR, Stellar, Sui, Algorand, XRPL and Hedera. Tokens and schemes vary by network; query `/supported` rather than assuming a global scheme or extension applies to each network. --- ## Arc and native Hedera | Network | Payment identifier | Asset | Facilitator fee payer | | --- | --- | --- | --- | | Arc mainnet | `arc` / `eip155:5042` | USDC/EURC (6 decimals) | `0x103040545AC5031A11E8C03dd11324C7333a13C7` | | Arc testnet | `arc-testnet` / `eip155:5042002` | USDC/EURC (6 decimals) | `0x34033041a5944B8F10f8E4D8496Bfb84f1A293A8` | | Hedera mainnet | `hedera:mainnet` | USDC `0.0.456858` (6) | `0.0.10868300` | | Hedera testnet | `hedera:testnet` | USDC `0.0.429274` (6) | `0.0.10576385` | Discover availability and the current network-specific `extra.feePayer` from `/supported`. These are facilitator accounts, not merchant destinations. Set `payTo` to the seller's own account. Arc supports direct EOA `exact` payments in x402 v1/v2; its ERC-20 USDC address is `0x3600000000000000000000000000000000000000`, with EIP-712 domain `USDC` / `2`. Its 18-decimal gas view is the same balance; payment amounts use 6 decimals. Hedera supports native `CryptoTransfer`, `exact`, **x402 v2 only**. It uses numeric accounts and native token IDs, not EVM chain IDs 295/296. Buyer and recipient must be associated with USDC. The sponsor pays HBAR fees without contributing payment principal. HBAR is not accepted as payment; new HBAR offers are rejected. Neither addition enables escrow, `upto` or Gateway on that network; ERC-8004 is served on both Arc networks, not on Hedera. Native Hedera also rejects durable-evidence and other unsupported extensions. **Native Hedera v2 request:** ```json { "x402Version": 2, "paymentPayload": { "x402Version": 2, "resource": { "url": "https://example.com/protected", "description": "One API call", "mimeType": "application/json" }, "accepted": { "scheme": "exact", "network": "hedera:testnet", "asset": "0.0.429274", "amount": "1000", "payTo": "0.0.10576387", "maxTimeoutSeconds": 180, "extra": { "feePayer": "0.0.10576385" } }, "payload": { "transaction": "BASE64_BUYER_SIGNED_TRANSACTION_LIST" } }, "paymentRequirements": { "scheme": "exact", "network": "hedera:testnet", "asset": "0.0.429274", "amount": "1000", "payTo": "0.0.10576387", "maxTimeoutSeconds": 180, "extra": { "feePayer": "0.0.10576385" } } } ``` The base64 value is a placeholder for the buyer-signed protobuf TransactionList; build it with the Hedera client. The inner `accepted` and outer `paymentRequirements` must match exactly. The generic EVM convenience rule about omitting inner `accepted` does not apply to native Hedera. Unknown requirements, extra fields and unsupported extensions are rejected. The buyer signs every frozen node variant; the facilitator adds its signature only after inspection. Retry the same payload and transaction ID after uncertainty. A successful settlement returns a native ID such as `0.0.10576385@1789609553.483480778`; it is not an EVM hash. --- ## 3. `POST /verify` — is this authorization good? Validates a payment authorization without touching the chain. No gas, no state change. ```http POST /verify Content-Type: application/json ``` ```json { "x402Version": 1, "paymentPayload": { "x402Version": 1, "scheme": "exact", "network": "base", "payload": { "signature": "0x111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222221b", "authorization": { "from": "0x0000000000000000000000000000000000000001", "to": "0x0000000000000000000000000000000000000002", "value": "1000000", "validAfter": "1700000000", "validBefore": "1700100000", "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001" } } }, "paymentRequirements": { "scheme": "exact", "network": "base", "maxAmountRequired": "1000000", "resource": "https://example.com/protected", "description": "One API call", "mimeType": "application/json", "payTo": "0x0000000000000000000000000000000000000002", "maxTimeoutSeconds": 60, "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" } } ``` **That body is runnable, not a sketch.** The signature and the nonce are well-formed placeholders -- `r` all `0x11`, `s` all `0x22`, a one-valued nonce -- not a real authorization, so copied verbatim it answers HTTP 200 with `"isValid": false`. Swap in your signed values and it answers on the merits. Curl it before you write any code: ```bash curl -sS -X POST https://facilitator.ultravioletadao.xyz/verify \ -H 'Content-Type: application/json' -d @body.json ``` Five things in that shape are load-bearing, and each one has produced a `400`: - `paymentPayload` carries its OWN `x402Version`, `scheme` and `network` at its root. They are not inherited from the envelope. - The signed data sits under `payload.authorization`, not directly under `payload`. - The amount field inside the authorization is `value`. `amount` is the name in the *requirements* (`maxAmountRequired`), not in the authorization. - `validAfter` and `validBefore` are **strings**, not numbers. `1700000000` is rejected; `"1700000000"` is accepted. So are `value` and `maxAmountRequired`. - `paymentRequirements` needs `resource`, `description`, `mimeType` and `maxTimeoutSeconds`. They have no defaults; omit one and the whole body fails to parse. `network` may be written either way, in both objects: `"base"` or `"eip155:8453"`. That is what lets an offer taken straight out of `/discovery/resources` -- which is CAIP-2 -- be paid without rewriting it. Mixing the two spellings inside one body is also accepted, though matching the offer is the sane thing to do. ### The same payment in the x402 v2 shape If your body says `"x402Version": 2`, the envelope is a **different shape**, not the one above with a `2` in it. There is no `paymentRequirements` in v2. The requirements split in two: `resource` carries what is being sold, `accepted` carries what is being charged. ```json { "x402Version": 2, "paymentPayload": { "x402Version": 2, "payload": { "signature": "0x111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222221b", "authorization": { "from": "0x0000000000000000000000000000000000000001", "to": "0x0000000000000000000000000000000000000002", "value": "1000000", "validAfter": "1700000000", "validBefore": "1700100000", "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001" } } }, "resource": { "url": "https://example.com/protected", "description": "One API call", "mimeType": "application/json" }, "accepted": { "scheme": "exact", "network": "eip155:8453", "amount": "1000000", "payTo": "0x0000000000000000000000000000000000000002", "maxTimeoutSeconds": 60, "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" } } ``` That is the **same payment** as the v1 body above — same signature, same chain, same amount, same recipient — written the other way. The facilitator reduces both to one internal request, and a test asserts that they land on the identical one. What moved, field by field: | v1 | v2 | |---|---| | `paymentRequirements` | `accepted` + `resource`, both at the top level | | `paymentRequirements.maxAmountRequired` | `accepted.amount` | | `paymentRequirements.resource` (a URL string) | `resource.url` | | `paymentRequirements.description` / `.mimeType` | `resource.description` / `resource.mimeType` | | `paymentPayload.scheme` / `.network` | `accepted.scheme` / `accepted.network` | `accepted` takes exactly `scheme`, `network`, `asset`, `amount`, `payTo`, `maxTimeoutSeconds` and an optional `extra`. Extra keys are ignored rather than rejected, so a `402` offer that also carries `maxAmountRequired`, `resource`, `description` or `mimeType` can be passed through unedited. `resource` needs all three of `url`, `description` and `mimeType`. **`accepted.network` is CAIP-2 only.** This is the one place the two spellings are *not* interchangeable: the v1 `paymentRequirements.network` and `paymentPayload.network` take `"base"` or `"eip155:8453"`, but `accepted.network` takes `"eip155:8453"` and refuses `"base"`. Measured — a v2 body with `"base"` there answers `400 data did not match any variant of untagged enum VerifyRequestEnvelope`. An offer copied out of a `402` or out of `/discovery/resources` is already CAIP-2, so this only bites if you rewrote it. **On the duplication you may have seen.** Older facilitator builds *also* required `resource` and `accepted` to be repeated **inside** `paymentPayload`, and refused the body above with `400 data did not match any variant of untagged enum VerifyRequestEnvelope`. That is fixed: the inner copy is optional. If you already send it, keep sending it — the duplicated envelope is still accepted, byte for byte, and reduces to exactly the same payment. If you do not, the facilitator fills the inner pair in from the outer one. ```json { "paymentPayload": { "x402Version": 2, "resource": { "...": "same object" }, "accepted": { "...": "same object" }, "payload": { "...": "as above" } }, "resource": { "...": "" }, "accepted": { "...": "" }, "x402Version": 2 } ``` `/settle` takes the v2 envelope on the same terms as `/verify`; the two endpoints share one parser. What the facilitator checks: payload structure, the EIP-712 signature, nonce validity, the amount against `maxAmountRequired`, the `validAfter`/`validBefore` window, and that the token and network are supported. **A rejected payment is still HTTP 200.** The verdict lives in the body: ```json { "isValid": false, "invalidReason": "invalid_signature", "payer": "0x0000000000000000000000000000000000000001" } ``` A valid one answers `{"isValid": true}`. Branch on `isValid`, not on the status code. `invalidReason` is a snake_case token naming the cause, and each cause has its own: | Token | What to change | |---|---| | `invalid_signature` | The EIP-712 signature does not recover to `authorization.from` | | `invalid_timing` | Now is outside the `validAfter` / `validBefore` window | | `insufficient_funds` | The payer's on-chain balance is below the amount | | `insufficient_value` | The signed `value` is below `maxAmountRequired` | | `receiver_mismatch` | `authorization.to` is not the requirements' `payTo` | | `invalid_network` | The network is unsupported, or the two halves disagree | | `invalid_scheme` | The payload's `scheme` is not the requirements' `scheme` | | `unexpected_settle_error` | Settlement failed for a reason none of the above covers | Treat the list as open: a token you do not recognise still means "rejected", so switch on it but keep a default arm. Before 2.13.0 this field was always `null` — if you see `null`, you are talking to an older facilitator and the cause is not recoverable from the response. A `400` means the *request* was malformed — you sent something the facilitator could not read — which is a different bug from a payment that does not check out. --- ## 4. `POST /settle` — put it on-chain Same request body as `/verify`. The facilitator re-verifies, then calls `transferWithAuthorization` on the token contract and returns the transaction hash. Success: ```json { "success": true, "transaction": "0x...", "transactionHash": "0x...", "paymentId": "0x...", "network": "base", "payer": "0x..." } ``` The hash is emitted under three names — `transaction`, `transactionHash` and `transaction_hash` — because clients in the wild read all three. They are one value. `paymentId` is this payment's canonical identifier: `keccak256(caip2 ‖ txHash)`, so it is reproducible by anyone holding the network and the hash. It is the key DX402 evidence is stored under, so it is what you pass to `/dx402/evidence/{paymentId}` and `/dx402/receipt/{paymentId}`. Failure: ```json { "success": false, "errorReason": "insufficient_funds", "payer": "0x...", "network": "base" } ``` `errorReason` uses the same token vocabulary as `invalidReason` above. **A timeout is not a failure.** If the connection drops after you sent `/settle`, the transaction may still land. Do not re-sign and re-send blindly: re-check on-chain, or look for the operation on `/events` or `/transactions`, before deciding it did not happen. **When the facilitator itself times out waiting, it hands you the hash.** As of 2.14.0, a transaction we broadcast and never saw confirmed answers `502` with: ```json { "error": "settlement_unconfirmed", "transaction": "0x...", "paymentId": "0x...", "retryable": false } ``` This is *not* `success: false` — it is not a verdict at all. The transaction may be mined. `retryable` is `false` and means it: retrying re-signs a **fresh** authorization for the same purchase, which is a new, perfectly valid payment the token's own nonce check cannot stop, so a retry here is how you pay twice. The hash is there to be **looked up**, and `paymentId` is the same identifier a successful `/settle` prints, so once you find the transaction confirmed you can tie the two together (and reach `/dx402/evidence/{paymentId}`). Before 2.14.0 this branch answered `contract_call_failed (ref: )` with no hash at all. Since 2.39.6 the same answer also covers a send whose own answer was lost (a timeout, a dropped connection, a gateway error) and a node that says it already holds the transaction, on every network family, each hash in its own chain's encoding. NEAR, Stellar, Algorand, Sui and XRPL used to report that case as `200` with `success: false` and no transaction. **The rule behind it: `retryable: false` means "do not sign again".** Every `/settle` failure produced after the transaction may have left carries `"retryable": false` and no `Retry-After`, plus `transaction` and `paymentId` when the facilitator knows them: `settlement_unconfirmed`, `broadcast_uncertain`, `receipt_pending`, the `upto` / `escrow` / `refund` schemes' `502`, a settle forwarded to the signing task whose answer was lost (`reason: forward_unconfirmed`), and the receipt rail's failures after its send latched. Look the transaction up and deliver if it settled; only one not found after the chain's finality window is gone. A failure with neither `retryable: false` nor a `transaction` was produced before anything was sent. **Send an `Idempotency-Key` and the retry is safe.** Choose one opaque string per intended purchase, keep it across retries and restarts, and send it as a header: ``` Idempotency-Key: 26dece19-37e0-431c-95d4-10b4e44fef98 ``` - **Same key, same body** → the first response is replayed, carrying `Idempotent-Replayed: true`. No second transaction. Read that header rather than comparing bodies: after a restart you no longer hold the first one. - **Same key, different body** → `409 idempotency_key_conflict`. This is the one that catches the dangerous mistake: re-signing an authorization with a fresh nonce and reusing the key means you are trying to pay twice for one purchase, and it is refused instead of settled. - **Store unreachable** → `503 idempotency_store_unavailable`. It fails closed: no settlement happens that we could not have deduplicated. Without a key there is nothing to deduplicate against, and a retry is simply a second settle attempt. On EVM the token's own `authorizationState` still rejects a replay of the *same* nonce, but nothing stops a *newly signed* one. ### The other schemes, on the same endpoint - **`upto`** — you sign a Permit2 authorization for a *maximum*; the seller settles the amount actually used, which must be at most that maximum. If the actual amount is zero, no transaction is submitted at all. Only advertised where the Permit2 proxy is deployed; check `/supported`. - **`escrow` / `commerce`** — two names for the same x402r two-phase flow. The `action` field drives it: `authorize` (default, locks funds, needs the ERC-3009 signature), `release` (sends the locked funds to the receiver, no signature), `refundInEscrow` (returns them to the payer, no signature). Query the current state with `POST /escrow/state`. --- ## 5. `POST /accepts` — build the 402 challenge If you are the *seller*, this fills in the payment requirements you are about to hand a buyer, enriching them with the facilitator's fee payer, token list and escrow data. Faremeter middleware calls it for you. Request: ```json { "x402Version": 1, "accepts": [{ "scheme": "exact", "network": "base", "maxAmountRequired": "10000", "resource": "https://example.com/x", "description": "demo", "mimeType": "application/json", "payTo": "0x0000000000000000000000000000000000000002", "maxTimeoutSeconds": 60, "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }] } ``` Response (live, trimmed): ```json { "x402Version": 1, "accepts": [{ "scheme": "exact", "network": "base", "maxAmountRequired": "10000", "payTo": "0x0000000000000000000000000000000000000002", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "extra": { "tokens": [ { "token": "usdc", "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "decimals": 6 }, { "token": "eurc", "address": "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42", "decimals": 6 } ] } }], "rejected": [], "error": "" } ``` ### What it could not serve, and why `rejected` is always there -- empty when everything matched. It used to not exist, and a requirement the facilitator could not serve was dropped in silence: an unknown chain, a scheme we do not run there, and a body we could not read all came back as the same `{"accepts": [], "error": ""}` with `HTTP 200`. There was nothing to branch on. ```json { "x402Version": 1, "accepts": [], "rejected": [{ "index": 0, "scheme": "exact", "network": "cosmos:hub-4", "reason": "network_unknown", "detail": "`cosmos:hub-4` names no chain this facilitator knows..." }], "error": "" } ``` `reason` is a closed set -- switch on it. `detail` is prose and may change. | `reason` | What it means | Your move | |---|---|---| | `malformed` | `scheme` or `network` missing or not a string | Fix the requirement | | `network_unknown` | That string names no chain, in either spelling | Read `/supported` | | `scheme_unknown` | Not a scheme this facilitator implements | Read `/supported` | | `network_unsupported` | A chain it knows but this deployment does not serve | Offer another chain | | `scheme_unsupported_on_network` | Both known, but not that pair | `detail` names what IS served there | **A negotiation where nothing matched is still `HTTP 200`** -- the request was well formed, the answer is just empty. Branch on `accepts.length` and on `rejected`, never on the status code. Omitting the `accepts` array is a `400` with `{"error": "Missing or invalid 'accepts' array"}`. --- ## 6. The trap that costs the most time: EIP-712 domain names The same stablecoin uses **different EIP-712 domain names on different chains**, and a wrong domain produces a signature that verifies against nothing. | Token | Usual name | Exceptions | |---|---|---| | USDC | `"USD Coin"` — including Base **mainnet** | `"USDC"` on Celo, HyperEVM, Unichain, Monad and most `-sepolia`/`-testnet` variants (Base Sepolia is `"USDC"`) | | EURC | `"Euro Coin"` (Ethereum, Avalanche) | `"EURC"` on Base and Arc | The name can **flip between a chain's mainnet and its testnet** (Base mainnet is `"USD Coin"`, Base Sepolia is `"USDC"`), and bridged variants differ again (`"Bridged USDC(XDC)"`, `"Bridged USDC (SKALE Bridge)"`). Never infer it. The facilitator resolves the domain in this order: 1. Its own static table of known deployments — **this wins**, and if you send a different value it is logged as a warning and ignored. 2. `paymentRequirements.extra.name` / `.version` — used only for tokens *not* in that table. 3. An on-chain `token.name()` / `token.version()` call, as a last resort. So: for a token the facilitator already knows (USDC, EURC, AUSD…), you do not need to send `extra` at all. For anything else, you **must**: ```json { "paymentRequirements": { "asset": "0x...", "extra": { "name": "EURC", "version": "2" } } } ``` Second trap, cheaper but just as common: **`validAfter` and `validBefore` are Unix seconds, not milliseconds.** --- ## 7. Watching what happened - `GET /events` — server-sent events, one message per verify/settle. Returns `503` with `Retry-After` when the subscriber cap is reached. - `GET /transactions` — recent recorded operations. `limit` is capped at 200. - `GET /api/stats` — aggregated totals per network and asset. - `GET /api/stats/history` — settlement history reconstructed from the chain. This is a *different claim* from `/api/stats`, which is what the facilitator measured; every row carries a `source`. **None of these is a ledger — the chain is.** Rows are written fire-and-forget after settlement resolves, so an unreachable store loses rows and never blocks a payment. Quote a number from here only with that caveat attached. And while failure publishing is off (the default), a 100% success rate means "no failures were recorded", not "no failures occurred". --- ## 8. Reputation and identity (ERC-8004) Live on 14 mainnets, 25 networks in total. See `/auth.md` for the authorship rules — they are the part integrators get wrong. - `GET /identity/{network}/{agentId}` · `GET /identity/{network}/owner/{address}` - `GET /reputation/{network}/{agentId}` - `POST /register` (spends gas; send `Prefer: respond-async` for a `202` + `jobId`, then poll `GET /register/status/{jobId}`) - `POST /feedback`, and the prepare/submit pairs that record *you* as the rater Two behaviours that surprise people: feedback without a `score` is recorded but never scored (`had_impact=false`, and it is not retroactive), and the Solana program forbids self-feedback. --- ## 9. Error handling, in one table | You see | It means | Do | |---|---|---| | `200` + `isValid: false` | the payment does not check out | fix the payload; do not retry as-is | | `200` + `success: false` + `errorReason` | settlement was attempted and refused | read `errorReason`; most are terminal | | `400` | your request body was malformed | fix the request, not the payment | | `404` on an admin route | the operator configured no token; the route is closed | treat as absent | | `404` from `/identity/.../owner/...` | that address owns no agent | a real negative answer | | `503` + `"retryable": true` | the lookup reached **no verdict** | retry; never persist this as "not registered" | | `503` on `/events` | subscriber cap reached | honour `Retry-After` | | `503` + `"code": "overloaded"` | the task is at its ceiling of concurrent requests, for every caller; nothing was done | honour `Retry-After` (1 s) and resend the same request | | `429` + `"code": "too_many_concurrent_requests"` | your address already has its maximum of requests in flight; nothing was done | wait for a response, then resend the same request | | `408` + `"code": "request_timeout"` | the whole body did not arrive within the deadline after the headers; nothing was done | send the body with the headers and resend | | `429` | per-IP rate limit (about 30 req/min on verify/settle) | back off; do not re-sign | | `502` + `"error": "settlement_unconfirmed"` | we sent the tx, or may have, and never got a verdict | look up the `transaction` on chain; **never** retry (`retryable: false`) | | any `5xx` + `"retryable": false` | the tx may already be on chain (`broadcast_uncertain`, `receipt_pending`, `forward_unconfirmed`, the alternative schemes, the receipt rail) | **never** sign again; look up `transaction` if present, else the payer's transfer | | `502` + `"error": "upstream_rpc_unavailable"` | the node could not answer | honour `Retry-After`; the two `502`s are different — branch on `error` | | timeout on `/settle` | unknown — the tx may have landed | check the chain before retrying | Every refusal is JSON. A `4xx` or `5xx` carries `{"error": ..., "code": ..., "hint": ...}` with `content-type: application/json` — including the ones the framework used to answer with an empty body: a `405` for the wrong method (the `Allow` header lists what the path accepts), a `404` for a path nothing serves, and the `429` from the rate limiter itself. Branch on `code`, not on the prose in `error`. On `invalid_request_body` the `hint` is written for the version **your body declares**, so read it: a body saying `"x402Version": 2` is told about `resource` and `accepted`, a body saying `1` about `paymentRequirements`, and a body too broken to say gets both shapes rather than a guess. It used to name the v1 fields to everyone, which is how a correct v2 integration was talked into sending v1. ### Rate limits, and how to stay under them Limits are per client IP, and they are reported on every response rather than only on the refusal: | Header | On | Meaning | |---|---|---| | `RateLimit-Policy` | every rate-limited response, `200` included | the bucket this route draws on: `"verify-settle";q=30;w=60` is 30 requests in any 60 seconds | | `RateLimit` | every rate-limited response, `200` included | what is left: `"verify-settle";r=29;t=2` is 29 more within the next 2 seconds | | `x-ratelimit-limit` | every rate-limited response, `200` included | the burst size of the bucket this route draws on | | `x-ratelimit-remaining` | every rate-limited response, `200` included | tokens left in that bucket right now | | `retry-after` | `429` | seconds to wait before retrying | | `x-ratelimit-after` | `429` | the same number, under tower_governor's own name | Read `RateLimit` (or `x-ratelimit-remaining`) and slow down before it reaches zero; that is the whole reason it is on the `200`. `RateLimit-Policy` and `RateLimit` follow the IETF draft *RateLimit header fields for HTTP*, and every limit is also listed before your first request in `rate_limits` of https://facilitator.ultravioletadao.xyz/.well-known/uvd-stack.json. The buckets are separate per surface, so draining `/discovery/resources` does not cost you `/settle`, with one deliberate exception: **`POST /mcp` shares the `/verify` and `/settle` bucket**, because an `x402_settle` tool call costs the chain exactly what `POST /settle` costs it. A note on the arithmetic, because it reads backwards: the bucket refills one token every N seconds, so "30 req/min on verify/settle" is a burst of 30 plus one token every 2 seconds — not 30 tokens handed out each minute. A few routes that spend no chain quota (`/health`, `/supported`, `/llms.txt` and the other discovery documents) carry no limit at all and therefore no headers. The values in force -- every bucket's period and burst, the per-address and per-task ceilings of concurrent requests, the body deadline, and the ERC-8004 daily write limit -- are published at `GET /config`, each bucket under the name its `RateLimit-Policy` carries. --- ## 10. MCP: the same calls, as tools, plus the buyer's reads This facilitator is also an MCP server. Same host, same rate limit, same handlers -- an MCP tool call is dispatched through the very same code path as the HTTP request it names, so nothing here is a second implementation that could answer a different truth. - **Endpoint:** `https://facilitator.ultravioletadao.xyz/mcp` - **Transport:** Streamable HTTP, stateless. `POST` only. A `GET` on the same path is the human guide (HTML, or this same material as Markdown with `Accept: text/markdown`); a caller whose `Accept` names `application/json` or `text/event-stream` still gets the `405` naming POST, because there is no server-initiated SSE stream to open and no session id to keep. - **Guide:** `https://facilitator.ultravioletadao.xyz/mcp` - **Server card:** `https://facilitator.ultravioletadao.xyz/.well-known/mcp/server-card.json` - **Authentication:** none, exactly as in `/auth.md`. The MCP door grants no privilege the HTTP door does not: the payer's signature is still the only authority. | Tool | Is | Moves money | |---|---|---| | `x402_supported` | `GET /supported` | no | | `x402_accepts` | `POST /accepts` | no | | `x402_verify` | `POST /verify` | no | | `x402_settle` | `POST /settle` | **yes, irreversibly** | | `x402_networks` | `GET /networks.json` | no | | `x402_chain_health` | `GET /health/ready` | no | | `x402_escrow_onchain_state` | `POST /escrow/state` | no | | `x402_durable_evidence` | `GET /dx402/evidence/{paymentId}` (or `/receipt/`) | no | The arguments of each tool are the JSON body of the request it stands for (for the GET reads, its path and query), and the result is that request's response body verbatim, in a single text content block. The last four only read: how to present each network, whether a chain can settle right now (a `down` reading is the result, not an error), what an escrow contract holds for one payment (a view call, `network` CAIP-2 only), and the DX402 evidence anchored for a payment (`document: "receipt"` for the signed receipt alone). The `/mcp` guide has the details. **The body is the only channel — a tool call cannot set headers.** The parity with HTTP is one of *privilege*, not of capability: nothing here can move funds an HTTP client could not, but a few HTTP-only inputs have no MCP equivalent. The one that mattered has an argument instead: `x402_settle` takes an optional `idempotencyKey`, lifted out of the body and sent as the `Idempotency-Key` header, so a retry after an ambiguous error settles once and not twice. Send it on every retry. The v2 `PAYMENT-SIGNATURE` header transport has no equivalent; put the payload in the body. A non-2xx answer comes back as a tool error (`isError: true`) carrying the facilitator's own message -- not as a JSON-RPC error, which most clients render as an opaque "internal error" and would hide `invalid signature` behind. ### Handshake Both `Accept` types are required — the Streamable HTTP transport answers `406` without them, even though this server is stateless and always replies with JSON. ```bash curl -sS https://facilitator.ultravioletadao.xyz/mcp \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{ "protocolVersion":"2025-06-18","capabilities":{}, "clientInfo":{"name":"my-agent","version":"1.0"}}}' ``` ```json {"jsonrpc":"2.0","id":1,"result":{ "protocolVersion":"2025-06-18", "capabilities":{"tools":{}}, "serverInfo":{"name":"x402-facilitator","version":""}}} ``` The negotiated `protocolVersion` is the highest both sides know; this server supports `2024-11-05` through `2026-07-28`. ### Calling a tool ```bash curl -sS https://facilitator.ultravioletadao.xyz/mcp \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{ "name":"x402_supported","arguments":{}}}' ``` The `result.content[0].text` is the exact JSON body of `GET /supported`. `x402_verify` and `x402_settle` take the same envelope the REST routes take. Their `inputSchema` in `tools/list` spells that envelope out in full -- down to `paymentPayload.payload.authorization.value` and the string-typed timestamps -- and carries the section 3 example verbatim under `examples`, so a client that reads only the tool list has the whole contract: ```json {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{ "name":"x402_verify", "arguments":{ "x402Version":1, "paymentPayload":{ "...": "as in section 3" }, "paymentRequirements":{ "...": "as in section 3" }}}} ``` Read sections 3 and 4 before calling either: everything they say about `isValid`, `errorReason`, the EIP-712 domain-name trap and which failures are retryable is true over MCP too, because it is the same handler answering. Retrying a settle: ```json {"jsonrpc":"2.0","id":4,"method":"tools/call","params":{ "name":"x402_settle", "arguments":{ "x402Version":1, "paymentPayload":{ "...": "as in section 3" }, "paymentRequirements":{ "...": "as in section 3" }, "idempotencyKey":"a-key-you-keep-for-this-payment"}}} ``` Same key and same payment returns the first result instead of settling again; same key with a different payment is refused with `409`. --- ## 11. Libraries - `uvd-x402-sdk` — the house SDK, on npm (https://www.npmjs.com/package/uvd-x402-sdk) and PyPI (https://pypi.org/project/uvd-x402-sdk/). Point it at this facilitator's URL. - `x402-axum` — Rust middleware that prices a route and calls this facilitator. - `x402-reqwest` — Rust client that answers a 402 challenge for you. --- ## 12. Durable evidence (DX402): the paid response, retrievable later x402 delivers a paid response once and keeps nothing. DX402 (extension key `durable-evidence`) lets the seller seal a copy of the response body to the payer's own public key and anchor it here; the payer recovers it later with the wallet it paid with. This facilitator is the notary and the index -- it signs an EIP-712 receipt and records a pointer and a hash. It is not in the response path, and in `direct` mode it never holds the plaintext or any key that opens it. **Check that it is on before relying on it.** DX402 is off unless the operator enables it. `durable-evidence` appears in the `extensions` of `GET /supported` only when this deployment can actually serve it. Without it the `/dx402/...` routes are not registered at all, so every one of them answers the generic `404` (`"code": "not_found"` when you ask for JSON). That means "no DX402 here", not "no evidence for this payment". **It can never fail a payment.** Settlement never calls into DX402. When evidence cannot be produced, the seller's hook still delivers the body and says why in the `X-Durable-Evidence` response header (base64url JSON, no padding) as `{"skipped": ""}`: `too_large`, `busy`, `anchor_failed`, `no_payer_key`, `disabled`, `not_selected`. Treat the set as open. `not_selected` is not a failure: you paid for the offer without evidence. **You opt in by paying the durable offer.** A seller that offers evidence lists the same resource twice in its `402`, plain and with evidence, priced separately, and names the evidence offers in `extensions["durable-evidence"].info.acceptIndexes`. The offer you pay decides; a client that does not choose pays the plain one. Only EVM offers can be told apart this way today, so on other families a seller lists one offer per network. The offer's `retention` is `90d` by default, or `1y`, or `permanent` -- and `permanent` is irrevocable: anchoring is publishing. | Call | Returns | |---|---| | `GET /dx402/evidence/{paymentId}` | `pointer`, `contentHash`, `mode`, `retention`, `retentionUntil`, `receipt`, `verified`, `signed` | | `GET /dx402/receipt/{paymentId}` | the signed EIP-712 receipt (domain `DX402 Evidence`, version `1`), verifiable offline | | `GET /dx402/blob/{paymentId}` | the sealed ciphertext; unauthenticated on purpose, since only the payer's key opens it | | `GET /dx402/stats` | anchors counted (a floor, not a ledger), backend, default retention, receipt signer | | `POST /dx402/anchor` | the seller's call: metadata only, `201` when recorded | | `POST /dx402/recover` | `501`: `direct` mode needs no recovery, the payer already holds the key | `paymentId` is the value `/settle` returns (section 4): `keccak256(caip2 ‖ txHash)`, `0x` + 64 hex digits. Any casing, with or without `0x`, resolves to the same record. After decrypting, recompute `contentHash` over the **plaintext** and compare. That check is what catches a seller that anchored something other than what it served; `x402-reqwest`'s `recover` does it for you. Errors are `{"error": "", "retryable": }` -- branch on `error`: | You see | It means | Do | |---|---|---| | `404` + `"code": "not_found"` | DX402 is not enabled on this deployment | read `/supported`; do not retry | | `404` + `dx402_unknown_payment` | nothing is anchored for that id | a real negative; the seller may have skipped, so read `X-Durable-Evidence` | | `410` + `dx402_evidence_expired` | it existed and its retention ran out | a different answer from `404`; do not retry | | `503` + `dx402_store_unavailable` | the store did not answer (`retryable: true`) | retry later; never record it as "no evidence" | | `200` + `"verified": false` | provisional: the payee has not proved the anchor is theirs | the bytes still decrypt and the hash still checks, but it is not proof of who produced them | The anchoring side (`POST /dx402/anchor`, the payee signature, and its `409`/`422` answers) belongs to the seller integration; the human guide is `/dx402`. --- ## 13. The Bazaar: finding x402-priced resources The Bazaar is a catalog of x402-priced endpoints: registered here, seen settling through this facilitator, crawled, or aggregated from other facilitators' feeds. It takes no part in a transaction and moves no money. The human view is `/bazaar`. ### Reading it ``` GET /discovery/resources?q=weather&network=eip155:8453&limit=20 ``` Returns `{"x402Version": 2, "items": [...], "pagination": {"limit", "offset", "total"}}`. Each item carries `url`, `type`, `description`, `accepts` (CAIP-2 offers you can pay as they are, see section 3), `source`, and the read-time annotations `health`, `curation` and `priceFreshness`. The parameters, and only these: `limit` (default 10, capped at 100), `offset`, `q` (free text, no longer than `search.maxQueryChars` in `GET /discovery/config`), `sort` (`relevance` or `tier`: how results with `q` are ordered), `category`, `network` (CAIP-2), `provider`, `tag`, `source` (`self_registered`, `settlement`, `crawled`, `aggregated`), `sourceFacilitator`, `health` (`alive`, `degraded`, `auth_gated`, `quarantined`, `unknown`, `unprobeable`, `any`), `tier` (`first_party`, `vip`, `verified`, `listed`), and the router filters `maxPriceUsd` (the highest price in US dollars, such as `0.01`, of at least one dollar-stablecoin option), `method` (`GET`, `POST`, `PUT` or `PATCH`, as the listing declares it), `hasInputSchema` (`true` or `false`: whether the listing says what to send), `kind` (`api` or `content`) and `excludeHost` (comma-separated host names, each leaving out that host and its subdomains). - **An unknown parameter is a `400`, never ignored.** The body lists `supported` and, when the intent is obvious, a `hint` (`?search=` gets "did you mean q?"). A filter that was silently dropped would look like one that matched everything. - **Only what is verified alive is listed**: the last probe, made with the request the listing declares, got the listing's own `402` with a payment option we can read (an MCP endpoint: its handshake listed a tool), recently, and it is not quarantined. No parameter lists anything else -- `health=any` included: every item's `health.status` is `alive`, and `health.verifiedBy` says how it was verified (`x402_challenge` or `mcp_handshake`). A self-registered item, and one a discoverable settlement created, also carries `health.ownership` (see "Registering a resource"). - **Order.** Without `q`: tier (`first_party`, `vip`, `verified`, `listed`), then most recently updated. A one-word `q` keeps that order over the listings that contain it; a `q` of two or more words (function words aside) is ranked by relevance, which the tier only multiplies, and a host's further results follow every other host's. `sort` chooses either one explicitly; `sort=tier` takes the shorter `q` it always took (see `/docs`). - **The catalog is a previous reading, not the offer.** `priceFreshness` is `fresh`, `stale`, `unknown` or `conflict`, and `priceRevalidation: "pending"` means the amounts beside it are the last reading. Before paying, call the resource and decide against the `402` it answers now. - Page with `offset` until it reaches `pagination.total`. Reads draw on their own per-IP bucket (see `/auth.md`), separate from `/settle`. - `GET /discovery/stats` -- aggregate catalog numbers, cached for 60 seconds. - `GET /discovery/attestation/{hash}` -- a hosted ERC-8004 attestation body, keyed by `sha256(url)` as 64 hex characters. Any other key is a `400`; a miss is a `404`. ### Registering a resource `POST /discovery/register`: ```json { "url": "https://api.example.com/premium-data", "type": "http", "description": "Premium market data API", "accepts": [{ "scheme": "exact", "network": "eip155:8453", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "amount": "10000", "payTo": "0x0000000000000000000000000000000000000002", "maxTimeoutSeconds": 60 }], "metadata": { "category": "finance", "provider": "Example Corp", "tags": ["market-data"] } } ``` `amount` is a string in atomic units (`maxAmountRequired` is accepted as its v1 spelling); a non-integer amount is a `400`, never a zero. Success is `201` with `{"success": true, "url": ...}`. These refusals carry `error` but no `code`, so branch on the status and on `error`: | You see | It means | |---|---| | `400` `Invalid URL` | not http(s), credentials in the URL, or a private, loopback or link-local IP literal | | `400` `Invalid resource type` | `type` must be `http`, `mcp` or `a2a` (`facilitator` also exists, and is the only type allowed an empty `accepts`) | | `400` `No payment methods specified` | `accepts` is empty | | `409` `Resource already registered` | that URL is already in the catalog (listed, or waiting for its first verification); there is no public update or delete route | | `429` | registration has its own, much slower bucket (see `/auth.md`) | A registered URL is health-probed like any other entry. `first_party` and `vip` are curated by hand, `verified` answered a payment challenge correctly, and `listed` is everything else. Registration takes the URL from anyone, so a self-registered item (and one a discoverable settlement created) reports whether its own origin vouches for it in `health.ownership`. It is `origin-attested` when `/.well-known/x402` on the URL's host (not served from another host) has an entry for that exact URL declaring the same terms: every `network` + `payTo` your `accepts` lists, the same `description`, and the `category`, `provider` and `tags` you named (any case; your tags among its tags). The entry has the shape of the body above: ```json {"x402Version": 2, "resources": [{ "url": "https://api.example.com/premium-data", "description": "Premium market data API", "accepts": [{"network": "eip155:8453", "payTo": "0x0000000000000000000000000000000000000002"}], "metadata": {"category": "finance", "provider": "Example Corp", "tags": ["market-data"]} }]} ``` A bare URL, or an entry without recipients, vouches for nothing: it is `unattested`, as is a missing file or one that says something else. `unknown` means the file could not be read (including a 401/403 or a challenge page). The prober reads it at the root of your URL's origin once your listing verifies alive, normally once per origin every `ownership.cacheSeconds` of `GET /discovery/config`. --- Source: https://github.com/UltravioletaDAO/x402-rs Operator: Ultravioleta DAO — https://ultravioletadao.xyz ## Arc EURC amounts EURC mainnet is `0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1`; testnet is `0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a`. Both use six decimals and EIP-712 `EURC` / `2`. One EURC is one euro, not one dollar; no automatic FX conversion is performed. Gas stays USDC. A funded 0.01 EURC payment (10000 atomic units) was verified and settled on Arc mainnet on 2026-09-22, tx 0xd9de3864e11698cf730664147ac383acb763279056ac091bab57cfd3bf536128; funded testnet payments remain pending. ## Portable facilitator receipts (EVM and Hedera) Exact payments on the networks `GET /receipts` lists return `receipt` alongside verify/settle: on an EVM network, in the ERC-3009 tokens `/supported` lists for its `exact` kind; on Hedera, native USDC. Discover `/supported.facilitatorReceipts`, `/receipts`, `/schemas/facilitator-receipt-v1.json` and `/.well-known/receipt-keys.json`. For private lookup, persist a purchase context and send `X-UVD-Purchase` (base64 JSON: purchaseId, secret accessToken, method, url, bodySha256). The merchant must validate it against the actual request. Query `/receipts/{receiptId}` with `Authorization: Bearer `. Never log the context or create a fresh signature after uncertainty. An unknown receipt means poll/replay the original authorization, not a new payment. Receipt confirmation does not prove delivery. The original answer is replayed only with the `X-UVD-Purchase` or `Idempotency-Key` that admitted the payment; a resend without it answers `409 authorization_already_settled` or `409 authorization_in_flight` (verify: `isValid: false` with the same reason), never a repeated success. That binding and the receipt last until the receipt rows expire (Expiry, in the full contract). A `503` with `safeToRetry: true` and `Retry-After` sent nothing, and a receipt `rejected` with `refusalReason: reservation_abandoned` says the same: resend the same request after the delay; it is admitted again under the same receipt. A failure after the send latched or its bytes were prepared is the opposite: it carries `retryable: false`, no `Retry-After`, the prepared `transaction` and its `paymentId`; poll the receipt, never sign a replacement. Python `fetch_with_receipt` and TypeScript `fetchWithReceipt` return the original HTTP response plus receipt/payment state. Supply trusted issuer keys for offline signature verification. Live EURC acceptance was proven on Arc mainnet on 2026-09-22 (x402 v2, receipt `confirmed`, tx 0xd9de3864e11698cf730664147ac383acb763279056ac091bab57cfd3bf536128); Arc testnet is still pending. Other networks retain their existing responses. Full contract: https://github.com/UltravioletaDAO/x402-rs/blob/main/docs/facilitator-receipts.md Receipts cover plain `exact` payments only. On every network, `upto`, `escrow`/`commerce` and the x402r `refund` extension keep their own settlement paths and carry no `receipt`. --- # auth.md You are an agent. This document describes how to authenticate against the Ultravioleta DAO x402 payment facilitator at `https://facilitator.ultravioletadao.xyz/`. Language (idioma): English (`en`). This document has no Spanish translation. The Spanish version of the human pages (`/`, `/bazaar`, `/dx402`, `/integrar`, ...) is at the same URL as the English, behind each page's EN/ES selector; there is no `/es/` path. ## The short answer: you do not **The facilitator has no accounts, no API keys, no OAuth, and no registration.** There is no client_id to obtain, no token to refresh, and no identity to prove before calling it. `POST /verify` and `POST /settle` are open to anyone, and so is every read endpoint on this host. That is deliberate, and it follows from what the service is. A facilitator does not sell anything — it checks a signature that someone else's buyer produced and lands the resulting transfer on-chain. The thing being authorized is the *payment*, and the payment carries its own authorization: the payer's signature over an EIP-3009 `transferWithAuthorization` (or the equivalent primitive on Solana, NEAR, Stellar, Sui, Algorand and XRPL). The facilitator verifies that signature against the token's EIP-712 domain, the nonce, the amount and the validity window. Nothing about *your* identity as the caller changes the answer. So there is nothing to send. No `Authorization` header, no `X-API-Key`, no cookie. ### The MCP endpoint is the same door `POST /mcp` authenticates nobody either. It carries no OAuth flow, no session token and no client registration — the `/.well-known/oauth-protected-resource` document above describes it as well as it describes the HTTP routes. Its four tools are dispatched through the very same handlers as `/verify`, `/settle`, `/supported` and `/accepts`, so an MCP client holds exactly the privilege an HTTP client holds and no more. In particular `x402_settle` settles a payment the payer signed; it does not let a caller spend anything of their own or of ours. That parity is of *privilege*, not of capability. A tool call cannot set headers, so a few HTTP-only inputs have no MCP equivalent — the v2 `PAYMENT-SIGNATURE` transport among them. The one that mattered is exposed as an argument instead: `x402_settle` takes an optional `idempotencyKey`, lifted out of the body and sent as `Idempotency-Key`, so an MCP client can ask for exactly-once on a retry. The transport has one requirement worth knowing before you write a client by hand: `Accept` must name **both** `application/json` and `text/event-stream`, or the request is refused with `406`. ## This service does not charge `/verify` and `/settle` never answer `402 Payment Required`. The facilitator takes no fee and pays the settlement gas from its own wallets. If you receive a `402` from this host, something is wrong — report it rather than paying it. If you are looking for the x402 *payment* flow, you are one layer up: the seller's API issues the 402 challenge, and you point your x402 client at this facilitator to have the resulting authorization verified and settled. See `/skill.md` for that flow and `/.well-known/x402` for the discovery document. ## What is actually enforced ### Rate limits, per IP The facilitator applies a GCRA (token bucket) limit per client IP: the address the load balancer appends to `X-Forwarded-For` (its last entry), or the peer address when that header is absent. Exceeding it returns **429**, never 401 or 403. | Route group | Sustained | Burst | |---|---|---| | `POST /verify`, `POST /settle`, `POST /mcp` | 1 token every 2s (about 30 req/min) | 30 | | `POST /discovery/register` | 1 token every 12s | 250 | | ERC-8004 writes (`POST /register`, `POST /feedback`, `POST /feedback/*`) | 1 token every 12s | 30 | | Bazaar reads (`/discovery/resources`, `/discovery/stats`) | 1 token every 200ms | 120 | Every limit, including the ones this table leaves out (identity and reputation reads, `/events`, the human pages), is published as `limit` requests per `window_s` seconds in `rate_limits` of https://facilitator.ultravioletadao.xyz/.well-known/uvd-stack.json, and each limited response names its bucket in `RateLimit-Policy` and what is left in `RateLimit`. ERC-8004 writes that send a transaction are also limited per network per UTC day. Past that limit they return **429** with code `erc8004_daily_write_limit` and a `Retry-After` that runs to 00:00 UTC; other networks are not affected. A `429` is a back-off signal, not a rejection of your request's contents. Retry with the delay the limiter implies; do not re-sign the payment. ### CORS `Access-Control-Allow-Origin: *`, methods `GET` and `POST`. Browser-side x402 clients can call the facilitator directly. ### Admin routes, which are not for you A small number of destructive routes are gated by a static bearer token held by the operator — `POST /feedback/revoke` (ERC-8004 reputation) and the Bazaar admin routes (`DELETE /discovery/resources`, `POST /discovery/admin/suppress`, `POST /discovery/admin/release`). They are **fail-closed**: when the operator has not configured a token, the route answers `404`, indistinguishable from a route that does not exist. There is no way for an agent to obtain one of these tokens, and no self-service path that issues them. Treat those routes as absent. ## Identity, when you want one anyway You do not need an identity to use the facilitator, but the stack it belongs to has one, and the facilitator serves it: - **ERC-8004 Trustless Agents** — on-chain agent identity and reputation, live on 14 mainnets (25 networks counting testnets). `GET /identity/{network}/{agentId}`, `GET /identity/{network}/owner/{address}`, `GET /reputation/{network}/{agentId}`. - `POST /register` mints an agent identity. It spends gas, so it carries the tight write-route rate limit; pass `Prefer: respond-async` to get a `202` and a `jobId` you poll at `GET /register/status/{jobId}` instead of holding the connection open. - `POST /feedback` records reputation, and since v1.74.0 the payment proof attached to it is verified server-side against the chain. Authorship matters there: on the plain `/feedback` path the registry records the *facilitator* as the author. To be recorded as the rater yourself, use the prepare/submit pairs — `POST /feedback/evm/prepare` then `POST /feedback/evm/submit` (EIP-7702 relayed, served only where a verified delegate is deployed), or `POST /feedback/solana/prepare` then `POST /feedback/solana/submit` (you sign as `client`, the facilitator stays fee payer). `GET /identity/{network}/owner/{address}` distinguishes **404** ("this address owns no agent") from **503** ("the lookup reached no verdict", carrying `"retryable": true`). Do not collapse them: persisting "not registered" from a 503 turns a transient RPC failure into a permanent wrong answer, and on a registration path it mints a duplicate agent for someone who already has one. ## Machine-readable form RFC 9728 metadata is published at `/.well-known/oauth-protected-resource`. It declares an empty `authorization_servers` array on purpose: the document exists so an OAuth-capable agent can discover that this resource is **not** OAuth-protected, without having to try and fail. ## Links - Agent manual: https://facilitator.ultravioletadao.xyz/skill.md - x402 discovery: https://facilitator.ultravioletadao.xyz/.well-known/x402 - OpenAPI: https://facilitator.ultravioletadao.xyz/openapi.json - Operator: Ultravioleta DAO — https://ultravioletadao.xyz