Cryptography
Merkle Tree
Also known as: Merkle root, hash tree
A binary tree of cryptographic hashes that lets a single root commit to an arbitrarily large set of items while keeping per-item proofs small.
A Merkle tree is a tree in which every leaf is the hash of a data item and every internal node is the hash of the concatenation of its two children. The root hash commits to every item in the tree: change any item and the root changes. Given the root, you can prove that a specific item is in the tree by supplying a proof path — the siblings along the way from the leaf to the root.
This is powerful because batch commitment scales logarithmically. A batch of 10,000 credentials produces one 32-byte root on-chain; each credential's individual proof path is only about 13 hashes (log₂ 10,000 ≈ 13.3) regardless of batch size. Per-credential anchoring cost at scale is effectively zero.
LearnCoin uses a minimal ordered Merkle tree compatible with the @blockcerts/lds-merkle-proof-2019 library: sha256 leaves, sha256 parent-of-concat (no sorting), odd levels self-pair the last node. The root is written to Base as part of a single transaction per batch.
Related terms