Knowledge Base

Browse the concepts behind Truestamp. Follow the links between concepts, or search across everything.

Why and how Bitcoin uses Merkle trees - Applied Mathematics Consulting

John D. Cook blog post explaining how Bitcoin organizes block transactions into a Merkle tree, storing only the root in the block header to enable logarithmic-size Simple Payment Verification proofs.

Open resource

Overview

A 2025 blog post by John D. Cook (Applied Mathematics Consulting) explaining, with a concrete Bitcoin block example, why and how Bitcoin uses Merkle trees. It defines a Merkle tree as a binary tree whose leaves hold hashed transaction data and whose every internal node is the hash of the concatenation of its two children, so the single root hash fingerprints the entire set of transactions. The core practical point is that Bitcoin stores only this root in each block header, which lets lightweight clients verify that a transaction belongs to a block by checking a logarithmic number of hashes rather than downloading the whole block.

Key points

  • A Merkle tree hashes transactions into leaves, then repeatedly hashes concatenated child pairs upward to a single root; the smallest change to any transaction changes the root.
  • Bitcoin block headers store only the Merkle root, not the full tree; individual transaction ids are computed rather than stored.
  • Inclusion of a transaction is proved with the sibling hashes along the path from leaf to root: a block of 2^n transactions needs only n hashes (for example, a 1,024-transaction block needs 10).
  • This logarithmic scaling underpins Simple Payment Verification (SPV), letting light clients confirm a transaction without the full ledger.
  • When a level has an odd number of nodes, the last node is paired with (a duplicate of) itself before hashing; Cook’s worked example uses a block of 1,279 transactions treated as 1,280 leaves.

Relevance to Truestamp

The post explains the same Merkle-tree inclusion-proof mechanism Truestamp relies on: a single root committed publicly, with compact sibling-hash paths proving membership. See Truestamp’s Merkle tree and inclusion proofs for how this maps onto verifiable timestamping.

Citations

  1. Why and how Bitcoin uses Merkle trees - Applied Mathematics Consulting. John D. Cook, October 28, 2025.