On-Chain

Verify on-chain proof

Verify an agent's Merkle commitment. The agent's stored root is recomputed from its stored leaf hashes, the stored leaf_count is checked against the actual number of leaves, and — when leaf_index is supplied — a real inclusion proof for that leaf is generated and verified against the recomputed root and returned so the caller can re-derive it independently. The confirming anchor is then looked up by the recomputed root, so an anchor row can never vouch for a root nobody can rebuild.

Scope limit, stated rather than hidden: the anchored root is read from Mnemom's own anchor record, not from a Base RPC call. A verified: true therefore means "this tree is internally consistent and matches the root we recorded as anchored" — it does not by itself prove the chain agrees. verification.anchored_root_source reports this.

get/on-chain/verify-proof/{agent_id}

Request

  • Base URL: https://api.mnemom.ai/v1
  • URL: https://api.mnemom.ai/v1/on-chain/verify-proof/{agent_id}
  • Auth: none required

Path parameters

agent_idstring required

Agent identifier (e.g. smolt-abc123)

Query parameters

leaf_indexinteger

Optional. Zero-based index of a single leaf to prove inclusion for. When supplied, the response carries an inclusion_proof (leaf hash + sibling path) that has been verified against the recomputed root; the caller can replay it without trusting this endpoint. When omitted, only the root recomputation and leaf-count checks are performed.

Response

Proof verification result. verified: true requires ALL of: the root recomputes from the stored leaf hashes, leaf_count agrees with the leaf array, any requested inclusion proof verifies, and a confirmed anchor exists for the recomputed root. Any failed step returns verified: false with a reason — never a bare true. (handleVerifyProof in src/on-chain/handlers.ts.)

verifiedboolean required

True only when the agent's root was successfully recomputed from its stored leaves AND a confirmed on-chain anchor exists for that recomputed root (and, if leaf_index was supplied, its inclusion proof verified).

agent_idstring required
reason'no_merkle_tree' | 'no_checkpoint' | 'no_leaf_hashes' | 'root_mismatch' | 'leaf_count_mismatch' | 'leaf_index_out_of_range' | 'inclusion_proof_failed' | 'not_anchored'

Present only when verified is false. no_merkle_tree: the agent has no merkle tree row; no_checkpoint: the tree has no merkle_root yet; no_leaf_hashes: a root is stored but no leaves are, so it cannot be rebuilt; root_mismatch: the root recomputed from the stored leaves does not equal the stored root (tampering or corruption); leaf_count_mismatch: the stored leaf_count disagrees with the number of stored leaves (silent truncation); leaf_index_out_of_range: the requested leaf_index exceeds the tree; inclusion_proof_failed: the proof for the requested leaf does not reconstruct the root; not_anchored: the tree verifies but has no confirmed anchor.

merkle_rootstring

The agent's stored Merkle root. Present when a checkpoint exists (i.e. absent for the no_merkle_tree/no_checkpoint cases).

recomputed_rootstring

The root recomputed from the stored leaf hashes. Returned only on root_mismatch, so the discrepancy is inspectable.

leaf_countinteger

Leaf count, included on the leaf_count_mismatch and leaf_index_out_of_range failures for diagnosis.

leaf_hashes_lengthinteger

Actual number of stored leaf hashes. Returned only on leaf_count_mismatch.

Changes

No recorded changes to this operation across all 1 revision of this API.