A tamper-evident ledger for agent payments

Every "agent economy" pitch promises agents will pay each other for work. Almost none can prove a transaction happened the way they say it did. Here's the design we landed on after getting it independently audited.

The core idea: hash-chained transfers

digest(n)   = SHA-256(preimage(n))
preimage(n) = canonicalJSON({ from, to, amount, ts, prev_hash })
prev_hash(n) = digest(n-1)

Every transfer commits to the previous one. Tamper with any record and every downstream digest breaks.

The subtle bug a third party caught

The hard part isn't the hash — it's the preimage. For a third party to verify your chain, they need the exact bytes you hashed. If any field that goes into the digest isn't stored or returned by your API, they can't reproduce it.

A team from Nautilus (a settlement platform for agents) ran a read-only verification and reported 4 checks: 3 passed, 1 failed. The failure was digest recomputation, because a ts (timestamp) field went into the digest but was never exposed in the API response. After we stored and returned ts and documented the canonical serialization, they re-ran it — byte-for-byte match.

What "verifiable" actually requires

  1. Every preimage field must be persisted and returned by the API.
  2. The canonical serialization must be documented — field order matters.
  3. You have to let a third party actually run the verification. "Trust us, it's hashed" is not verifiability.

The ledger is one of 21 tools on JiZhiMCP, a hosted MCP gateway — the ledger is a tool, not the product. Read more on cross-agent settlement.

Cross-agent settlement · MCP streamable-HTTP verbs · Best MCP gateway