diff --git a/ch06.asciidoc b/ch06.asciidoc index 16cc9a9b..b878ae12 100644 --- a/ch06.asciidoc +++ b/ch06.asciidoc @@ -74,13 +74,43 @@ $ bitcoind getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8c | 4 bytes | Nonce | A counter used for the proof-of-work algorithm |======= +=== Linking Blocks in a Chain + +[[chain_of_blocks]] +.Blocks linked in a chain, by reference to the previous block header hash +image::images/ChainOfBlocks.png["chain_of_blocks"] + -=== The Genesis Block === Merkle Trees + +A _Merkle Tree_ is a data structure created by Ralph Merkle used for efficiently summarizing and verifying the integrity of large sets of data. Merkle Trees are binary trees containing cryptographic hashes. When N data elements are hashed and summarized in a Merkle Tree, you can check to see if any one data element is included in the tree with at most +log(N)+ calculations, making this a very efficient data structure. + +[[simple_merkle]] +.Calculating the nodes in a Merkle Tree +image::images/MerkleTree.png["merkle_tree"] + +[[merkle_tree_odd]] +.An even number of data elements, by duplicating one data element +image::images/MerkleTreeOdd.png["merkle_tree_odd"] + +[[merkle_tree_large]] +.A Merkle Tree summarizing many data elements +image::images/MerkleTreeLarge.png["merkle_tree_large"] + +[[merkle_tree_path]] +.A Merkle Path used to prove inclusion of a data element +image::images/MerkleTreePathToK.png["merkle_tree_path"] + === Proof-of-Work (Mining) and Consensus ==== Consensus Mechanism ==== Proof-of-Work Algorithm ==== Difficulty Target and Re-Targetting +==== Blockchain Forks + +[[chainforks]] +.A blockchain showing two instances of forking +image::images/BlockChainWithForks.png["chainforks"] + ==== Highest Difficulty Chain Selection ==== Competition and Coinbase ==== Mining Pools @@ -90,7 +120,7 @@ $ bitcoind getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8c ==== Consensus Attacks ===== 51% Attack ===== Selfish Mining Attack -=== Chain Forking + ==== Normal Forks ==== Soft Forks ==== Hard Forks diff --git a/images/BlockChainWithForks.png b/images/BlockChainWithForks.png new file mode 100755 index 00000000..1f4168c3 Binary files /dev/null and b/images/BlockChainWithForks.png differ diff --git a/images/ChainOfBlocks.png b/images/ChainOfBlocks.png new file mode 100755 index 00000000..3048cfde Binary files /dev/null and b/images/ChainOfBlocks.png differ diff --git a/images/MerkleTree.png b/images/MerkleTree.png new file mode 100755 index 00000000..580fb0f6 Binary files /dev/null and b/images/MerkleTree.png differ diff --git a/images/MerkleTreeLarge.png b/images/MerkleTreeLarge.png new file mode 100755 index 00000000..ef655496 Binary files /dev/null and b/images/MerkleTreeLarge.png differ diff --git a/images/MerkleTreeOdd.png b/images/MerkleTreeOdd.png new file mode 100755 index 00000000..f70d0afe Binary files /dev/null and b/images/MerkleTreeOdd.png differ diff --git a/images/MerkleTreePathToK.png b/images/MerkleTreePathToK.png new file mode 100755 index 00000000..90c62ef5 Binary files /dev/null and b/images/MerkleTreePathToK.png differ