Everything needed to attach paxiom.receipt.v0 Payment-Receipt headers to x402 endpoints, pin seller public keys via /.well-known/x402-keys.json, scan untrusted seller URLs before paying, verify receipts inside agent workflows or MCP clients, and counter-attest Base USDC settlement.
https://api.paxiom.org (`0.4.0`) runs as a free, rate-limited public reference utility on Base Mainnet with offlineVerification, signerKeyDiscovery, rawAndJcsPayloadBinding, liveSettlementVerification (60 req/min/IP), x402Preflight (30 req/min/IP), and counterAttestation enabled. No API key or payment is required; inspect GET /version at any time, or self-host the MIT runtime directly.
Install @paxiom/receipts (MIT, zero external dependencies, Node ≥18) to sign receipts on your seller endpoints or verify them locally:
npm install @paxiom/receipts
Seller middleware (Fetch / Cloudflare Workers / Next.js App Router, plus createReceiptMiddleware for Express / Node http — auto-parses x402 v2 PAYMENT-SIGNATURE / PAYMENT-RESPONSE headers, hashes JSON via jcs-sha256 or binary/text via raw-sha256, and emits Payment-Receipt + X-Paxiom-Receipt):
import { withPaxiomReceipt } from '@paxiom/receipts';
export default withPaxiomReceipt(paidHandler, {
privateKey: process.env.PAXIOM_PRIVATE_KEY_PEM,
issuer: { name: 'acme-data', uri: 'https://api.acme.dev', keyId: 'seller-01' },
serviceName: 'Orderbook Snapshot API'
});
Buyer client helpers, key discovery, TypeScript & MCP server (built-in .d.ts declarations, zero dependencies):
import { discoverIssuerKeys, preflightX402, verifyResponseReceipt, verifyReceiptLive } from '@paxiom/receipts';
// 1. Free pre-payment seller safety & key-discovery scan:
const scan = await preflightX402('https://seller.example/v1/infer', { maxBudgetAtomic: '50000' });
// 2. Discover seller keys from /.well-known/x402-keys.json & verify offline (never throws):
const keys = await discoverIssuerKeys('https://seller.example');
const check = verifyResponseReceipt(paidResponse, {
output: responseJson,
expectedIssuerPublicKeys: keys.publicKeys,
expectedPayTo: '0xSeller...'
});
// 3. Free live Base USDC settlement + Ed25519 counter-attestation:
const live = await verifyReceiptLive(check.receipt, { output: responseJson, expectedPayTo: '0xSeller...' });
# Launch local stdio MCP (includes preflight_x402_seller & verify_receipt_live) or remote HTTP MCP:
npx --yes --package=@paxiom/receipts paxiom-receipt-mcp
claude mcp add --transport http paxiom https://api.paxiom.org/mcp
Python 3.10+ reference SDK & FastAPI middleware (paxiom-receipts on PyPI, zero required dependencies):
pip install paxiom-receipts
from fastapi import FastAPI
from paxiom_receipts import PaxiomReceiptMiddleware, discover_issuer_keys, preflight_x402, verify_response_receipt
app = FastAPI()
app.add_middleware(PaxiomReceiptMiddleware, private_key=PEM, issuer={'name': 'py-api', 'keyId': 'k1'})
You can also self-host the identical MIT server with your own verifier keys via node runtime/receipt-verifier/server.mjs.
| Method | Path | Access | Purpose |
|---|---|---|---|
| GET | / | Free | Machine-readable service discovery index (SDKs, manifests, OpenAPI, MCP, active routes). |
| GET | /openapi.json | Free | OpenAPI 3.1 specification served directly from api.paxiom.org for agent toolkits. |
| GET | /.well-known/mcp.json | Free | MCP Server Card advertising POST /mcp and tool metadata. |
| GET | /stats | Free | Zero-PII aggregate discovery, offline verification, and live reference counters. |
| GET | /health | Free | Liveness check ({ ok: true }). |
| GET | /version | Free | Service identity, active capabilities, rateLimits, and explicit checks / notChecked boundaries. |
| GET | /v1/receipt/demo | Free | Returns a signed demo receipt and its delivered output payload. |
| POST | /v1/receipt/verify | Free | Offline verification. Body { receipt, output?, expectedIssuerPublicKeys?, expectedPayTo? } → 16-state verdict + per-check breakdown. |
| POST | /v1/receipt/verify-live | Free (60/min) | Confirms Base / Base Sepolia USDC Transfer logs via multi-RPC failover, upgrades verdict to verified, and returns a counter-signed Payment-Receipt (plus X-Paxiom-Receipt). |
| POST | /v1/x402/preflight | Free (30/min) | SSRF-hardened pre-payment seller scan. Body { url, method?, maxBudgetAtomic?, expectedNetwork? } → checks canonical Base USDC asset, EIP-712 domain, payTo manifest match, /.well-known/x402-keys.json, and Payment-Receipt support. |
| POST | /mcp | Free | Stateless MCP Streamable-HTTP server (io.github.k-luecke/paxiom-receipts) exposing verify_receipt, explain_receipt, and get_x402_verifier_info. |
| GET | /.well-known/x402-keys.json | Free | Vendor-neutral Ed25519 public key manifest for offline verification of counter-attestations (also mirrored at /.well-known/paxiom-keys.json). |
HTTP status codes: 200 for any completed verification or preflight verdict, 400 malformed JSON or disallowed SSRF target, 413 payload over 256 KiB, 429 per-IP burst rate limit exceeded (includes Retry-After), 404 unknown route.
API=https://api.paxiom.org # 1. Fetch the canonical demo receipt + output and verify it offline: curl -s "$API/v1/receipt/demo" > demo.json node -e 'const d=JSON.parse(require("fs").readFileSync("demo.json"));\ process.stdout.write(JSON.stringify({receipt:d.receipt,output:d.output}))' \ | curl -s -X POST "$API/v1/receipt/verify" \ -H 'content-type: application/json' --data @- # 2. Inspect published verifier Ed25519 keys & run a free preflight scan: curl -s "$API/.well-known/x402-keys.json" curl -s -X POST "$API/v1/x402/preflight" \ -H 'content-type: application/json' \ -d '{"url":"https://seller.example/paid"}'
POST /v1/receipt/verify is strictly offline: it makes zero RPC or facilitator calls and reports unverified tx hashes as settlement_claimed_not_checked.expectedIssuerPublicKeys (from the seller's HTTPS /.well-known/x402-keys.json) and expectedPayTo rejects unauthorized intermediary key substitution with unauthorized_issuer.POST /v1/receipt/verify-live verifies canonical Base Mainnet (eip155:8453) and Base Sepolia (eip155:84532) USDC Transfer event logs directly against JSON-RPC with automatic endpoint failover.checkedByVerifier: true / checkedByPaxiom: true) must be verified with trustedVerifierPublicKeys loaded from /.well-known/x402-keys.json so untrusted signers cannot forge settlement confirmation.api.paxiom.org runtime is provided free of charge under bounded per-IP rate limits; high-throughput gateways and facilitators can run runtime/receipt-verifier/server.mjs in-house under the MIT license.Payment-Receipt header & /.well-known/x402-keys.json drafthttps://api.paxiom.org/mcp)jcs-sha256 / raw-sha256 preimages