Skip to main content

Overview

Anchor verification confirms two things:
  1. Anchor integrity (valid) — the Merkle root stored in the anchor matches the Merkle root recomputed from the underlying events.
  2. Anchor chain integrity (chain_valid) — the previous_anchor_hash correctly references the preceding anchor.
If either check fails, your audit trail may have been tampered with between event ingestion and blockchain submission.

List Anchors

Retrieve your workspace’s blockchain anchors:
curl https://getimmutable.dev/api/v1/anchors?limit=10 \
  -H "Authorization: Bearer imk_your_api_key_here"

Get Anchor Detail

Retrieve a single anchor with additional fields (first_event_hash, last_event_hash):
curl https://getimmutable.dev/api/v1/anchors/anc_abc123 \
  -H "Authorization: Bearer imk_your_api_key_here"

Verify an Anchor

The verify endpoint recomputes the Merkle root from the underlying events and checks the anchor chain:
curl https://getimmutable.dev/api/v1/anchors/anc_abc123/verify \
  -H "Authorization: Bearer imk_your_api_key_here"

Verify Response

{
  "data": {
    "anchor_id": "anc_abc123",
    "merkle_root": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
    "valid": true,
    "chain_valid": true,
    "expected": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
    "actual": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
    "events_count": 1247,
    "tx_hash": "0x7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b",
    "explorer_url": "https://basescan.org/tx/0x7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b"
  }
}

Response Fields

FieldTypeDescription
anchor_idstringThe anchor identifier
merkle_rootstringThe 64-character hex Merkle root stored in this anchor
validbooleanWhether the recomputed Merkle root matches the stored one
chain_validbooleanWhether the previous_anchor_hash correctly references the preceding anchor
expectedstringThe Merkle root recomputed from the underlying events
actualstringThe Merkle root stored in the anchor record
events_countintegerNumber of events included in this anchor’s Merkle tree
tx_hashstringThe blockchain transaction hash (null if not yet confirmed)
explorer_urlstringDirect link to the transaction on Basescan

Understanding Failures

valid: false

The Merkle root recomputed from the underlying events does not match the stored Merkle root. This means events were modified, inserted, or deleted after the anchor was created. The expected and actual fields show the mismatch.

chain_valid: false

The previous_anchor_hash does not match the expected value computed from the preceding anchor’s merkle_root and tx_hash. This means an anchor was modified, inserted into, or deleted from the anchor chain.

Verify All Anchors

To verify every anchor in your workspace:
const anchors = await client.getAnchors(100);

for (const anchor of anchors.data) {
  const result = await client.verifyAnchor(anchor.id);

  if (!result.data.valid || !result.data.chain_valid) {
    console.error(`Anchor ${anchor.id} failed verification`, {
      valid: result.data.valid,
      chain_valid: result.data.chain_valid,
      period: `${anchor.period_start}${anchor.period_end}`,
    });
  }
}
After verifying via the API, cross-check confirmed anchors on Basescan for fully independent verification. See Verify On-Chain.