verify-proof-is-pure-static

Status: IN

`verify_proof` is a `@staticmethod` with no side effects; it requires no tree instance, only the data and a `MerkleProof`, so it can run on a different machine than the one that built the tree.

Source: entries/2026/05/29/merkle-tree-merkle_tree-verify_proof.md

Example

@staticmethod
def verify_proof(leaf_hash, proof, root_hash):
    current = leaf_hash
    for sibling_hash, direction in proof:
        if direction == "left":
            current = sha256(sibling_hash + current)
        else:
            current = sha256(current + sibling_hash)
    return current == root_hash

JSON