ERC-8510: Inference Receipts

An agent that pays a model endpoint per call can prove it paid, since the payment settles on chain. It cannot prove what the payment bought, or check later that the endpoint’s account of a day matches the calls it made. This draft defines a signed receipt per paid call and a daily Merkle root over those receipts, published on chain.

Draft: erc-draft_inference_receipts.md. The pull request to ethereum/ERCs follows as soon as this thread exists, since the draft names it as its discussion.

Each receipt is a JSON object with a fixed member order: hashes of the request and the response, the model, the tokens counted, the price in an ERC-20 asset, the payer and the payment that settled it. The endpoint signs its keccak256 hash as an ERC-191 message. Request and response bodies never leave the endpoint; only their hashes are in the receipt.

The endpoint keeps each UTC day’s receipts in the order it signed them and serves them as a day list with a Merkle root over their hashes, built the way OpenZeppelin’s MerkleProof checks it. Once the day closes, it publishes one record with the date, the count and the root in a log on chain. A payer holding a receipt can show the endpoint counted the call that day, and a signed receipt the published root does not cover is evidence the endpoint left a call out. The cost is one transaction a day, whatever the volume.

Reference code comes with the draft, with no dependencies: canonical form, signature check, day roots, inclusion proofs, test vectors from a test key, and one real receipt whose hash matches the root published for its day.

The payment scheme is out of scope. The receipt names the payment by its nonce, so it works with x402’s exact and upto schemes and with EIP-3009 transfers.

Disclosure: I work on BrainChain, whose inference gateway issues these receipts for calls paid over x402 and publishes each closed day’s root on BrainChain.

Three questions for reviewers:

  1. The draft names the response header Inference-Receipt. Is a header the right carrier, or should the receipt travel in the response body?
  2. Readers decide which publisher accounts they accept for a day record. Should the standard require endpoints to declare that account, for example in their ERC-8004 registration?
  3. The day record is a generic log event. Would a small registry contract with a typed event serve readers better?

Reviewed the draft and the reference code in assets/erc-8510/ (PR #2194, commit 337cd00).

Two things worth naming before anyone relies on this:

  1. The reference implementation only covers the off-chain pieces: canonical form, receipt hash, signature check, day roots, inclusion proofs, and building the day-record JSON. There is no code anywhere in the PR’s assets that reads an Inscribed log, picks “the first record by block and log index” for a signer/day, or handles a second (non-compliant) record showing up. That’s exactly the mechanism the Security Considerations section leans on for “a second record does not replace it” — but it ships with zero reference code and zero test vectors. Every implementer has to write that log-scanning/first-wins logic themselves, with nothing to check it against.

  2. I tried to verify the one concrete deployment claim in vectors.json (public.note): “the reference deployment’s day list for 2026-11-19 … record is in block 3719 of chain 274663, sent by 0x70C6…58eC through an Inscribed event.” Robinhood Chain’s real chain id is 4663, not 274663. Block 3719 on chain 4663 is from 2026-05-18 (per Blockscout), six months before the claimed day. And 0x70C6…58eC’s actual on-chain activity around 2026-11-19 is a string of distribute/claimFor/passAndPair calls to two unrelated contracts — nothing that looks like publishing a receipts day record. Could be a typo in the note (chain id, block number) rather than anything deeper, but as shipped, the one example a reader could check against the live chain doesn’t check out.

Neither of these touches the cryptography (hash/signature/Merkle code all checks out against the vectors). Happy to be wrong on either point — pointers welcome.

Quick follow-up now that the two new commits are in:

The record-selection logic is much clearer now — day lists carrying network/contract/publishers, and the rule to ignore malformed logs and take the earliest by block+log index. That closes the ambiguity flagged above. The reference implementation now validates record well-formedness (recordProblem, recordListProblem), though reading the log itself is still left to the verifier’s own RPC client rather than the reference code.

The deployment data in the README’s new “Deployments” section is unchanged from what I checked before: chain 274663 doesn’t resolve (Robinhood Chain’s real id is 4663), and block 3719 on the real chain is timestamped 2026-05-18, about six months before the claimed day of 2026-11-19. Happy to be corrected if I’m misreading which chain/block this refers to.

@it44 both points were right, and both are addressed in 0fc50c9.

The chain: the records are on BrainChain, chain id 274663, an L3 that settles on Robinhood Chain (4663). Payments settle on Robinhood Chain and records sit on the L3, so block 3719 is an L3 block. The README’s Deployments section and the vector note now say so and give the public RPC. To check the record directly:

cast logs --from-block 3719 --to-block 3719 --address 0x770D6756CA8a1627FFf01B846383b13d6fa0c514 --rpc-url https://rpc.usebrainchain.com

The reader: the reference code now has find-record. It checks eth_chainId against the list’s records.network, finds the first block after the day closed, scans Inscribed logs from the stated publishers, skips anything that is not a well-formed record for that signer and day, and takes the first by block and log index. The vectors cover a log before the close, one from a non-publisher, a wrong kind, a malformed record and a later second record. Run against the live 19 November list, it finds block 3719, log 0, and the root matches.

How would the Inference-Receipt header work for streaming responses? The response hash and final token count are only known after generation ends but HTTP headers have already been sent. Would the client retrieve the receipt separately using the payment identifier? What happens if the stream disconnects before the client receives it?