Skip to main content

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
On-chain verification does not replace the off-chain scoring system. It complements it by anchoring the most critical data points — Merkle roots and reputation scores — to an immutable ledger that survives even if Mnemom’s infrastructure is unavailable.

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
By building on a standard rather than a proprietary interface, Mnemom enables interoperability with other reputation systems, agent marketplaces, and smart contracts that adopt ERC-8004.

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:
Events:

MnemoMerkleAnchor

The anchoring contract for publishing Merkle tree roots from the off-chain integrity checkpoint system. Key Functions: AnchorRecord Struct:
Events:

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:
Anchoring cadence: Global Merkle roots are anchored periodically (typically every few hours) to Base L2. The frequency balances cost efficiency against freshness — more frequent anchoring provides tighter tamper-evidence windows but costs more gas. Verification: Anyone can call 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 to MnemoReputationRegistry 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:
  1. Query the score — Call getScore(agentId) on the MnemoReputationRegistry contract to retrieve the latest on-chain ScoreRecord
  2. 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
  3. Verify the anchor — Call isRootAnchored(root) on MnemoMerkleAnchor with the Merkle root from the off-chain verification endpoint to confirm the underlying data is tamper-evident
  4. 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.
For comparison, the same batch publish of 50 agents on Ethereum L1 would cost approximately $5-15 depending on gas prices — 100-300x more expensive than Base L2.

See also