The Merkle Mountain Range
A Merkle Mountain Range (MMR) is an append-only hash structure, and it is the data structure underneath Skyhook’s chain finality. Zcash block headers are its leaves. They are folded from left to right into a series of perfect binary subtrees, called peaks, and the peaks are “bagged” into a single root that summarizes the whole range. Adding a header changes only the peaks on the right edge, so recorded history never moves, and a proof about any header needs only a handful of hashes however long the chain becomes.
Structure
As headers arrive they are added as leaves on the right. Whenever two subtrees of equal size sit next to each other, they merge into one subtree twice as large. The result is a row of peaks whose sizes are the binary decomposition of the leaf count: 11 headers, for example, form peaks of 8, 2 and 1 leaves. Bagging folds the peaks into one root.
This layout fits a blockchain closely. Headers arrive in order indefinitely, and past entries must stay fixed. Unlike a fixed-size Merkle tree, an MMR needs no capacity chosen in advance and never has to be rebuilt as it grows.
Proofs
A proof that a particular header is in the range consists of the sibling hashes along its path inside its own peak, plus the other peaks. Verification therefore never touches the rest of the chain. In a fixed tree, by contrast, every proof would carry the shape of the whole tree. Short proofs are what keep on-chain verification affordable.
The MMR applies at chain scale the same principle as a transaction inclusion proof, described in How It Works: peaks play the role of branch hashes taken as given, and the bagged root is the root the verifier recomputes. Transaction proofs work inside a single block, while MMR proofs work across the chain’s history.
Hashing and determinism
Each internal node is a single BLAKE2b compression of its two children, with no double hashing or extra rounds. The construction needs only collision resistance, and one compression provides it.
The positions of nodes, the set of peaks and the bagging order all follow from the number of leaves alone. A prover and a verifier therefore always agree on the structure and can differ only on contents. Since contents are hashes, any disagreement is detected mechanically rather than argued about.
Consensus compatibility
To agree with the real Zcash chain, the MMR has to handle the seams defined by ZIP 221, the quirks in how history commitments treat coinbase construction and epoch boundaries.1 A naive implementation would silently diverge from consensus at exactly those points while appearing to work. Each seam case is pinned by a dedicated test that compares the constructed roots with values computed independently from the chain, so a regression fails at build time rather than at claim time.