From 7430631daaec4d82348317a06bdf811b0d2d15f8 Mon Sep 17 00:00:00 2001 From: 1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH <1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH@reference.cash> Date: Wed, 18 Dec 2019 15:01:13 -0500 Subject: [PATCH 1/4] wiki commit --- protocol/blockchain/block/merkle-tree.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 protocol/blockchain/block/merkle-tree.md diff --git a/protocol/blockchain/block/merkle-tree.md b/protocol/blockchain/block/merkle-tree.md new file mode 100644 index 0000000..79791d0 --- /dev/null +++ b/protocol/blockchain/block/merkle-tree.md @@ -0,0 +1,7 @@ +# Merkle Tree + +A [merkle tree](https://en.wikipedia.org/wiki/Merkle_tree) is a data structure designed to build a hash of many separate pieces of data and allowing efficient recalculation of the hash when items are added, removed, or changed. + +In Bitcoin Cash, the transactions in a [block](/protocol/blockchain/block) are built into a merkle tree. The root of this tree, or **merkle root**, is a hash representing a compound, indirect hash of all of the items added to the merkle tree (i.e. transactions) and is included in the [block header](/protocol/blockchain/block/block-header), ensuring the block hash is dependent (indirectly) on all of the transactions that are included in the block. + +Using a merkle tree to manage hashing the transactions in a block enables efficient addition of newly submitted transactions to a block being mined. Rather than re-hashing the entirety of the data of the transactions to be included in the block, the new transaction can be hash and then a small number of hashes can be recalculated, leading up to the merkle root. For large blocks this can heavily reduce the amount of data to be (re-)hashed. \ No newline at end of file From 243236c6de2e738a940f0c30aa6fafff52058760 Mon Sep 17 00:00:00 2001 From: 1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH <1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH@reference.cash> Date: Wed, 18 Dec 2019 15:03:59 -0500 Subject: [PATCH 2/4] wiki commit --- home.md | 3 +-- protocol/blockchain/block/merkle-tree.md | 4 +++- protocol/blockchain/block/merkle-tree/partial-merkle-tree.md | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 protocol/blockchain/block/merkle-tree/partial-merkle-tree.md diff --git a/home.md b/home.md index 12f0ba3..cc8d28a 100644 --- a/home.md +++ b/home.md @@ -13,8 +13,7 @@ - [Block](/protocol/blockchain/block) - [Header](/protocol/blockchain/block/block-header) - [Merkle Tree](/protocol/blockchain/block/merkle-tree) - - Merkle Root - - Partial Merkle Tree + - [Partial Merkle Tree](/protocol/blockchain/block/merkle-tree/partial-merkle-tree) - Transactions - Legacy Transaction Ordering - Canonical Transaction Ordering (CTOR) diff --git a/protocol/blockchain/block/merkle-tree.md b/protocol/blockchain/block/merkle-tree.md index 79791d0..e588140 100644 --- a/protocol/blockchain/block/merkle-tree.md +++ b/protocol/blockchain/block/merkle-tree.md @@ -4,4 +4,6 @@ A [merkle tree](https://en.wikipedia.org/wiki/Merkle_tree) is a data structure d In Bitcoin Cash, the transactions in a [block](/protocol/blockchain/block) are built into a merkle tree. The root of this tree, or **merkle root**, is a hash representing a compound, indirect hash of all of the items added to the merkle tree (i.e. transactions) and is included in the [block header](/protocol/blockchain/block/block-header), ensuring the block hash is dependent (indirectly) on all of the transactions that are included in the block. -Using a merkle tree to manage hashing the transactions in a block enables efficient addition of newly submitted transactions to a block being mined. Rather than re-hashing the entirety of the data of the transactions to be included in the block, the new transaction can be hash and then a small number of hashes can be recalculated, leading up to the merkle root. For large blocks this can heavily reduce the amount of data to be (re-)hashed. \ No newline at end of file +Using a merkle tree to manage hashing the transactions in a block enables efficient addition of newly submitted transactions to a block being mined. Rather than re-hashing the entirety of the data of the transactions to be included in the block, the new transaction can be hash and then a small number of hashes can be recalculated, leading up to the merkle root. For large blocks this can heavily reduce the amount of data to be (re-)hashed. + +Using merkle trees also allows for transferring only a subset of a block while still providing confidence that the data provided in fact appeared in the block in question. For more information, see [Partial Merkle Tree](/protocol/blockchain/block/merkle-tree/partial-merkle-tree). \ No newline at end of file diff --git a/protocol/blockchain/block/merkle-tree/partial-merkle-tree.md b/protocol/blockchain/block/merkle-tree/partial-merkle-tree.md new file mode 100644 index 0000000..be92438 --- /dev/null +++ b/protocol/blockchain/block/merkle-tree/partial-merkle-tree.md @@ -0,0 +1 @@ +# Partial Merkle Tree From 8cb1e7dd51a74469e04bc6830d17a2eea99b1240 Mon Sep 17 00:00:00 2001 From: 1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH <1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH@reference.cash> Date: Wed, 18 Dec 2019 15:04:18 -0500 Subject: [PATCH 3/4] wiki commit From 0affbab7ff1b2460ce2598f31f53d54d1cda413b Mon Sep 17 00:00:00 2001 From: 1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH <1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH@reference.cash> Date: Wed, 18 Dec 2019 15:07:13 -0500 Subject: [PATCH 4/4] wiki commit --- home.md | 2 -- protocol/blockchain/script.md | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/home.md b/home.md index cc8d28a..202f4cc 100644 --- a/home.md +++ b/home.md @@ -20,8 +20,6 @@ - [Script](/protocol/blockchain/script) - Opcodes ... - - Script Execution - - Stack - Transaction Validation - Block Level Validation Rules - Network Level Validation Rules diff --git a/protocol/blockchain/script.md b/protocol/blockchain/script.md index b151bef..e4989c3 100644 --- a/protocol/blockchain/script.md +++ b/protocol/blockchain/script.md @@ -1 +1,3 @@ # Script + +## Script Execution \ No newline at end of file