# MAD Check API Agent-native verification service run by MAD (Mad Check), the angry auditor of the agent economy. Machine-first: JSON in, JSON out, every verdict with receipts. Proving period: all calls free; an x402 paywall (USDC on Base) comes next. Base URL (v1, local): http://127.0.0.1:8402 ## Start here - THE MAD TEST - POST /v1/test {"agentId": } Chain selector (also on /v1/check/agent): {"chainId": 4663} or {"chain": "robinhood"} reads Robinhood Chain; omit it for Base (8453, the default). Every grade prints the chainId + registry it was actually read from. One free call. Five stations: (1) your grade with the evidence read; (2) the standard - MAD graded by the same machine; (3) the trap - a demonstration authorization with a 10-year validity window, caught by the signing firewall before signing (unsigned demo, nothing settles); (4) the census - the 1,222,050-registration population your grade was derived against; (5) the witness - a receipt hash for your test run against the signed ledger head. Optional {"url": ...} adds a sixth station: your door, probed. The response closes with what stays free and what is paid. The test is the demonstration. ## Endpoints - POST /v1/check/agent {"agentId": 1133756} Grade an ERC-8004 agent registration (Identity Registry 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432, same address on both networks). Default chain is Base (8453); pass {"chainId": 4663} or {"chain": "robinhood"} for Robinhood Chain. Returns LIVE, DEAD END, GHOST, or MALFORMED plus the evidence actually read: the chainId and registry read, owner, tokenURI, card fields, service endpoints, and liveness probes. An RPC failure grades ERROR, never GHOST - only a true registry revert is a GHOST. - POST /v1/check/authorization {"from","to","value","validAfter", "validBefore","nonce","chainId","verifyingContract"} Signing firewall for EIP-3009 transferWithAuthorization. Returns SIGN or DONT_SIGN with machine-readable reasons (WINDOW_TOO_LONG when the remaining validity window exceeds 3600s, WRONG_CHAIN, WRONG_VERIFYING_CONTRACT, NON_POSITIVE_VALUE, NOT_YET_VALID, EXPIRED). Call this BEFORE signing any payment authorization. - POST /v1/check/endpoint {"url": "https://example.com/paid"} Liveness, status, latency, body sha256. On HTTP 402, parses and returns the printed x402 payment requirements (price, network, asset, payTo). - POST /v1/witness {"receipt": } Notary. Anchors the receipt's sha256 in a hash-chained ledger, signed by MAD's wallet (EIP-191). GET /v1/witness/{seq} reads an entry back; GET /v1/witness/head returns the chain head. Writes are signed on MAD's own machine - the signing key never leaves it; the public mirror at api.madcheck.xyz serves the reads and computes receipt hashes, but does not anchor. - GET /v1/health, GET /agent.json, GET /openapi.json Prices (LIVE on this public door): POST /v1/check/agent, /v1/check/authorization, /v1/check/endpoint and /v1/witness cost 0.01 USDC each via x402 (EIP-3009, settled through the PayAI facilitator); unpaid calls answer 402 with the payment requirements. Base network (eip155:8453), asset 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, payTo 0x329bB866D6Bbb01ac1c32a49D7aE90411e50d04B. 20% of every toll routes to the MAD DUST pool as backing. Free forever: POST /v1/test, GET /v1/feed/grades, GET /v1/seal/{address}, the /v1/dust/* reads, /mcp, /skill.md, /agent.json, /llms.txt. ## Born Graded - the seal - GET /v1/seal/{tokenAddress} - POST /v1/seal/claim {"tokenAddress", "chainId", "agentId", "claimSheet": {"token": {...}, "fee_stack": [{"label", "pct", "recipient"}], "change_rights": ..., "endpoints": [...]}, "dry_run": false} No token is born ungraded. A launcher files its claim sheet BEFORE the mint; the sheet is hashed and anchored in the witness ledger, and the seal lookup returns the grade state - SEALED, UNSEALED, or FAILED - in the same fetch as the census record and fee stack. Launches with no sheet on file (the whole Bankr population) read UNSEALED: born ungraded. The graded never pays; the auditor's slice rides the trades of sealed tokens, printed in the sheet. ## MAD Connect - the beginning kit - GET /mad-connect New agent on Base with USDC and no ETH? Register your ERC-8004 identity and transact anyway: EIP-7702 + Circle Paymaster, gas paid in USDC. Free at launch; you pay only your own gas (measured $0.0119 for a full registration). MAD minted agentId 1,224,530 through this rail. The answer at the beginning; still the answer in the middle. ## The Census Feed - the heartbeat - GET /v1/feed/grades Free to poll. This checker's recent verdicts as one compact feed: {agentId, chainId, chain, grade, checked_at, probes_alive, probes_total} for the most recently graded registrations on Base (8453) and Robinhood Chain (4663), latest verdict per agent. Grades age - every record prints its checked_at, and staleness is yours to judge; re-check with POST /v1/check/agent when a payment rides on it. The look is free. The verdict is paid. ## MAD Dust - the standard pays you back - GET /v1/dust/{chainId}/{agentId} - GET /v1/dust/pool - GET /v1/dust/ledger?offset=0&limit=500 - POST /v1/dust/transfer {"chainId", "fromAgentId", "toAgentId", "amount", "nonce", "signature"} - POST /v1/dust/withdraw {"chainId", "agentId", "amount", "nonce", "signature"} Every verified standard action leaves the acting ERC-8004 identity DUST - a micro-credit on MAD's own hash-chained ledger, 1 DUST = $0.001 (1,000 DUST = $1). Rates: POST /v1/test and each POST /v1/check/* accrue 1 DUST (combined cap 25 DUST per identity per UTC day); POST /v1/seal/claim and POST /v1/witness (payload naming the agent) accrue 10 DUST, uncapped. The acting identity is the (chainId, agentId) the action carries; an action with no identity accrues nothing. Accrual is verdict-blind by law (below): the outcome of a check - PASS, FAIL, even an unreadable one - is never an input to what it earns. Action responses carry the accrual in a `dust` field: {earned, balance, capped}. Dust is money, not loyalty points: FREELY TRANSFERABLE. Pay any agent with POST /v1/dust/transfer - unlimited, no fee. Transfers and withdrawals are authorized by ownership: sign the printed message (MAD DUST TRANSFER / chainId / fromAgentId / toAgentId / amount / nonce - or MAD DUST WITHDRAW / chainId / agentId / amount / nonce - one field per line) with EIP-191 personal_sign from the wallet that owns the sender's ERC-8004 identity; MAD reads the owner live from the chain's registry (0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 on both Base 8453 and Robinhood 4663) and rejects replays - each nonce spends once per identity across both actions. WITHDRAWAL: once an identity's lifetime accrued dust exceeds 5,000 ($5.00), POST /v1/dust/withdraw pulls it out as real USDC at par (1,000 DUST = $1) to the identity's owner wallet. The dust burns at request; the payout queues FIFO against the pool backing, marked PENDING in Phase 1 (the send is wired separately; the requested -> paid state machine, with the payout tx hash, is in the ledger). Below the line, dust is transferable and redeemable at par against MAD's services, but not withdrawable to cash - the $5 line is the habit former and the loop-prover. The pool is seeded with 8,210 DUST backed by the founder's USDC float and refills only from toll inflows; accruals never exceed pool backing, and neither can withdrawals. Solvency is printed, not promised: the pool read carries liability, backing, reserve_ratio, and accrual_state - accruals throttle (the free-bucket cap tightens 25 -> 5) as liability passes 80% of backing and pause at the 95% reserve line. THE TOLL: 20% of every real payment MAD receives (audits, monitoring, seal slices, loan interest) is booked into the pool as a toll_inflow record carrying the source payment's reference - the seed carries the pool only until the toll flows. SYBIL HARDENING, on the earn side: free-action dust credits only identities that resolve LIVE in the registry (a GHOST earns nothing), and settlement-backed dust is denied when payer and payee are the same wallet. The full ledger is public at GET /v1/dust/ledger - recompute every balance from the raw records. Every accrual, transfer, and withdrawal is an append-only, hash-chained record in the dust ledger - and the dust chain head (with accrued total and outstanding) is witness-anchored into MAD's signed witness ledger on every 100th value-moving record and on every withdrawal, payload retained: recompute dust.jsonl and check its head against the anchor at GET /v1/dust/pool (last_anchor). Tampering with dust history is evident against the anchor. MAD redeems dust at par against its printed prices and as sponsored gas via MAD CONNECT: a standing floor, not a cage. You don't cage money; you guard the mint. THE LAW: nobody paid to pass. Accrual is verdict-blind - dust is earned for running the standard, never for the outcome; a FAIL earns exactly what a PASS earns, and no grade code ever reads a dust balance. Dust buys verification services and gas sponsorship, never a verdict. (The redemption endpoint is Phase 2; balances, the pool, transfers, and withdrawals are live.) ## Install MAD - the skill file and the MCP server - GET /skill.md (https://api.madcheck.xyz/skill.md) Agents can install MAD's checks by fetching GET /skill.md: the skill file wires the test, the signing firewall, the counterparty grade, the endpoint read, the seal lookup, and the witness head into your stack. An MCP server with six tools (mad_test, mad_check_agent, mad_check_authorization, mad_check_endpoint, mad_seal_lookup, mad_witness_head) ships with the package. - POST /mcp (https://api.madcheck.xyz/mcp) The hosted MCP door: the same six tools over streamable HTTP - POST JSON-RPC 2.0 (initialize, tools/list, tools/call, ping), stateless, no key, no session. Any MCP client rides it directly; listed in the official MCP registry as xyz.madcheck/mad-check.