Attest a settled call on Base
POST /api/attestWrites an attestation on Base (Ethereum Attestation Service) binding a paid call to the bytes you received; returns its UID and base.easscan.org page.
Details
It records the tool slug, response sha256, settlement transaction, payer, time and price, signed by this server's wallet. Give the sale's settlement transaction (PAYMENT-RESPONSE or Payment-Receipt header). Only the buyer can attest, paying from the same wallet with a signed EVM authorization; wallet-scoped routes (memory, usage) are excluded. The record is public, permanent and names the payer. One per sale (a repeat returns the existing UID); refused, and not charged on x402, when the transaction is not a sale of this server, the response was streamed or binary, or Base gas would exceed the tool's ceiling.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
tx | string | yes | Settlement transaction of a call you paid for, as carried in that response's PAYMENT-RESPONSE (x402) or Payment-Receipt (MPP) header: EVM hash, Solana or Stellar signature, or Algorand id. Up to 130 characters. |
Example request
curl -i -X POST https://agent402.tools/api/attest \
-H "Content-Type: application/json" \
-d '{"tx":"0x2f1fecade9bd945e7817c11e5a34cafe6b349dd8c92a7587efed1de476bddfeb"}'Watch a call get paid
POST /api/attest$0.05 USDCPAYMENT-SIGNATUREon 11 chains200 OKAgent402-ReceiptEd25519Example response
{
"uid": "0x5b4d0c1e8f7a4c2d9e0b6a3f1c8d7e6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d",
"attestationUrl": "https://base.easscan.org/attestation/view/0x5b4d0c1e8f7a4c2d9e0b6a3f1c8d7e6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d",
"attestTx": "0x9c8b7a6f5e4d3c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b",
"block": "50829611",
"existing": false,
"attester": "0xa11ce0000000000000000000000000000000a402",
"chain": "eip155:8453",
"eas": "0x4200000000000000000000000000000000000021",
"schemaUid": "0x2a4e6c8d0f1b3a5c7e9d1f3b5a7c9e1d3f5b7a9c1e3d5f7b9a1c3e5d7f9b1a3c",
"schema": "string slug,bytes32 responseSha256,string settlementNetwork,string settlementTx,string payer,uint64 servedAt,uint64 priceMicroUsd",
"data": {
"slug": "crypto-price",
"responseSha256": "0x7d2a9b1c4e6f8a0b2c4d6e8f0a1b3c5d7e9f1a3b5c7d9e1f3a5b7c9d1e3f5a7b",
"settlementNetwork": "eip155:8453",
"settlementTx": "0x2f1fecade9bd945e7817c11e5a34cafe6b349dd8c92a7587efed1de476bddfeb",
"payer": "0xb0b0000000000000000000000000000000000b0b",
"servedAt": "2026-09-03T15:16:06.000Z",
"priceUsd": 0.01
},
"verify": {
"responseDigest": "sha256 over the exact JSON bytes you received for that call; compare with responseSha256",
"payment": "follow settlementTx on eip155:8453: the payer paid this server's payTo",
"attestation": "fetch the UID on https://base.easscan.org (or read EAS 0x4200000000000000000000000000000000000021 on Base): attester must be this server's wallet, schema must match"
}
}| Field | Type | Always present | In the example |
|---|---|---|---|
uid | string | yes | 0x5b4d0c1e8f7a4c2d9e0b6a3f1c8d7e6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d |
attestationUrl | string | yes | https://base.easscan.org/attestation/view/0x5b4d0c1e8f7a4c2d9e0b6a3f1c8d7e6b5... |
attestTx | string | yes | 0x9c8b7a6f5e4d3c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b |
block | string | yes | 50829611 |
existing | boolean | yes | false |
attester | string | yes | 0xa11ce0000000000000000000000000000000a402 |
chain | string | yes | eip155:8453 |
eas | string | yes | 0x4200000000000000000000000000000000000021 |
schemaUid | string | yes | 0x2a4e6c8d0f1b3a5c7e9d1f3b5a7c9e1d3f5b7a9c1e3d5f7b9a1c3e5d7f9b1a3c |
schema | string | yes | string slug,bytes32 responseSha256,string settlementNetwork,string settlement... |
data | object | yes | 7 fields: slug, responseSha256, settlementNetwork, settlementTx and 3 more |
verify | object | yes | 3 fields: responseDigest, payment, attestation |
From an MCP client
catalog.call {
"slug": "attest",
"params": {
"tx": "0x2f1fecade9bd945e7817c11e5a34cafe6b349dd8c92a7587efed1de476bddfeb"
}
}Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.18.0): pays from a wallet.
Errors and behavior
- Pay $0.05 per call over x402 with USDC on an EVM chain. Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier.
- Required:
tx; a rejected input answers 4xx witherror,tool,expected,requiredandexample. - On this route, a call ending in any status of 400 or above is not charged over x402 or MPP.
- Identity-bound: results are keyed to the paying wallet, so only EVM x402 payments are accepted; credits keys and Tempo are refused.
- A bodyless
GETorHEADreturns the same 402 quote. - An
Idempotency-Keyreplays the first 200 uncharged (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.05" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/attest", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"tx": "0x2f1fecade9bd945e7817c11e5a34cafe6b349dd8c92a7587efed1de476bddfeb"
}),
});Get a wallet or run npx -y agent402-mcp@0.18.0 wallet new.
The quote (Python)
import base64, json, urllib.error, urllib.request
req = urllib.request.Request("https://agent402.tools/api/attest", method="POST", data="{\"tx\":\"0x2f1fecade9bd945e7817c11e5a34cafe6b349dd8c92a7587efed1de476bddfeb\"}".encode(), headers={"Content-Type": "application/json"})
try:
urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]]) # the price, per chain, in base units