DEFINITION of 'Merkle Tree'

A Merkle tree is a data structure that is used in computer science applications. In bitcoin and other cryptocurrencies​, Merkle trees serve to encode blockchain data more efficiently and securely.

They are also referred to as "binary hash trees."


In bitcoin's blockchain​, a block of transactions is run through an algorithm to generate a hash, which is a string of numbers and letters that can be used to verify that a given set of data is the same as the original set of transactions, but not to obtain the original set of transactions. Bitcoin's software does not run the entire block of transaction data – representing 10 minutes' worth of transactions on average – through the hash function at one time, however. Rather each transaction is hashed, then each pair of transactions is concatenated and hashed together, and so on until there is one hash for the entire block. (If there is an odd number of transactions, one transaction is doubled and its hash is concatenated with itself.)

Visualized, this structure resembles a tree. In the diagram below, "T" designates a transaction, "H" a hash. Note that the image is highly simplified; an average block contains over 500 transactions, not eight.

The hashes on the bottom row are referred to as "leaves," the intermediate hashes as "branches," and the hash at the top as the "root." The Merkle root of a given block is stored in the header: for example, the Merkle root of block #482819 is e045b18e7a3d708d686717b4f44db2099aabcad9bebf968de5f7271b458f71c8. The root is combined with other information (the software version, the previous block's hash, the timestamp, the difficulty target and the nonce) and then run through a hash function to produce the block's unique hash: 000000000000000000bfc767ef8bf28c42cbd4bdbafd9aa1b5c3c33c2b089594 in the case of block #482819. This hash is not actually included in the relevant block, but the next one; it is distinct from the Merkle root. (See also, How Bitcoin Works.)

The Merkle tree is useful because it allows users to verify a specific transaction without downloading the whole blockchain (over 130 gigabytes at the end of August 2017). For example, say that you wanted to verify that transaction TD is included in the block in the diagram above. If you have the root hash (HABCDEFGH), the process is like a game of sudoku: you query the network about HD, and it returns HC, HAB and HEFGH. The Merkle tree allows you to verify that everything is accounted for with three hashes: given HAB, HC, HEFGH and the root HABCDEFGH, HD (the only missing hash) has to be present in the data.

Merkle trees are named after Ralph Merkle, who proposed them in a 1987 paper titled "A Digital Signature Based on a Conventional Encryption Function." Merkle also invented cryptographic hashing.

  1. Hash

    A hash is a function that converts an input of letters and numbers ...
  2. Mining Pool

    A mining pool is a joint group of cryptocurrency miners who combine ...
  3. Block Trade

    An order or trade submitted for sale or purchase of a large quantity ...
  4. Bitcoin Mining

    Bitcoin mining is the process by which transactions are verified ...
  5. Block

    A block is a large amount of the same security bought or sold ...
  6. Genesis Block

    Learn about the Genesis Block, the first Bitcoin block ever mined. ...
Related Articles
  1. Trading

    Bitcoin Cash: The New King of Cryptocurrency?

    Investors are wondering if the popularity of Bitcoin Cash poses a serious threat to the Bitcoin throne.
  2. Tech

    Blockchain Could Make You—Not Equifax—the Owner of Your Data

    All hype aside, blockchain technology is really good at one thing: taking out the middlemen. Leaky data brokers' days may be numbered.
  3. Tech

    How Do You Mine Litecoin?

    This guide will give you a sense of the concepts in litecoin mining, an introduction to the vocabulary and suggestions for further research.
  4. Tech

    What Is Bitcoin?

    We know, bitcoin isn't exactly straightforward. If miners, hashes, keys, blocks and wallets have you scratching your head, this infographic is for you.
  5. Tech

    Bitcoin Price Finds Further Support in Scaling Agreement

    The scaling agreement is likely to provide support to Bitcoin’s price rally.
  6. Tech

    Bitcoin vs. Bitcoin Cash: What's the Difference?

    We break down the difference between Bitcoin and Bitcoin Cash, and what it might mean for the future of cryptocurrencies
  7. Tech

    Bitcoin Is Dead? Not A Chance

    The price of the digital currency, Bitcoin, fell from around $450 to below $380 late last week following the departure of long-time developer Mike Hearn.
  8. Tech

    Speed Is Essential for Bitcoin Platforms

    Why does speed especially matter with Bitcoin technology? It's because Bitcoin platforms using blockchain need to meet the needs of users in times of high volatility.
  9. Tech

    What is the Genesis Block in Bitcoin Terms?

    Learn more about the Genesis Block, the original Bitcoin block.
  10. Tech

    What is Bitcoin Mining?

    Bitcoin mining is how Bitcoin gets released into circulation.
  1. What does a block chain record in a bitcoin exchange transaction?

    Read about the bitcoin blockchain, a public ledger shared among all bitcoin users that records the information of every single ... Read Answer >>
  2. Does homeowners insurance cover tree damage?

    Discover how damage to a home from fallen trees is covered under your homeowners insurance policy if it happens suddenly ... Read Answer >>
  3. How does seasonality affect the forest products sector?

    Find out why the concept of seasonality is critical to understanding the forest products sector for both producers and consumers ... Read Answer >>
  4. How do you buy Bitcoins?

    Many people have heard of this virtual cryptocurrency, but few know all the ways you can purchase Bitcoin. Read Answer >>
  5. How is a block chain network useful for trading goods and assets in virtual currencies?

    Find out how blockchain technology works and why it is so crucial for maintaining trading networks for virtual currencies ... Read Answer >>
Hot Definitions
  1. Standard Deviation

    A measure of the dispersion of a set of data from its mean, calculated as the square root of the variance. The more spread ...
  2. Entrepreneur

    An Entrepreneur is an individual who founds and runs a small business and assumes all the risk and reward of the venture. ...
  3. Money Market

    The money market is a segment of the financial market in which financial instruments with high liquidity and very short maturities ...
  4. Perfect Competition

    Pure or perfect competition is a theoretical market structure in which a number of criteria such as perfect information and ...
  5. Compound Interest

    Compound Interest is interest calculated on the initial principal and also on the accumulated interest of previous periods ...
  6. Income Statement

    A financial statement that measures a company's financial performance over a specific accounting period. Financial performance ...
Trading Center