Merkle Mountain Range (MMR)
An append-only hash structure that proves inclusion as a dataset keeps growing.
Basically
A Merkle Mountain Range stores a growing list that you can only add to. It lets you prove an item is in the list without rebuilding the whole structure.
Key Takeaways
- A Merkle Mountain Range (MMR) is an append-only variant of a Merkle tree. It contains multiple perfect binary trees arranged by decreasing height, forming a silhouette like a mountain range.
- Standard Merkle trees must be rebuilt when new data arrives. MMRs grow incrementally with amortised O(log n) append cost and O(log n) inclusion proofs, without changing existing nodes.
- MMRs support blockchain systems with growing datasets. These include Bitcoin's Utreexo accumulator for compact UTXO set representation, Grin's MimbleWimble transaction kernel storage, and FlyClient's ultra-light client protocol.
What Is a Merkle Mountain Range?
A Merkle Mountain Range (MMR) is a hash-based data structure for committing efficiently to a growing, potentially unbounded list of elements. A standard Merkle tree builds one balanced binary tree over a fixed dataset, while an MMR maintains a collection of perfect binary trees of decreasing size. Each tree is a "peak", and peaks at different heights create the characteristic mountain range profile.
Peter Todd introduced MMRs around 2012 to reduce the hardware costs of running Bitcoin full nodes and validating growing datasets. His original application was OpenTimestamps, which needed to absorb new data continuously and produce compact proofs without rebuilding from scratch. Todd later discussed MMR commitments on the bitcoin-dev mailing list in 2016, prompting debate with Bram Cohen about MMRs and alternative Merkle constructions.
MMRs rely on the fact that any positive integer can be expressed as a sum of distinct powers of two. An MMR with n leaves splits into perfect binary trees whose sizes match the set bits in the binary representation of n. For example, 13 leaves (binary 1101) produce three peaks: trees of 8, 4, and 1 leaf respectively.
How It Works
MMRs grow by appending elements strictly from left to right. A new leaf merges with an adjacent tree of the same height where possible, creating a parent node and potentially triggering a cascade of merges up to the largest possible tree. The process mirrors binary addition, where two bits summing to 2 carry a 1.
Appending Elements
You can build an MMR by appending leaves L0 through L6. Each leaf is added from left to right.
The MMR is a single perfect binary tree with one peak after 4 leaves. Three peaks exist after 7 leaves because 7 in binary (111) has three set bits. An 8th leaf would merge all peaks into a single tree of height 3.
Node Storage
Nodes sit in a flat array using post-order traversal indexing. You can compute every node's height directly from its position with binary operations, so no explicit tree pointers or metadata are needed. Each node's hash includes its position to prevent domain confusion between leaf and internal nodes.
Position prefixing protects against a specific attack. Without it, an attacker could construct a leaf whose data matches the concatenation of two child hashes, creating a false internal node that passes verification.
Bagging the Peaks
An MMR can have multiple peaks, unlike a standard Merkle tree with a single root, so the peaks must form one commitment. "Bagging" combines them by hashing peaks iteratively from right to left and prepending the total MMR size.
The total size prevents ambiguity between MMRs of different sizes that might share peak hashes. The resulting single hash is the MMR root, a compact commitment to the entire dataset.
Inclusion Proofs
An MMR inclusion proof shows that a specific element exists in the structure. You need the leaf, its sibling path and the declared peaks to verify it.
A verifier reconstructs the peak hash from the leaf and its sibling path, confirms that it matches one of the declared peaks, then bags all peaks to check against the known root. A proof contains O(log n) hashes. It has at most log(n) sibling nodes plus at most log(n) peak hashes.
MMR vs. Standard Merkle Tree
Both structures provide O(log n) proofs. They suit different workloads.
Standard Merkle trees remain ideal for static commitments, such as the transaction tree within a single block. MMRs work best when data grows continuously and existing proofs should remain valid after new elements are appended.
Utreexo: Compact UTXO Set Accumulation
Bitcoin's UTXO set grows with every transaction that creates new outputs. As of 2026, the full set uses multiple gigabytes of storage, creating a barrier for resource-constrained nodes. Utreexo, proposed by Tadge Dryja at MIT's Digital Currency Initiative, uses a Merkle forest closely related to MMRs to compress this data into under 1 kilobyte of peak hashes.
A Utreexo node stores only the forest roots (peaks) rather than every unspent output, transaction senders attach inclusion proofs for the UTXOs they spend, and the node updates its peaks as outputs are created and consumed. Three draft BIPs for Utreexo were submitted in August 2025, moving the concept from research prototype towards standardisation. Utreexo extends the pure MMR model by supporting deletions for spent UTXOs, making it a dynamic accumulator rather than strictly append-only.
Grin and MimbleWimble
Grin was the first production blockchain to use MMRs extensively. The MimbleWimble protocol stores transaction kernels, outputs and range proofs in separate MMRs, and its append-only property combined with pruning is particularly efficient: spent outputs can be removed from the output MMR while the remaining structure stays valid without rebuilding. New nodes can validate the chain from a pruned MMR snapshot rather than replaying the entire transaction history.
FlyClient: Ultra-Light Clients
FlyClient is a light client protocol that uses MMRs to let clients verify an entire blockchain's proof-of-work history with logarithmic proof sizes. Block producers maintain an MMR over all past block headers and commit the MMR root in each new block. A light client can then sample blocks probabilistically and verify their inclusion using MMR proofs, rather than downloading every header.
Zcash adopted FlyClient in its Heartwood network upgrade, embedding MMR roots in block headers. Nervos Network implemented a similar scheme through its Extensible Block Header RFC. The approach has also been proposed for Ethereum Classic via ECIP-1055.
OpenTimestamps
Peter Todd's original motivation for MMRs was OpenTimestamps, where timestamp digests accumulate in growing trees. The MMR appends digests as they arrive, and a single commitment, the bagged root, proves the existence and ordering of all timestamps in the range. The append-only property guarantees that existing timestamps cannot be modified or removed after commitment.
Why It Matters
Blockchain datasets grow without bound as they mature: UTXO sets expand, block header chains lengthen and audit logs accumulate. Standard Merkle trees force a choice between padding to powers of two, which wastes space, rebuilding on every append, which wastes computation, or accepting imbalanced trees, which complicate proofs. MMRs remove this trade-off by supporting arbitrary growth with efficient appends, compact proofs and natural pruning.
A 2025 paper accepted at CRYPTO 2025 proved that MMRs are close to optimal for witness update frequency among cryptographic accumulators with succinct commitments. The theoretical result confirms what practitioners have observed: MMRs offer the best available balance of append efficiency, proof compactness and implementation simplicity for growing datasets.
MMRs are a foundational building block for systems like Utreexo that aim to make Bitcoin more accessible by reducing node storage requirements. They compress gigabytes of UTXO data into a handful of peak hashes, enabling lightweight full validation on devices that could never store the complete dataset.
Proof Size Overhead
MMR inclusion proofs carry a small overhead compared with standard Merkle proofs because they include all peak hashes for bagging, in addition to the sibling path within a single subtree. An MMR with n leaves has up to log(n) peaks in the worst case, effectively doubling the proof size. The cost remains negligible for most practical applications, but it is measurable in bandwidth-constrained environments.
Implementation Complexity
Position-based indexing, peak-finding algorithms and bagging add complexity compared with a straightforward Merkle tree implementation. Incorrect position prefixing can introduce second preimage vulnerabilities, and flawed peak validation has caused real-world security issues. The Herodotus cross-chain proof system, for example, required a fix after researchers discovered that intermediate hash nodes could pass peak validation without explicit peak count checks.
Append-Only Limitation
Pure MMRs do not support deletion, so once you append an element, it remains part of the structure permanently. Systems that need to remove elements, like Utreexo removing spent UTXOs, must extend the basic MMR model into a dynamic accumulator, adding complexity for update proofs and synchronisation. Pruning can reduce storage by discarding leaf data, but the logical structure of the MMR remains unchanged.
Evolving Alternatives
Researchers continue to improve on the MMR concept. The Merkle Mountain Belt (MMB), proposed in 2025, achieves O(1) constant-time appends instead of amortised O(log n) and provides recency-biased proof sizes that favour recent elements. These alternatives may shift the optimal choice of accumulator for specific use cases as they mature, though MMRs remain the most battle-tested option in production blockchain systems.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. You should always do your own research before using any protocol or technology.