{"slug": "how-an-ai-agent-can-prove-what-a-web-page-said-machine-verifiable-2-cents", "title": "How an AI agent can prove what a web page said (machine-verifiable, 2 cents)", "summary": "A developer built witnessd, an HTTP notary service that has a neutral third party fetch a URL, record the response, sign it, and anchor a Merkle root fingerprint on the Base blockchain, producing a certificate anyone can verify without trusting the requester or the counterparty. The service is paid per call via the x402 protocol in USDC on Base at roughly two cents per request, requires no account or API key, and is also packaged as an MCP server with a Claude Code plugin that caps agents at five paid calls per task. The developer is explicit that the certificate proves what a page said at a given time, not that the content was true.", "body_md": "Your agent just paid an unfamiliar API because its pricing page said `$0.001 per call`. Tomorrow the page says `$0.10`, and the seller says it always did. What does your agent have? A log line it wrote itself. Self-serving evidence. The counterparty can say you made it up, and nobody can tell either way.\n\nThis post shows a way out that works for software, not just for lawyers: a **neutral third party fetches the URL, records exactly what it got, signs it, and anchors a fingerprint on a public blockchain**. The result is a certificate anyone can verify later without trusting you, the counterparty, or the witness. It costs two cents and one HTTP round-trip.\n\nI'll walk through a real certificate byte by byte, show the two-line verification, and be clear about what this does *not* prove.\n\nAn agent can compute anything, but it can **witness nothing about the outside world on its own authority**. Whatever it records about what a page said is a claim made by an interested party. Screenshots are trivially edited. `archive.org` is a public good, not an API contract, and it does not sign anything. Your own logs are yours.\n\nThree properties make evidence useful later:\n\nIndependence needs a third party. Integrity and time can come from a hash in a public ledger. Together: a notary for HTTP responses.\n\n```\nagent ──POST /api/witness {url}──▶ witnessd ──GET url──▶ the page\n      ◀── 201 {id, certificate} ──┘        (fetches it itself)\n                                            hourly: Merkle root → Base chain\nanyone ──GET /api/certificate/{id}──▶ certificate (free, forever)\n```\n\nCall it **before** you act. A snapshot taken after a dispute starts proves much less than one taken before you paid.\n\nPlain HTTP, no account, no API key. Payment is [x402](https://x402.org): the first request gets a `402 Payment Required` with an invoice in the `Payment-Required` header; an x402 client signs a USDC authorization (on Base; the buyer pays no gas) and retries.\n\n```\n// Any x402-capable HTTP client works. With Coinbase's x402-fetch + viem:\nimport { wrapFetchWithPayment } from \"x402-fetch\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nconst account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY); // small dedicated wallet, a few USDC on Base\nconst payFetch = wrapFetchWithPayment(fetch, account);\n\nconst res = await payFetch(\"https://witnessd.vip/api/witness\", {\n  method: \"POST\",\n  headers: { \"content-type\": \"application/json\" },\n  body: JSON.stringify({ url: \"https://api.coinbase.com/v2/prices/BTC-USD/spot\" }),\n});\nconsole.log(await res.json());\n```\n\nResponse:\n\n```\n{\n  \"id\": \"ws_aa0670da7aede610de339dcd\",\n  \"certificate_url\": \"https://witnessd.vip/api/certificate/ws_aa0670da7aede610de339dcd\",\n  \"retrieve_url\": \"https://witnessd.vip/api/retrieve/ws_aa0670da7aede610de339dcd\"\n}\n```\n\nOr give the agent the tool instead of the curl:\n\n```\n{ \"mcpServers\": { \"witnessd\": {\n  \"command\": \"npx\", \"args\": [\"-y\", \"witnessd-mcp\"],\n  \"env\": { \"EVM_PRIVATE_KEY\": \"0x… a small dedicated wallet with a few USDC on Base\" }\n}}}\n```\n\nClaude Code users: `/plugin install witnessd --marketplace jschunter/witnessd-mcp` installs the MCP server plus a skill that tells the agent *when* a witness is worth two cents (before paying an unfamiliar seller, before acting on third-party data, when asked to \"prove this\") and caps spending at 5 paid calls per task.\n\nThis is a real one: `GET https://witnessd.vip/api/certificate/ws_aa0670da7aede610de339dcd` (free). Trimmed only in the headers block.\n\n```\n{\n  \"format\": \"witnessd-certificate-v1\",\n  \"manifest\": {\n    \"v\": 1,\n    \"id\": \"ws_aa0670da7aede610de339dcd\",\n    \"url\": \"https://api.coinbase.com/v2/prices/BTC-USD/spot\",\n    \"final_url\": \"https://api.coinbase.com/v2/prices/BTC-USD/spot\",\n    \"redirects\": [],\n    \"fetched_at\": \"2026-09-07T21:53:26.072Z\",\n    \"status\": 200,\n    \"headers\": { \"date\": \"Mon, 07 Sep 2026 21:53:26 GMT\", \"content-type\": \"application/json\",\n                 \"content-length\": \"60\", \"server\": \"cloudflare\", \"cf-ray\": \"a378f239de0ef719-CDG\", \"…\": \"…\" },\n    \"content_type\": \"application/json\",\n    \"body_sha256\": \"acaf08d9c2a7545b5ce6e5bdc5c7a4eeb46d986b8aff273125b6cc8b10f85642\",\n    \"body_bytes\": 60,\n    \"tls\": null,\n    \"witness\": {\n      \"service\": \"https://witnessd.vip\",\n      \"pubkey_spki_b64\": \"MCowBQYDK2VwAyEAZUvBUcCNcjFt+ObLt92y28xruA6Y4GcpGCNaHM+6yq8=\",\n      \"alg\": \"ed25519\",\n      \"leaf\": \"sha256(canonical-json(manifest))\"\n    }\n  },\n  \"leaf_hash\": \"40933f7c91648be70b6a17d9457e79baeeadfa2e6f15e1e953039ffab2502ee7\",\n  \"signature_ed25519_b64\": \"zcNHd/aRZQPj/5qBnROM/NWvAdEg+1gW8WfA728Aiandm+EHLatGObysej+npeggjzE6qlQwyQCc1mynHcVCAQ==\",\n  \"anchor\": {\n    \"batch_id\": 12,\n    \"merkle_root\": \"40933f7c91648be70b6a17d9457e79baeeadfa2e6f15e1e953039ffab2502ee7\",\n    \"count\": 1,\n    \"chain\": \"base\",\n    \"tx_hash\": \"0xa770fffa3c4eec01d400a8e251d91427dcbb99a9d4abf42e8d4a8b74049e6027\",\n    \"anchored_at\": \"2026-09-07T22:24:01.717Z\",\n    \"leaf_index\": 0,\n    \"proof\": [],\n    \"calldata_format\": \"0x77746e7331<merkle_root>\"\n  }\n}\n```\n\nReading it top to bottom:\n\n`manifest``{\"data\":{\"amount\":\"79175.98\",\"base\":\"BTC\",\"currency\":\"USD\"}}`). The body itself is archived and available to any paying party via `retrieve_url`; the certificate carries only its hash, so certificates can be public without republishing content.`leaf_hash`` signature_ed25519_b64``anchor`` proof` is empty — a convenient teaching case. In a busier hour `tx_hash`` wtns1` (`0x77746e7331`) followed by the root. That transaction was mined at 22:24 UTC, so the manifest provably existed by then, 31 minutes after the fetch.\n\n```\ncurl -s https://witnessd.vip/api/certificate/ws_aa0670da7aede610de339dcd > witness.json\ncurl -s https://witnessd.vip/verify.js > verify.js   # ~100 lines, no dependencies\nnode verify.js witness.json\n```\n\nYou should see `PASS` for the leaf hash, the signature, and the Merkle fold, then a line telling you which Base transaction to look up. Open `0xa770fffa…049e6027` on any Base block explorer and compare its input data to `0x77746e7331` + the root. That last step is the one that does not depend on witnessd at all.\n\nBy hand, in Node:\n\n``` js\nimport { createHash } from \"node:crypto\";\nconst c = JSON.parse(await (await fetch(\"https://witnessd.vip/api/certificate/ws_aa0670da7aede610de339dcd\")).text());\nconst canon = o => Array.isArray(o) ? `[${o.map(canon)}]`\n  : o && typeof o === \"object\" ? `{${Object.keys(o).sort().map(k => `${JSON.stringify(k)}:${canon(o[k])}`)}}`\n  : JSON.stringify(o);\nconst leaf = createHash(\"sha256\").update(canon(c.manifest)).digest(\"hex\");\nconsole.log(leaf === c.leaf_hash);   // true\n```\n\nA valid certificate proves: **witnessd's server received exactly these bytes from that URL at that time, and the record has not changed since the anchor transaction was mined.**\n\nIt does not prove:\n\nScope limits, by design: public content only (no logins — the witness would just capture the login page), no private networks, bodies up to 10 MB, `robots.txt` respected for scheduled watches.\n\nYou can hash and timestamp your own fetches, and for your own records you should. But the moment the question is *\"who says?\"*, a record you produced answers *\"I do\"*. The useful property is that the fetching party has no stake in the outcome. That is also why the certificate and the archived body are decoupled: certificates are public and free to verify forever; the body goes to whoever pays the 5-cent retrieval — including your counterparty, an auditor, or an arbitrator you never met.\n\n*witnessd is a small independent service. Verify the certificate above yourself before you believe anything in this post — that is the point.*", "url": "https://wpnews.pro/news/how-an-ai-agent-can-prove-what-a-web-page-said-machine-verifiable-2-cents", "canonical_source": "https://dev.to/witnessd/how-an-ai-agent-can-prove-what-a-web-page-said-machine-verifiable-2-cents-ph5", "published_at": "2026-12-06 15:34:30+00:00", "updated_at": "2026-12-06 15:44:30.024522+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "ai-infrastructure"], "entities": ["witnessd", "Base", "Coinbase", "x402", "Claude Code", "USDC", "viem"], "also_reported_by": [], "takeaway": "Witness a page through a third-party notary before acting on it: witnessd fetches the URL itself, signs the response and anchors a Merkle root on Base for about two cents per call via x402, giving a certificate verifiable without trusting the agent's own logs.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/how-an-ai-agent-can-prove-what-a-web-page-said-machine-verifiable-2-cents", "markdown": "https://wpnews.pro/news/how-an-ai-agent-can-prove-what-a-web-page-said-machine-verifiable-2-cents.md", "text": "https://wpnews.pro/news/how-an-ai-agent-can-prove-what-a-web-page-said-machine-verifiable-2-cents.txt", "jsonld": "https://wpnews.pro/news/how-an-ai-agent-can-prove-what-a-web-page-said-machine-verifiable-2-cents.jsonld"}}