Skip to main content

On-Chain Verification Guide

Step-by-step instructions for anchoring Merkle roots, publishing reputation scores, and verifying agent trust on Base L2. This guide covers the full on-chain verification workflow using the Mnemom API. For the conceptual overview of how on-chain verification works, see On-Chain Verification.

Prerequisites

Before using on-chain verification features, ensure you have:
  1. A Mnemom API key — Create one in your dashboard under Settings or via POST /v1/api-keys
  2. Agents with computed reputation scores — Agents must have at least 50 analyzed integrity checkpoints and a published Mnemom Trust Rating
API key authentication: Pass your key in the Authorization header:
Authorization: Bearer {api_key}

Anchoring Merkle Roots

Anchor a Merkle root from your agent’s integrity checkpoint tree to the MnemoMerkleAnchor contract on Base L2. This creates an immutable, tamper-evident reference point for the underlying checkpoint data. Endpoint: POST /v1/on-chain/anchor-root Request body:
{
  "merkle_root": "0xabc123def456789012345678901234567890123456789012345678901234abcd",
  "leaf_count": 347,
  "tree_depth": 9
}
FieldTypeRequiredDescription
merkle_rootstringYesThe Merkle root hash to anchor (hex-encoded, 32 bytes)
leaf_countnumberYesNumber of leaves (checkpoints) in the Merkle tree
tree_depthnumberYesDepth of the Merkle tree
curl -X POST https://api.mnemom.ai/v1/on-chain/anchor-root \
  -H "Authorization: Bearer $MNEMOM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "merkle_root": "0xabc123def456789012345678901234567890123456789012345678901234abcd",
    "leaf_count": 347,
    "tree_depth": 9
  }'
Response: 200 OK
{
  "anchor_id": "anc-7f8a9b2c",
  "merkle_root": "0xabc123def456789012345678901234567890123456789012345678901234abcd",
  "tx_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "block_number": 18234567,
  "gas_used": 48732,
  "chain": "base",
  "anchored_at": "2026-02-26T10:30:00.000Z"
}

Publishing Scores

Publish one or more agent reputation scores to the MnemoReputationRegistry contract on Base L2. Published scores become immutably queryable by any contract or external observer. Endpoint: POST /v1/on-chain/publish-scores Request body:
{
  "publications": [
    {
      "agent_id": "smolt-a4c12709",
      "score": 782,
      "grade": "A"
    },
    {
      "agent_id": "smolt-b8e34f21",
      "score": 650,
      "grade": "BBB"
    }
  ]
}
FieldTypeRequiredDescription
publicationsarrayYesArray of score publications (max 200)
publications[].agent_idstringYesAgent identifier
publications[].scorenumberYesComposite reputation score (0-1000)
publications[].gradestringYesLetter grade (AAA, AA, A, BBB, BB, B, CCC)
curl -X POST https://api.mnemom.ai/v1/on-chain/publish-scores \
  -H "Authorization: Bearer $MNEMOM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "publications": [
      {"agent_id": "smolt-a4c12709", "score": 782, "grade": "A"},
      {"agent_id": "smolt-b8e34f21", "score": 650, "grade": "BBB"}
    ]
  }'
Response: 200 OK
{
  "publication_id": "pub-3e4f5a6b",
  "tx_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
  "block_number": 18234589,
  "gas_used": 142350,
  "agent_count": 2,
  "published_at": "2026-02-26T10:35:00.000Z"
}

Verifying Scores

Verify an agent’s on-chain reputation score and retrieve the cryptographic proof linking the on-chain record to the underlying integrity data. Endpoint: GET /v1/on-chain/verify-proof/{agent_id}
curl https://api.mnemom.ai/v1/on-chain/verify-proof/smolt-a4c12709 \
  -H "Authorization: Bearer $MNEMOM_API_KEY"
Response: 200 OK
{
  "agent_id": "smolt-a4c12709",
  "on_chain_score": 782,
  "grade": "A",
  "metadata_hash": "0x9876543210fedcba9876543210fedcba9876543210fedcba9876543210fedcba",
  "published_at": "2026-02-26T10:35:00.000Z",
  "block_number": 18234589,
  "tx_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
  "verified": true
}

Checking On-Chain Status

Check whether an agent has an on-chain score and view the current on-chain state. Endpoint: GET /v1/on-chain/status/{agent_id}
curl https://api.mnemom.ai/v1/on-chain/status/smolt-a4c12709 \
  -H "Authorization: Bearer $MNEMOM_API_KEY"
Response: 200 OK
{
  "agent_id": "smolt-a4c12709",
  "has_on_chain_score": true,
  "latest_score": {
    "score": 782,
    "grade": "A",
    "block_number": 18234589,
    "published_at": "2026-02-26T10:35:00.000Z"
  },
  "latest_anchor": {
    "merkle_root": "0xabc123def456789012345678901234567890123456789012345678901234abcd",
    "block_number": 18234567,
    "anchored_at": "2026-02-26T10:30:00.000Z"
  },
  "last_updated": "2026-02-26T10:35:00.000Z"
}

Viewing History

Retrieve the history of on-chain anchoring and score publishing events. Endpoint: GET /v1/on-chain/history Query parameters:
ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1)
per_pagenumberNoResults per page (default: 20, max: 100)
curl "https://api.mnemom.ai/v1/on-chain/history?page=1&per_page=10" \
  -H "Authorization: Bearer $MNEMOM_API_KEY"
Response: 200 OK
{
  "anchors": [
    {
      "anchor_id": "anc-7f8a9b2c",
      "merkle_root": "0xabc123def456789012345678901234567890123456789012345678901234abcd",
      "leaf_count": 347,
      "tree_depth": 9,
      "tx_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
      "block_number": 18234567,
      "anchored_at": "2026-02-26T10:30:00.000Z"
    }
  ],
  "publications": [
    {
      "publication_id": "pub-3e4f5a6b",
      "agent_count": 2,
      "tx_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
      "block_number": 18234589,
      "published_at": "2026-02-26T10:35:00.000Z"
    }
  ],
  "page": 1,
  "per_page": 10,
  "total_anchors": 42,
  "total_publications": 18
}

Contract Addresses

ContractBase Sepolia (Testnet)Base (Mainnet)
MnemoReputationRegistry0x1234...abcd0x5678...efgh
MnemoMerkleAnchor0x9abc...def00x1357...2468
View contract source and transactions on Basescan:
Use Base Sepolia (testnet) for development and testing. Testnet contracts use test ETH with no real value. Switch to Base mainnet only for production deployments.

Cost Estimates

OperationApproximate GasApproximate USD (Base L2)
Anchor single Merkle root~50,0000.010.01 - 0.02
Publish single score~80,0000.020.02 - 0.03
Batch publish (50 agents)~200,0000.030.03 - 0.05
Batch publish (200 agents)~600,0000.080.08 - 0.15
Verify score (view call)0Free
Check anchor status (view call)0Free
All write operations are submitted by Mnemom’s relayer and the gas cost is included in your API plan. You do not need to hold ETH on Base to use the on-chain verification API.

See Also