From 58107b98bdde682241161da838cb651665a1d633 Mon Sep 17 00:00:00 2001 From: Josh Green Date: Wed, 15 Jan 2020 17:19:16 -0500 Subject: [PATCH 1/6] Removed dead protocol.md link. --- home.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.md b/home.md index 2e403bf..1531a08 100644 --- a/home.md +++ b/home.md @@ -4,7 +4,7 @@ - [Contributors](/contributors) - [Target Audience](/target-audience) - [Project History](/project-history) -- [Protocol](/protocol) +- Protocol - [Blockchain](/protocol/blockchain) - [Hash](/protocol/blockchain/hash) - [Transaction](/protocol/blockchain/transaction) From 4007425602bb2667c6ff11ccf93abd1377284fff Mon Sep 17 00:00:00 2001 From: Josh Green Date: Wed, 22 Jan 2020 09:24:50 -0500 Subject: [PATCH 2/6] Added testnet stub. Inspired from: https://www.reddit.com/r/btc/comments/erzbsm/ --- home.md | 1 + 1 file changed, 1 insertion(+) diff --git a/home.md b/home.md index 1531a08..7493c5a 100644 --- a/home.md +++ b/home.md @@ -110,3 +110,4 @@ - History - Bips - Protocol Version + - Testnet From 17df71efd2245c7e2ae16cc6f88b4ee0c3bbeca1 Mon Sep 17 00:00:00 2001 From: Josh Green Date: Thu, 30 Jan 2020 16:46:16 -0500 Subject: [PATCH 3/6] Resolved lint warnings on block.md. --- protocol/blockchain/block.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/protocol/blockchain/block.md b/protocol/blockchain/block.md index e2c0509..578fec4 100644 --- a/protocol/blockchain/block.md +++ b/protocol/blockchain/block.md @@ -31,4 +31,8 @@ The block reward started at 5,000,000,000 satoshis (50 BCH) and decreases by hal Transaction fees are often required by the network for transactions to be relayed across the network. Satoshis provided as inputs to a transaction, but not consumed by its outputs, are collected by the coinbase transaction as implicit inputs. -The coinbase message is provided in the inputs unlocking script. The unlocking script is required to begin with a push of the block height which can then be followed why whatever data is desired. The block height encoded as a variable-length, little-endian integer. The [OP_DATA_X](/protocol/blockchain/script/op-codes/op-data-x) operation is used to push the necessary number of bytes to encode the length. This requirement was added with version 2 blocks as a part of [BIP-34](/protocol/forks/bip-0034). \ No newline at end of file +The coinbase message is provided in the inputs unlocking script. +The unlocking script is required to begin with a push of the block height which can then be followed why whatever data is desired. +The block height encoded as a variable-length, little-endian integer. +The [OP_DATA_X](/protocol/blockchain/script/op-codes/op-data-x) operation is used to push the necessary number of bytes to encode the length. +This requirement was added with version 2 blocks as a part of [BIP-34](/protocol/forks/bip-0034). \ No newline at end of file From 5575b8b3c42ed152f2fceb86757cc3e0373947b0 Mon Sep 17 00:00:00 2001 From: Josh Green Date: Thu, 30 Jan 2020 16:54:33 -0500 Subject: [PATCH 4/6] Documented genesis block coinbase output rule. --- protocol/blockchain/transaction-validation.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/protocol/blockchain/transaction-validation.md b/protocol/blockchain/transaction-validation.md index a0de586..ffe77ce 100644 --- a/protocol/blockchain/transaction-validation.md +++ b/protocol/blockchain/transaction-validation.md @@ -8,4 +8,14 @@ Transaction validation can be broken down into three major categories: - [Block-Level Validation Rules](/protocol/blockchain/transaction-validation/block-level-validation-rules) which determine whether transactions are valid in a given blockchain context (i.e. in a given block with a given history) - [Network-Level Validation Rules](/protocol/blockchain/transaction-validation/network-level-validation-rules) which determine whether transactions are relayed from node to node -The three of these are closely intertwined but often result in different behavior when they are violated. For details, see the linked pages for definitions of each. \ No newline at end of file +The three of these are closely intertwined but often result in different behavior when they are violated. For details, see the linked pages for definitions of each. + +## Miscellaneous Validation Rules + +Bitcoin also has some miscellaneous rules for validation, which include exceptions or oddities. +The following are miscellaneous rules. + +### Genesis Block Coinbase + +The genesis block's coinbase may not be spent. +Furthermore, this coinbase's output is not considered an unspent transaction output. From aedf52c5d7ee25199b3caf0838b3c4f2721815a6 Mon Sep 17 00:00:00 2001 From: Josh Green Date: Thu, 30 Jan 2020 17:04:55 -0500 Subject: [PATCH 5/6] Added additional coinbase restrictions. --- protocol/blockchain/block.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/protocol/blockchain/block.md b/protocol/blockchain/block.md index 578fec4..4810d3f 100644 --- a/protocol/blockchain/block.md +++ b/protocol/blockchain/block.md @@ -35,4 +35,8 @@ The coinbase message is provided in the inputs unlocking script. The unlocking script is required to begin with a push of the block height which can then be followed why whatever data is desired. The block height encoded as a variable-length, little-endian integer. The [OP_DATA_X](/protocol/blockchain/script/op-codes/op-data-x) operation is used to push the necessary number of bytes to encode the length. -This requirement was added with version 2 blocks as a part of [BIP-34](/protocol/forks/bip-0034). \ No newline at end of file +This requirement was added with version 2 blocks as a part of [BIP-34](/protocol/forks/bip-0034). + +Each coinbase transaction may only have one transaction input. + +Each coinbase transaction's unlocking script must be less than or equal to 100 bytes. \ No newline at end of file From 2960e1e77b916da0f944e44f68fa714604168108 Mon Sep 17 00:00:00 2001 From: Josh Green Date: Thu, 30 Jan 2020 17:07:26 -0500 Subject: [PATCH 6/6] Added coinbase validation rules to tx validation. --- protocol/blockchain/transaction-validation.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/protocol/blockchain/transaction-validation.md b/protocol/blockchain/transaction-validation.md index ffe77ce..58e3b61 100644 --- a/protocol/blockchain/transaction-validation.md +++ b/protocol/blockchain/transaction-validation.md @@ -19,3 +19,9 @@ The following are miscellaneous rules. The genesis block's coinbase may not be spent. Furthermore, this coinbase's output is not considered an unspent transaction output. + +### Extra Coinbase Validation Rules + +Coinbases may only have one transaction input. + +All coinbase unlocking script must be less than or equal to 100 bytes in size. \ No newline at end of file