Skip to main content

GET /api/v1/anchors//verify

Recomputes the Merkle root from the underlying events and checks that it matches the stored anchor. Also validates the anchor chain by verifying previous_anchor_hash references the preceding anchor correctly.

Path Parameters

id
string
required
The anchor identifier (e.g., anc_abc123).

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

anchor_id
string
The anchor identifier.
merkle_root
string
The 64-character hex Merkle root stored in this anchor record.
valid
boolean
true if the Merkle root recomputed from the underlying events matches the stored merkle_root. false if the events have been modified, inserted, or deleted since the anchor was created.
chain_valid
boolean
true if the previous_anchor_hash correctly equals SHA-256(previous_merkle_root + previous_tx_hash). false if the anchor chain has been tampered with. Always true for the first anchor in a workspace.
expected
string
The Merkle root recomputed from the current event data. If valid is true, this matches actual.
actual
string
The Merkle root stored in the anchor record at creation time. If valid is true, this matches expected.
events_count
integer
The number of events included in this anchor’s Merkle tree.
tx_hash
string
The blockchain transaction hash. Null if the anchor is not yet confirmed on-chain.
explorer_url
string
Direct link to the transaction on Basescan. Null if not yet confirmed.

Examples

curl https://getimmutable.dev/api/v1/anchors/anc_abc123/verify \
  -H "Authorization: Bearer imk_your_api_key_here"

Interpreting Results

validchain_validMeaning
truetrueEverything is intact. Merkle root matches events, anchor chain is correct.
falsetrueEvents were modified after this anchor was created. The anchor chain is fine, but the underlying data changed.
truefalseEvents are intact, but a preceding anchor was modified or deleted.
falsefalseBoth the events and the anchor chain have been tampered with.
Anchors with status: "pending" or status: "submitted" will have null tx_hash and explorer_url. The valid and chain_valid checks still run against the stored Merkle root and anchor chain, but on-chain cross-verification is not possible until the anchor reaches confirmed status.
After verifying via the API, cross-check the tx_hash on Basescan for fully independent verification. See Verify On-Chain for a step-by-step guide.