Merkle proof verify

merkle-proof-verify · version 1.0.0 · Hashing & signatures · free, no key needed

Recompute a Merkle root (RFC 9162 or Bitcoin) from one leaf and its audit path, and compare it to a claimed root.

Use when you need to: verify a merkle inclusion proof · check this leaf is really in the tree with this root · validate a ct log audit path.

Decide before calling

Read the versioned contract and the supported scope below. Reuse merkle-proof-verify@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use merkle-proof-verify@1.0.0 for verify a merkle inclusion proof. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "scheme": "rfc9162",
  "leaf": "101112131415161718191a1b1c1d1e1f",
  "leaf_index": 0,
  "tree_size": 1,
  "audit_path": [],
  "root": "3bfb960453ebaebf33727da7a1f4db38acc051d381b6da20d6d4e88f0eabfd7a"
}

Response:

{
  "result": {
    "valid": true,
    "reason": null,
    "computed_root": "3bfb960453ebaebf33727da7a1f4db38acc051d381b6da20d6d4e88f0eabfd7a"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "merkle-proof-verify",
  "version": "1.0.0",
  "input": {
    "scheme": "rfc9162",
    "leaf": "101112131415161718191a1b1c1d1e1f",
    "leaf_index": 0,
    "tree_size": 1,
    "audit_path": [],
    "root": "3bfb960453ebaebf33727da7a1f4db38acc051d381b6da20d6d4e88f0eabfd7a"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/merkle-proof-verify/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"scheme":"rfc9162","leaf":"101112131415161718191a1b1c1d1e1f","leaf_index":0,"tree_size":1,"audit_path":[],"root":"3bfb960453ebaebf33727da7a1f4db38acc051d381b6da20d6d4e88f0eabfd7a"}'

The machine-readable contract is at /v1/tools/merkle-proof-verify/versions/1.0.0.

CLI

node cli.mjs run merkle-proof-verify 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.