1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-12-23 15:18:11 +00:00

Made changes to ch07.asciidoc

This commit is contained in:
myarbrough@oreilly.com 2014-11-18 08:57:38 -08:00
parent e1fd47f310
commit fb14ebbe39

View File

@ -179,7 +179,7 @@ Because the merkle tree is a binary tree, it needs an even number of leaf nodes.
.Duplicating one data element achieves an even number of data elements .Duplicating one data element achieves an even number of data elements
image::images/msbt_0703.png["merkle_tree_odd"] image::images/msbt_0703.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 as the single merkle root. In <<merkle_tree_large>>, 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. 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 as the single merkle root. In <<merkle_tree_large>>, you will see a tree built from 16 transactions. Note that although 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