Skip to content

Commit 2e0be67

Browse files
authored
Merge pull request bitcoin#501 from shaolinfry/bip-segwit-flagday
BIP 148: Mandatory activation of segwit deployment
2 parents 7e202d0 + ccef12c commit 2e0be67

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

README.mediawiki

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,13 @@ Those proposing changes should consider that ultimately consent may rest with th
638638
| Standard
639639
| Draft
640640
|-
641+
| [[bip-0148.mediawiki|148]]
642+
| Consensus (soft fork)
643+
| Mandatory activation of segwit deployment
644+
| Shaolin Fry
645+
| Standard
646+
| Draft
647+
|-
641648
| [[bip-0150.mediawiki|150]]
642649
| Peer Services
643650
| Peer Authentication

bip-0148.mediawiki

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<pre>
2+
BIP: 148
3+
Layer: Consensus (soft fork)
4+
Title: Mandatory activation of segwit deployment
5+
Author: Shaolin Fry <[email protected]>
6+
Comments-Summary: No comments yet.
7+
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0148
8+
Status: Draft
9+
Type: Standards Track
10+
Created: 2017-03-12
11+
License: BSD-3-Clause
12+
CC0-1.0
13+
</pre>
14+
15+
==Abstract==
16+
17+
This document specifies a BIP16 like soft fork flag day activation of the segregated witness BIP9 deployment known as "segwit".
18+
19+
==Definitions==
20+
21+
"existing segwit deployment" refer to the BIP9 "segwit" deployment using bit 1, between November 15th 2016 and November 15th 2017 to activate BIP141, BIP143 and BIP147.
22+
23+
==Motivation==
24+
25+
Segwit increases the blocksize, fixes transaction malleability, and makes scripting easier to upgrade as well as bringing many other [https://bitcoincore.org/en/2016/01/26/segwit-benefits/ benefits].
26+
27+
It is hoped that miners will respond to this BIP by activating segwit early, before this BIP takes effect. Otherwise this BIP will cause the mandatory activation of the existing segwit deployment before the end of midnight November 15th 2017.
28+
29+
==Specification==
30+
31+
All times are specified according to median past time.
32+
33+
This BIP will be activate between midnight October 1st 2017 (epoch time 1506816000) and midnight November 15th 2017 (epoch time 1510704000) if the existing segwit deployment is not activated before epoch time 1506816000. This BIP will cease to be active when the existing segwit deployment activates.
34+
35+
While this BIP is active, all blocks must set the nVersion header top 3 bits to 001 together with bit field (1<<1) (according to the existing segwit deployment). Blocks that do not signal as required will be rejected.
36+
37+
=== Reference implementation ===
38+
39+
<pre>
40+
// mandatory segwit activation between Oct 1st 2017 and Nov 15th 2017 inclusive
41+
if (pindex->GetMedianTimePast() >= 1506816000 && pindex->GetMedianTimePast() <= 1510704000 && !IsWitnessEnabled(pindex->pprev, chainparams.GetConsensus())) {
42+
if (!((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) && (pindex->nVersion & VersionBitsMask(params, Consensus::DEPLOYMENT_SEGWIT)) != 0) {
43+
return state.DoS(0, error("ConnectBlock(): relayed block must signal for segwit, please upgrade"), REJECT_INVALID, "bad-no-segwit");
44+
}
45+
}
46+
</pre>
47+
48+
https://github.com/bitcoin/bitcoin/compare/master...shaolinfry:bip-segwit-flagday
49+
50+
==Backwards Compatibility==
51+
52+
This deployment is compatible with the existing "segwit" bit 1 deployment scheduled between midnight November 15th, 2016 and midnight November 15th, 2017.
53+
54+
==Rationale==
55+
56+
Historically, the P2SH soft fork (BIP16) was activated using a predetermined flag day where nodes began enforcing the new rules. P2SH was successfully activated with relatively few issues
57+
58+
By orphaning non-signalling blocks during the last month of the BIP9 bit 1 "segwit" deployment, this BIP can cause the existing "segwit" deployment to activate without needing to release a new deployment.
59+
60+
==References==
61+
62+
*[https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-March/013714.html Mailing list discussion]
63+
*[https://github.com/bitcoin/bitcoin/blob/v0.6.0/src/main.cpp#L1281-L1283 P2SH flag day activation]
64+
*[[bip-0009.mediawiki|BIP9 Version bits with timeout and delay]]
65+
*[[bip-0016.mediawiki|BIP16 Pay to Script Hash]]
66+
*[[bip-0141.mediawiki|BIP141 Segregated Witness (Consensus layer)]]
67+
*[[bip-0143.mediawiki|BIP143 Transaction Signature Verification for Version 0 Witness Program]]
68+
*[[bip-0147.mediawiki|BIP147 Dealing with dummy stack element malleability]]
69+
*[https://bitcoincore.org/en/2016/01/26/segwit-benefits/ Segwit benefits]
70+
71+
==Copyright==
72+
73+
This document dual licensed as BSD-3-Clause and CC0-1.0.
74+

0 commit comments

Comments
 (0)