Agent expense reports
Match billed calls to the responses your gateway received. Seal one batch and share a proof for a single call. The ledger records and response fingerprints stay on your device.
Reconcile a batch
Reconciliation
Billed total ·
| Call | Delivery | Settlement evidence | Disclosure |
|---|
Batch root
Save the report to retain its private salts and proofs. Rebuilding creates a fresh commitment.
Verify one call
Use the root from an independently obtained receipt. The receipt’s Bitcoin attestation can be checked separately with the verifier.
Integrate a gateway
Use Node 22+ and the same expense-report.js module used on this page. From a repository checkout:
node tools/expense-report.cjs build input.json > report.json node tools/expense-report.cjs verify call-proof.json RECEIPT_ROOT node tools/expense-report.cjs mcp-file report.json local-root.bin
For MCP, pass the new local file to orphograph_anchor_file. Its SHA-256 is exactly the saved batch root. Keep both files locally and compare the returned digest to the report. A paid-capable MCP client can sign Base USDC under its wallet cap. An XRPL RLUSD buyer uses a compatible external client with the same root. Read the advertised agent prices before requesting a binding quote.
Record each charge with a unique call id, network, asset, decimal-string amount and payTo. Use the units of the asset and keep its issuer when applicable. In a separate outputs list, record each received call ID and sha256 of the original response bytes. A downstream report’s digest can be supplied as reportHash. Call await hash(responseBytes) using the module before decoding or rewriting the response.
Attach optional SHA-256 fingerprints in mandateHash, offerHash, receiptHash and expectedOutput. Keep the original signed AP2 mandates, x402 offers and receipts, responses and verification keys privately. Verify their signatures with the issuing protocol. Matching fingerprints alone do not establish authority or authorship.
For a direct XRPL mainnet RLUSD payment, supply the charge’s issuer, transaction and quoted invoiceId. Import the XRPL tx lookup result from your trusted ledger source as ledger: [{id, result}]. The comparison checks the supplied validation flag, result, invoice, transaction hash, destination, currency, issuer and delivered value. A shared transaction needs allocation review. Base and other networks can be recorded with externally verified evidence.
If payment or delivery is uncertain, retain the evidence and reconcile before authorizing another charge. A missing response alone gives no authority to pay twice.
To buy one anchor for the batch, send only {"hash_hex":"<root>"} to POST /api/anchor/paid with your x402 client. Inspect the live quote for Base USDC or XRPL RLUSD and apply your wallet’s spending policy. Agent payment documentation.
Long-term verification
Version 1 uses SHA-256 and salted, path-bound Merkle leaves. Keep the original bytes, private report, payment evidence, receipt and timestamp proofs in independent storage. If a hash or signature scheme weakens, verify the old evidence while it is still trustworthy and timestamp a new commitment that includes the old proof. Preserve both versions. A new timestamp cannot establish an earlier date for evidence that was already compromised.
P versus NP remains open. Even a proof of P ≠ NP would leave the practical security of individual hashes and signatures to their own analysis.