Why on-chain?
The Mnemom Trust Rating is computed and stored on centralized infrastructure. While the scoring methodology is transparent and cryptographically verifiable via Merkle proofs, the data ultimately lives on Mnemom servers. On-chain verification adds a decentralized trust anchor that eliminates single-point-of-failure concerns:- Immutable — Once a reputation score or Merkle root is published to the blockchain, it cannot be altered or deleted by anyone, including Mnemom
- Tamper-evident — Any discrepancy between on-chain and off-chain data is immediately detectable by any observer
- Independently verifiable — Anyone with an Ethereum-compatible client can verify scores without relying on Mnemom’s API or infrastructure
- Composable — On-chain scores can be consumed by other smart contracts, decentralized applications (dApps), and protocols directly, enabling trust-gated interactions in DeFi, DAOs, and agent marketplaces
ERC-8004 reputation registry
Mnemom’s on-chain verification is built on ERC-8004, a standard for on-chain reputation registries. ERC-8004 defines a common interface for publishing, querying, and verifying reputation scores on EVM-compatible (Ethereum Virtual Machine) chains, enabling any contract or dApp to:- Query an agent’s current reputation score and grade
- Retrieve historical score records
- Verify Merkle root anchors for tamper-evidence
- Gate interactions based on minimum reputation thresholds
Base L2 rationale
Mnemom deploys its reputation contracts on Base, Coinbase’s Layer 2 network built on the OP Stack. The choice of Base is driven by:
Base’s low transaction costs are critical for the anchoring model. Publishing reputation scores for hundreds of agents would cost thousands of dollars per batch on Ethereum L1 but only a few dollars on Base.
Smart contracts overview
MnemoReputationRegistry
The primary contract for publishing and querying individual agent reputation scores. Constants:
Key Functions:
ScoreRecord Struct:
MnemoMerkleAnchor
The anchoring contract for publishing Merkle tree roots from the off-chain integrity checkpoint system. Key Functions:
AnchorRecord Struct:
Merkle root anchoring flow
Mnemom anchors Merkle roots on-chain as tamper-evidence checkpoints for the off-chain integrity system. The anchoring flow works as follows:isRootAnchored(root) with a Merkle root obtained from the off-chain API to confirm it has been anchored on-chain. If the root exists on-chain, the underlying checkpoint data has not been tampered with since anchoring.
Inclusion proofs: Individual checkpoints can be verified for inclusion in an anchored root using standard Merkle inclusion proofs. The off-chain API provides the proof path, and the on-chain root serves as the trusted reference.
Score publishing and verification
Publishing
Reputation scores are published toMnemoReputationRegistry either individually or in batches:
Agent ID encoding: Human-readable agent IDs (e.g., mnm-550e8400-e29b-41d4-a716-446655440000) are converted to bytes32 via keccak256(abi.encodePacked(agentId)) before on-chain storage. This provides a fixed-size identifier suitable for mapping keys.
Grade encoding: Letter grades are stored as bytes3 ASCII values. For example, "A" becomes 0x410000, "AA" becomes 0x414100, and "BBB" becomes 0x424242.
Batch publishing: When multiple scores are published in a single transaction via publishBatch(), a batch Merkle root is computed from the individual score records and stored alongside the batch. This enables efficient verification that a specific score was included in a particular batch without replaying the entire batch.
Verification
Anyone can verify an agent’s on-chain reputation:- Query the score — Call
getScore(agentId)on theMnemoReputationRegistrycontract to retrieve the latest on-chainScoreRecord - Compare with off-chain — Fetch the same agent’s score from the Mnemom API (
GET /v1/reputation/{agent_id}) and compare. Matching scores confirm consistency - Verify the anchor — Call
isRootAnchored(root)onMnemoMerkleAnchorwith the Merkle root from the off-chain verification endpoint to confirm the underlying data is tamper-evident - Check history — Call
getScoreHistory(agentId)to see how the on-chain score has evolved over time
Cost estimates
On-chain operations consume gas, but Base L2’s low fees make frequent anchoring and publishing economical:Gas costs fluctuate with Base L2 network activity and Ethereum L1 blob fees. The estimates above reflect typical conditions. Read operations (view calls) are always free.
See also
- On-Chain Verification Guide — Step-by-step guide for anchoring, publishing, and verifying
- On-Chain API Reference — Full API reference for on-chain endpoints
- Mnemom Trust Rating — How reputation scores are computed
- Cryptographic Verification — Off-chain proof chain structure
- Integrity Checkpoints — The data source for Merkle trees