Skip to main content
£0.00 0

Basket

No products in the basket.

ASIC mining articles and advice

BIP 98 Fast Merkle Trees: Draft Proof Construction Guide

BIP 98 guide to fast-SHA256 Merkle trees, domain separation, unbalanced trees, proof encoding, CVE-2012-2459 avoidance and safe validation.

BIP 98 Fast Merkle Trees guide cover

This guide explains BIP 98 Fast Merkle Trees in plain English. It covers the problem behind the BIP, why it matters and whether the proposal is part of Bitcoin today.

TL;DR

  • What it is: BIP 98 is a Draft consensus-layer specification for a Merkle-tree construction intended for new Bitcoin protocols. It does not replace the transaction Merkle root already committed by Bitcoin block headers.
  • Why it matters: BIP 98 specifies a promising tree for new proof systems, not a retrofit of Bitcoin block commitments. Safe evaluation requires exact hashing domains, canonical proof parsing, bounded resources and explicit Draft labelling.
  • Current position: BIP 98 is a Draft consensus-layer specification for a Merkle-tree construction intended for new Bitcoin protocols.

BIP 98 Fast Merkle Trees in simple English

BIP 98 Fast Merkle Trees: The proposal permits unbalanced binary trees but forbids nodes with a single child. An empty tree has no defined root, while a one-leaf tree passes through that leaf label without another hash.

Simple example

A node operator is checking BIP 98 Fast Merkle Trees. Applications still need their own unambiguous leaf serialisation and domain separation before hashing. That construction has created duplicate-entry hazards commonly associated with CVE-2012-2459 and performs more SHA-256 compression work than a purpose-built fixed-input inner-node hash.

Key terms in plain English

BIP:
Bitcoin Improvement Proposal: a document describing a proposed rule, standard or process. Its status must be checked separately.
Consensus:
The shared rules full nodes use to decide whether blocks and transactions are valid.
Node:
A computer running Bitcoin software that checks data and communicates with other peers.

Why a different tree was proposed

Bitcoin’s historical transaction tree duplicates a final hash at some odd-width levels. That construction has created duplicate-entry hazards commonly associated with CVE-2012-2459 and performs more SHA-256 compression work than a purpose-built fixed-input inner-node hash. BIP 98 targets new applications so they need not inherit those properties. It is not permission to reinterpret existing block headers.

Leaf and inner-node separation

Leaves are 32-byte double-SHA256 hashes of application-defined data. Inner nodes combine exactly two 32-byte labels with fast-SHA256, using a custom initialisation vector and no padding. The changed domain prevents a leaf label being interpreted casually as an inner commitment. Applications still need their own unambiguous leaf serialisation and domain separation before hashing.

Nothing-up-my-sleeve initialisation vector

The custom initialisation value is derived from fixed fractional bits related to the square root of 23 and then a standard SHA-256 midstate. The published derivation must be reproduced byte-for-byte. Substituting an implementation-defined digest state, byte order or padding rule creates another algorithm even if sample outputs happen to resemble the specification.

BIP 98 Fast Merkle Trees technical diagram
Nothing-up-my-sleeve initialisation vector: the fields, validation boundary and operational evidence that implementations need to agree.

Tree shape and edge cases

The proposal permits unbalanced binary trees but forbids nodes with a single child. An empty tree has no defined root, while a one-leaf tree passes through that leaf label without another hash. These rules affect proof composition and must be tested explicitly. A generic library that silently pads, duplicates or sorts children will calculate incompatible roots.

Proof encoding

A proof records the internal-node count, packed three-bit branch instructions and the omitted branch hashes. DESCEND, SKIP and VERIFY describe how the verifier reconstructs the committed root. Counts are deliberately redundant and must agree with the inferred structure. Reject non-zero padding bits, truncated hashes, extra hashes, impossible trees and trailing bytes rather than normalising them.

Malleability and resource limits

A node with two SKIP branches is disallowed because replacing it with one skipped parent is equivalent and otherwise creates proof malleability. Proof work is tied to internal-node count, but parsers still need strict byte, depth, allocation and hash-operation ceilings before recursion. Adversarial inputs should fail without unbounded memory, stack growth or partially accepted state.

How specialists test it

Developers test the proposal with made-up data on an isolated test network. They check normal cases and deliberately invalid cases. Different implementations should reach the same result before anyone relies on the proposal.

Frequently asked questions

What is the main point of BIP 98 Fast Merkle Trees?

BIP 98 Fast Merkle Trees: The proposal permits unbalanced binary trees but forbids nodes with a single child.

For BIP 98 Fast Merkle Trees, why a different tree was proposed?

Bitcoin’s historical transaction tree duplicates a final hash at some odd-width levels.

For BIP 98 Fast Merkle Trees, what should a beginner know about leaf and inner-node separation?

Leaves are 32-byte double-SHA256 hashes of application-defined data. Inner nodes combine exactly two 32-byte labels with fast-SHA256, using a custom initialisation vector and no padding.

For BIP 98 Fast Merkle Trees, what should a beginner know about nothing-up-my-sleeve initialisation vector?

The custom initialisation value is derived from fixed fractional bits related to the square root of 23 and then a standard SHA-256 midstate.

Conclusion

BIP 98 specifies a promising tree for new proof systems, not a retrofit of Bitcoin block commitments. Safe evaluation requires exact hashing domains, canonical proof parsing, bounded resources and explicit Draft labelling.

Primary sources

Check the current specification status and the documentation for the exact implementation you operate before moving production funds or changing a mining node.

ASIC MINER PICKS

Recommended ASIC Mining Hardware

Compare three of our highest ranked ASIC miners currently available, with live product details and pricing.
Browse all ASIC miners
MORE MINING ADVICE

More ASIC Mining Articles

Read practical advice about choosing hardware, calculating electricity costs, setting up miners, hosting and maintenance.
MINER COMMUNITY

Join the ASIC Mining Discussion

Ask a question or share what has worked for you. Your experience may help another miner make a better decision.

Members can read and join the discussion

Log in to read comments from other miners. Create a free account if you would like to ask a question or share your experience.

Log in to read comments Register to join the discussion

Membership helps us protect the discussion from spam and keep answers useful.

ASIC MINING SUPPORT

Need Help Choosing an ASIC Miner?

Tell us what you want to mine, your electricity cost and where the machine will run. We can help you compare hardware, power requirements, hosting and repairs.
Contact our mining team
Browse ASIC miners