1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-11-17 13:41:38 +00:00

merkle clarification

This commit is contained in:
Andreas M. Antonopoulos 2014-07-23 11:39:53 -05:00
parent d6aeddfb73
commit 95cef90b8c

View File

@ -167,7 +167,7 @@ Since the merkle tree is a binary tree, it needs an even number of leaf nodes. I
.An even number of data elements, by duplicating one data element .An even number of data elements, by duplicating one data element
image::images/MerkleTreeOdd.png["merkle_tree_odd"] image::images/MerkleTreeOdd.png["merkle_tree_odd"]
The same method for constructing a tree from four transactions can be generalized to construct trees of any size. In bitcoin it is common to have several hundred to more than a thousand transactions in a single block, which are summarized in exactly the same way producing just 32-bytes of data from a single merkle root. In the diagram below, you will see a tree built from 16 transactions: The same method for constructing a tree from four transactions can be generalized to construct trees of any size. In bitcoin it is common to have several hundred to more than a thousand transactions in a single block, which are summarized in exactly the same way producing just 32-bytes of data from a single merkle root. In the diagram below, you will see a tree built from 16 transactions. Note that while the root looks bigger than the leaf nodes in the diagram, it is the exact same size, just 32 bytes. Whether there is one transaction or a hundred thousand transactions in the block, the merkle root always summarizes them into 32 bytes:
[[merkle_tree_large]] [[merkle_tree_large]]
.A Merkle Tree summarizing many data elements .A Merkle Tree summarizing many data elements