Skip to content

Commit 3a28003

Browse files
committed
Implement BIP 2 with merging master changes
2 parents 42770fb + fd5a85d commit 3a28003

12 files changed

+151
-8
lines changed

Diff for: README.mediawiki

+8-2
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,12 @@ Those proposing changes should consider that ultimately consent may rest with th
344344
| Standard
345345
| Draft
346346
|-
347+
| [[bip-0090.mediawiki|90]]
348+
| Buried Deployments
349+
| Suhas Daftuar
350+
| Informational
351+
| Draft
352+
|-
347353
| [[bip-0099.mediawiki|99]]
348354
| Motivation and deployment of consensus rule changes ([soft/hard]forks)
349355
| Jorge Timón
@@ -385,12 +391,12 @@ Those proposing changes should consider that ultimately consent may rest with th
385391
| Washington Y. Sanchez
386392
| Standard
387393
| Draft
388-
|-
394+
|- style="background-color: #ffcfcf"
389395
| [[bip-0109.mediawiki|109]]
390396
| Two million byte size limit with sigop and sighash limits
391397
| Gavin Andresen
392398
| Standard
393-
| Draft
399+
| Rejected
394400
|- style="background-color: #ffffcf"
395401
| [[bip-0111.mediawiki|111]]
396402
| NODE_BLOOM service bit

Diff for: bip-0017.mediawiki

+5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
Status: Withdrawn
99
Type: Standards Track
1010
Created: 2012-01-18
11+
License: BSD-2-Clause
1112
</pre>
1213

1314
==Abstract==
1415

1516
This BIP describes a new opcode (OP_CHECKHASHVERIFY) for the Bitcoin scripting system, and a new 'standard' transaction type that uses it to enables the receiver of bitcoins to specify the transaction type needed to re-spend them.
1617

18+
==Copyright==
19+
20+
This BIP is licensed under the BSD 2-clause license.
21+
1722
==Motivation==
1823

1924
The purpose of pay-to-script-hash is to move the responsibility for supplying the conditions to redeem a transaction from the sender of the funds to the redeemer.

Diff for: bip-0018.mediawiki

+5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
Status: Proposed
99
Type: Standards Track
1010
Created: 2012-01-27
11+
License: BSD-2-Clause
1112
</pre>
1213

1314
==Abstract==
1415

1516
This BIP modifies the basic format of transaction inputs and outputs, replacing the current scriptSig and scriptPubKey (scripts executed to validate a transaction) with new contents: dataSig, scriptCheck, and hashScriptCheck.
1617

18+
==Copyright==
19+
20+
This BIP is licensed under the BSD 2-clause license.
21+
1722
==Motivation==
1823

1924
The purpose of pay-to-script-hash is to move the responsibility for supplying the conditions to redeem a transaction from the sender of the funds to the redeemer.

Diff for: bip-0019.mediawiki

+5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
Status: Draft
99
Type: Standards Track
1010
Created: 2012-01-30
11+
License: BSD-2-Clause
1112
</pre>
1213

1314
==Abstract==
1415

1516
This BIP proposes M-of-N-signatures required transactions as a new 'standard' transaction type using the existing scripting system without significant modifications.
1617

18+
==Copyright==
19+
20+
This BIP is licensed under the BSD 2-clause license.
21+
1722
==Motivation==
1823

1924
Enable secured wallets, escrow transactions, and other use cases where redeeming funds requires more than a single signature.

Diff for: bip-0020.mediawiki

+4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88
Status: Replaced
99
Type: Standards Track
1010
Created: 2011-01-10
11+
License: BSD-2-Clause
1112
</pre>
1213

1314
BIP 0020 is based off an earlier document by Nils Schneider. '''And has been replaced by BIP 0021'''
1415

1516
==Abstract==
1617
This BIP proposes a URI scheme for making Bitcoin payments.
1718

19+
==Copyright==
20+
This BIP is licensed under the BSD 2-clause license.
21+
1822
==Motivation==
1923
The purpose of this URI scheme is to enable users to easily make payments by simply clicking links on webpages or scanning QR Codes.
2024

Diff for: bip-0022.mediawiki

+5
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@
88
Status: Final
99
Type: Standards Track
1010
Created: 2012-02-28
11+
License: BSD-2-Clause
1112
</pre>
1213

1314
==Abstract==
1415

1516
This BIP describes a new JSON-RPC method for "smart" Bitcoin miners and proxies.
1617
Instead of sending a simple block header for hashing, the entire block structure is sent, and left to the miner to (optionally) customize and assemble.
1718

19+
==Copyright==
20+
21+
This BIP is licensed under the BSD 2-clause license.
22+
1823
==Specification==
1924

2025
===Block Template Request===

Diff for: bip-0023.mediawiki

+5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
Status: Final
99
Type: Standards Track
1010
Created: 2012-02-28
11+
License: BSD-2-Clause
1112
</pre>
1213

1314
==Abstract==
1415

1516
This BIP describes extensions to the getblocktemplate JSON-RPC call to enhance pooled mining.
1617

18+
==Copyright==
19+
20+
This BIP is licensed under the BSD 2-clause license.
21+
1722
==Specification==
1823

1924
Note that all sections of this specification are optional extensions on top of [[bip-0022.mediawiki|BIP 22]].

Diff for: bip-0067.mediawiki

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
Status: Proposed
1111
Type: Standards Track
1212
Created: 2015-02-08
13+
License: PD
1314
</pre>
1415

1516
==Abstract==
@@ -129,3 +130,8 @@ The authors wish to thank BtcDrak and Luke-Jr for their involvement & contributi
129130
130131
== References ==
131132
<references>
133+
134+
135+
== Copyright ==
136+
This document is placed in the public domain.
137+

Diff for: bip-0090.mediawiki

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<pre>
2+
BIP: 90
3+
Layer: Consensus (hard fork)
4+
Title: Buried Deployments
5+
Author: Suhas Daftuar <[email protected]>
6+
Comments-Summary: No comments yet.
7+
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0090
8+
Status: Draft
9+
Type: Informational
10+
Created: 2016-11-08
11+
License: PD
12+
</pre>
13+
14+
15+
==Abstract==
16+
17+
Prior soft forks (BIP 34, BIP 65, and BIP 66) were activated via miner signaling in block version numbers. Now that the chain has long since passed the blocks at which those consensus rules have triggered, we can (as a simplification) replace the trigger mechanism by caching the block heights at which those consensus rules became enforced.
18+
19+
==Motivation==
20+
21+
BIPs 34, 65 and 66 were deployed on mainnet using miner signaling using block version numbers. In short, new consensus rules were proposed for use in blocks with a higher version number (N+1) than the prevailing block version (N) in use on the network, and those rules became enforced under the following conditions:
22+
# 75% rule: If 750 of the prior 1000 blocks are version N+1 or higher, then blocks with version N+1 or higher must correctly enforce the new consensus rule.
23+
# 95% rule: If 950 of the prior 1000 blocks are version N+1 or higher, then blocks with version less than N+1 are invalid.
24+
25+
Please see those [[#References|BIPs]] for more details.
26+
27+
Note that this trigger mechanism is dependent on the chain history. To validate a block, we must test whether the trigger was met by looking at the previous 1000 blocks in the chain before it, which can be inefficient.
28+
29+
In addition, this mechanism for code deployments have been deprecated in favor of BIP 9 deployments, which offer several advantages (please see [https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki BIP 9]).
30+
31+
Thus we propose elimination of the logic implementing these kinds of deployments, by replacing the test which governs enforcement of BIP 34, BIP 65, and BIP 66 with simple height checks, which we choose to be the block height triggering the 95% activation rule on mainnet for each of those deployments. This simplification of the consensus rules would reduce the technical debt associated with deployment of those consensus changes.
32+
33+
==Considerations==
34+
35+
It is technically possible for this to be a non-backwards compatible change. For example, if an alternate chain were created in which BIP 34's 95% activation triggered at a lower height (H') than it did on the current mainnet chain (H), then older software would enforce that version 1 blocks were invalid at heights between H' and H, while newer software implementing this change would not. Similarly, this BIP proposes doing away with the 75% threshold check altogether, which means, for example, that a version 2 block forking off of mainnet at height H-1 which omitted the height in coinbase would be invalid to older software, while accepted by newer software.
36+
37+
However, while newer software and older software might validate old blocks differently, that could only cause a consensus split if there were an extremely large blockchain reorganization onto a chain built off such a block. As of November 2016, the most recent of these changes (BIP 65, enforced since December 2015) has nearly 50,000 blocks built on top of it. The occurrence of such a reorg that would cause the activating block to be disconnected would raise fundamental concerns about the security assumptions of Bitcoin, a far bigger issue than any non-backwards compatible change.
38+
39+
So while this proposal could <i>theoretically</i> result in a consensus split, it is extremely unlikely, and in particular any such circumstances would be sufficiently damaging to the Bitcoin network to dwarf any concerns about the effects of this proposed change.
40+
41+
==Specification==
42+
43+
The BIP 34, 66, and 65 activation heights are set to 227931, 363725, and 388381, respectively.
44+
45+
The 1000-block lookback test, first described in BIP 34, is no longer performed during validation of any blocks. Instead, a new check is added:
46+
47+
if((block.nVersion < 2 && nHeight >= consensusParams.BIP34Height) ||
48+
(block.nVersion < 3 && nHeight >= consensusParams.BIP66Height) ||
49+
(block.nVersion < 4 && nHeight >= consensusParams.BIP65Height))
50+
return state.Invalid(false, REJECT_OBSOLETE, strprintf("bad-version(0x%08x)", block.nVersion),
51+
strprintf("rejected nVersion=0x%08x block", block.nVersion));
52+
53+
Furthermore, rather than consider the block versions of the prior 1000 blocks to determine whether to enforce BIP 34, BIP 65, or BIP 66 on a given block, we instead just compare the height of the block being validated with the stored activation heights:
54+
55+
// Enforce rule that the coinbase starts with serialized block height
56+
if (nHeight >= consensusParams.BIP34Height)
57+
{
58+
CScript expect = CScript() << nHeight;
59+
if (block.vtx[0].vin[0].scriptSig.size() < expect.size() ||
60+
!std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) {
61+
return state.DoS(100, false, REJECT_INVALID, "bad-cb-height", false, "block height mismatch in coinbase");
62+
}
63+
}
64+
65+
and
66+
67+
// Start enforcing the DERSIG (BIP66) rule
68+
if (pindex->nHeight >= chainparams.GetConsensus().BIP66Height) {
69+
flags |= SCRIPT_VERIFY_DERSIG;
70+
}
71+
72+
// Start enforcing CHECKLOCKTIMEVERIFY (BIP65) rule
73+
if (pindex->nHeight >= chainparams.GetConsensus().BIP65Height) {
74+
flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;
75+
}
76+
77+
Please see the implementation for additional details.
78+
79+
==Implementation==
80+
81+
https://github.com/bitcoin/bitcoin/pull/8391.
82+
83+
84+
==References==
85+
86+
[https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki BIP34 Block v2, Height in Coinbase]
87+
88+
[https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki BIP66 Strict DER signatures]
89+
90+
[https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki BIP65 OP_CHECKLOCKTIMEVERIFY]
91+
92+
[https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki BIP9 Version bits with timeout and delay]
93+
94+
==Acknowledgements==
95+
96+
Thanks to Nicolas Dorier for drafting an initial version of this BIP, and to Alex Morcos, Matt Corallo, and Greg Maxwell for suggestions and feedback.
97+
98+
==Copyright==
99+
100+
This document is placed in the public domain.

Diff for: bip-0109.mediawiki

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Author: Gavin Andresen <[email protected]>
66
Comments-Summary: No comments yet.
77
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0109
8-
Status: Draft
8+
Status: Rejected
99
Type: Standards Track
1010
Created: 2016-01-28
1111
License: PD

Diff for: bip-0152.mediawiki

+5-3
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,18 @@ A new inv type (MSG_CMPCT_BLOCK == 4) and several new protocol messages are adde
124124
# MSG_CMPCT_BLOCK inv objects MUST NOT appear anywhere except for in getdata messages.
125125
126126
====cmpctblock====
127-
# The cmpctblock message is defined as as a message containing a serialized HeaderAndShortIDs message and pchCommand == "cmpctblock".
127+
# The cmpctblock message is defined as a message containing a serialized HeaderAndShortIDs message and pchCommand == "cmpctblock".
128128
# Upon receipt of a cmpctblock message after sending a sendcmpct message, nodes SHOULD calculate the short transaction ID for each unconfirmed transaction they have available (ie in their mempool) and compare each to each short transaction ID in the cmpctblock message.
129129
# After finding already-available transactions, nodes which do not have all transactions available to reconstruct the full block SHOULD request the missing transactions using a getblocktxn message.
130130
# A node MUST NOT send a cmpctblock message unless they are able to respond to a getblocktxn message which requests every transaction in the block.
131131
# A node MUST NOT send a cmpctblock message without having validated that the header properly commits to each transaction in the block, and properly builds on top of the existing chain with a valid proof-of-work. A node MAY send a cmpctblock before validating that each transaction in the block validly spends existing UTXO set entries.
132132
133133
====getblocktxn====
134-
# The getblocktxn message is defined as as a message containing a serialized BlockTransactionsRequest message and pchCommand == "getblocktxn".
134+
# The getblocktxn message is defined as a message containing a serialized BlockTransactionsRequest message and pchCommand == "getblocktxn".
135135
# Upon receipt of a properly-formatted getblocktxn message, nodes which recently provided the sender of such a message a cmpctblock for the block hash identified in this message MUST respond with either an appropriate blocktxn message, or a full block message. A blocktxn response MUST contain exactly and only each transaction which is present in the appropriate block at the index specified in the getblocktxn indexes list, in the order requested.
136136
137137
====blocktxn====
138-
# The blocktxn message is defined as as a message containing a serialized BlockTransactions message and pchCommand == "blocktxn".
138+
# The blocktxn message is defined as a message containing a serialized BlockTransactions message and pchCommand == "blocktxn".
139139
# Upon receipt of a properly-formatted requested blocktxn message, nodes SHOULD attempt to reconstruct the full block by:
140140
## Taking the prefilledtxn transactions from the original cmpctblock and placing them in the marked positions.
141141
## For each short transaction ID from the original cmpctblock, in order, find the corresponding transaction either from the blocktxn message or from other sources and place it in the first available position in the block.
@@ -189,6 +189,8 @@ Compact blocks version 2 is almost identical to version 1, but supports segregat
189189
190190
# As high-bandwidth mode permits relaying of CMPCTBLOCK messages prior to full validation (requiring only that the block header is valid before relay), nodes SHOULD NOT ban a peer for announcing a new block with a CMPCTBLOCK message that is invalid, but has a valid header. For avoidance of doubt, nodes SHOULD bump their peer-to-peer protocol version to 70015 or higher to signal that they will not ban or punish a peer for announcing compact blocks prior to full validation, and nodes SHOULD NOT announce a CMPCTBLOCK to a peer with a version number below 70015 before fully validating the block.
191191
192+
# SPV nodes which implement this spec must consider the implications of accepting blocks which were not validated by the node which provided them. Especially SPV nodes which allow users to select a "trusted full node" to sync from may wish to avoid implementing this spec in high-bandwidth mode.
193+
192194
==Justification==
193195

194196
====Protocol design====

Diff for: scripts/buildtable.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
'OPL' => undef,
8686
'PD' => undef,
8787
);
88-
my %GrandfatheredPD = map { $_ => undef } qw(9 36 37 38 42 49 50 60 65 69 74 80 81 83 99 105 107 109 111 112 113 114 122 124 125 126 130 131 132 133 140 141 142 143 144 146 147 150 151 152);
89-
my %TolerateMissingLicense = map { $_ => undef } qw(1 10 11 12 13 14 15 16 17 18 19 20 21 22 23 30 31 32 33 34 35 39 43 44 45 47 61 62 64 66 67 68 70 71 72 73 75 101 102 103 106 120 121 123);
88+
my %GrandfatheredPD = map { $_ => undef } qw(9 36 37 38 42 49 50 60 65 67 69 74 80 81 83 90 99 105 107 109 111 112 113 114 122 124 125 126 130 131 132 133 140 141 142 143 144 146 147 150 151 152);
89+
my %TolerateMissingLicense = map { $_ => undef } qw(1 10 11 12 13 14 15 16 21 30 31 32 33 34 35 39 43 44 45 47 61 62 64 66 68 70 71 72 73 75 101 102 103 106 120 121 123);
9090

9191
my %emails;
9292

0 commit comments

Comments
 (0)