<oembed><type>rich</type><version>1.0</version><author_name>npub10r9d6edmnrljk59wsf06zqp494l3qtjpa3w245hy6t5euqxlzw2qdkgk2d</author_name><author_url>https://nostr.ae/npub10r9d6edmnrljk59wsf06zqp494l3qtjpa3w245hy6t5euqxlzw2qdkgk2d</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-06-06&#xA;📝 Original message:Due to the proposed calendar(https://segwit2x.github.io/) for the&#xA;SegWit2x agreement being too slow to activate SegWit mandatory&#xA;signalling ahead of BIP148 using BIP91 I would like to propose another&#xA;option that miners can use to prevent a chain split ahead of the Aug&#xA;1st BIP148 activation date.&#xA;&#xA;The splitprotection soft fork is essentially BIP91 but using BIP8&#xA;instead of BIP9 with a lower activation threshold and immediate&#xA;mandatory signalling lock-in. This allows for a majority of miners to&#xA;activate mandatory SegWit signalling and prevent a potential chain&#xA;split ahead of BIP148 activation.&#xA;&#xA;This BIP allows for miners to respond to market forces quickly ahead&#xA;of BIP148 activation by signalling for splitprotection. Any miners&#xA;already running BIP148 should be encouraged to use splitprotection.&#xA;&#xA;&lt;pre&gt;&#xA;  BIP: splitprotection&#xA;  Layer: Consensus (soft fork)&#xA;  Title: User Activated Soft Fork Split Protection&#xA;  Author: James Hilliard &lt;james.hilliard1 at gmail.com&gt;&#xA;  Comments-Summary: No comments yet.&#xA;  Comments-URI:&#xA;  Status: Draft&#xA;  Type: Standards Track&#xA;  Created: 2017-05-22&#xA;  License: BSD-3-Clause&#xA;           CC0-1.0&#xA;&lt;/pre&gt;&#xA;&#xA;==Abstract==&#xA;&#xA;This document specifies a coordination mechanism for a simple majority&#xA;of miners to prevent a chain split ahead of BIP148 activation.&#xA;&#xA;==Definitions==&#xA;&#xA;&#34;existing segwit deployment&#34; refer to the BIP9 &#34;segwit&#34; deployment&#xA;using bit 1, between November 15th 2016 and November 15th 2017 to&#xA;activate BIP141, BIP143 and BIP147.&#xA;&#xA;==Motivation==&#xA;&#xA;The biggest risk of BIP148 is an extended chain split, this BIP&#xA;provides a way for a simple majority of miners to eliminate that risk.&#xA;&#xA;This BIP provides a way for a simple majority of miners to coordinate&#xA;activation of the existing segwit deployment with less than 95%&#xA;hashpower before BIP148 activation. Due to time constraints unless&#xA;immediately deployed BIP91 will likely not be able to enforce&#xA;mandatory signalling of segwit before the Aug 1st activation of&#xA;BIP148. This BIP provides a method for rapid miner activation of&#xA;SegWit mandatory signalling ahead of the BIP148 activation date. Since&#xA;the primary goal of this BIP is to reduce the chance of an extended&#xA;chain split as much as possible we activate using a simple miner&#xA;majority of 65% over a 504 block interval rather than a higher&#xA;percentage. This BIP also allows miners to signal their intention to&#xA;run BIP148 in order to prevent a chain split.&#xA;&#xA;==Specification==&#xA;&#xA;While this BIP is active, all blocks must set the nVersion header top&#xA;3 bits to 001 together with bit field (1&lt;&lt;1) (according to the&#xA;existing segwit deployment). Blocks that do not signal as required&#xA;will be rejected.&#xA;&#xA;==Deployment==&#xA;&#xA;This BIP will be deployed by &#34;version bits&#34; with a 65%(this can be&#xA;adjusted if desired) activation threshold BIP9 with the name&#xA;&#34;splitprotecion&#34; and using bit 2.&#xA;&#xA;This BIP starts immediately and is a BIP8 style soft fork since&#xA;mandatory signalling will start on midnight August 1st 2017 (epoch&#xA;time 1501545600) regardless of whether or not this BIP has reached its&#xA;own signalling threshold. This BIP will cease to be active when segwit&#xA;is locked-in.&#xA;&#xA;=== Reference implementation ===&#xA;&#xA;&lt;pre&gt;&#xA;// Check if Segregated Witness is Locked In&#xA;bool IsWitnessLockedIn(const CBlockIndex* pindexPrev, const&#xA;Consensus::Params&amp; params)&#xA;{&#xA;    LOCK(cs_main);&#xA;    return (VersionBitsState(pindexPrev, params,&#xA;Consensus::DEPLOYMENT_SEGWIT, versionbitscache) ==&#xA;THRESHOLD_LOCKED_IN);&#xA;}&#xA;&#xA;// SPLITPROTECTION mandatory segwit signalling.&#xA;if ( VersionBitsState(pindex-&gt;pprev, chainparams.GetConsensus(),&#xA;Consensus::DEPLOYMENT_SPLITPROTECTION, versionbitscache) ==&#xA;THRESHOLD_LOCKED_IN &amp;&amp;&#xA;     !IsWitnessLockedIn(pindex-&gt;pprev, chainparams.GetConsensus()) &amp;&amp;&#xA;// Segwit is not locked in&#xA;     !IsWitnessEnabled(pindex-&gt;pprev, chainparams.GetConsensus()) ) //&#xA;and is not active.&#xA;{&#xA;    bool fVersionBits = (pindex-&gt;nVersion &amp; VERSIONBITS_TOP_MASK) ==&#xA;VERSIONBITS_TOP_BITS;&#xA;    bool fSegbit = (pindex-&gt;nVersion &amp;&#xA;VersionBitsMask(chainparams.GetConsensus(),&#xA;Consensus::DEPLOYMENT_SEGWIT)) != 0;&#xA;    if (!(fVersionBits &amp;&amp; fSegbit)) {&#xA;        return state.DoS(0, error(&#34;ConnectBlock(): relayed block must&#xA;signal for segwit, please upgrade&#34;), REJECT_INVALID, &#34;bad-no-segwit&#34;);&#xA;    }&#xA;}&#xA;&#xA;// BIP148 mandatory segwit signalling.&#xA;int64_t nMedianTimePast = pindex-&gt;GetMedianTimePast();&#xA;if ( (nMedianTimePast &gt;= 1501545600) &amp;&amp;  // Tue 01 Aug 2017 00:00:00 UTC&#xA;     (nMedianTimePast &lt;= 1510704000) &amp;&amp;  // Wed 15 Nov 2017 00:00:00 UTC&#xA;     (!IsWitnessLockedIn(pindex-&gt;pprev, chainparams.GetConsensus()) &amp;&amp;&#xA; // Segwit is not locked in&#xA;      !IsWitnessEnabled(pindex-&gt;pprev, chainparams.GetConsensus())) )&#xA; // and is not active.&#xA;{&#xA;    bool fVersionBits = (pindex-&gt;nVersion &amp; VERSIONBITS_TOP_MASK) ==&#xA;VERSIONBITS_TOP_BITS;&#xA;    bool fSegbit = (pindex-&gt;nVersion &amp;&#xA;VersionBitsMask(chainparams.GetConsensus(),&#xA;Consensus::DEPLOYMENT_SEGWIT)) != 0;&#xA;    if (!(fVersionBits &amp;&amp; fSegbit)) {&#xA;        return state.DoS(0, error(&#34;ConnectBlock(): relayed block must&#xA;signal for segwit, please upgrade&#34;), REJECT_INVALID, &#34;bad-no-segwit&#34;);&#xA;    }&#xA;}&#xA;&lt;/pre&gt;&#xA;&#xA;https://github.com/bitcoin/bitcoin/compare/0.14...jameshilliard:splitprotection-v0.14.1&#xA;&#xA;==Backwards Compatibility==&#xA;&#xA;This deployment is compatible with the existing &#34;segwit&#34; bit 1&#xA;deployment scheduled between midnight November 15th, 2016 and midnight&#xA;November 15th, 2017. This deployment is also compatible with the&#xA;existing BIP148 deployment. This BIP is compatible with BIP91 only if&#xA;BIP91 activates before it and before BIP148. Miners will need to&#xA;upgrade their nodes to support splitprotection otherwise they may&#xA;build on top of an invalid block. While this bip is active users&#xA;should either upgrade to splitprotection or wait for additional&#xA;confirmations when accepting payments.&#xA;&#xA;==Rationale==&#xA;&#xA;Historically we have used IsSuperMajority() to activate soft forks&#xA;such as BIP66 which has a mandatory signalling requirement for miners&#xA;once activated, this ensures that miners are aware of new rules being&#xA;enforced. This technique can be leveraged to lower the signalling&#xA;threshold of a soft fork while it is in the process of being deployed&#xA;in a backwards compatible way. We also use a BIP8 style timeout to&#xA;ensure that this BIP is compatible with BIP148 and that BIP148&#xA;compatible mandatory signalling activates regardless of miner&#xA;signalling levels.&#xA;&#xA;By orphaning non-signalling blocks during the BIP9 bit 1 &#34;segwit&#34;&#xA;deployment, this BIP can cause the existing &#34;segwit&#34; deployment to&#xA;activate without needing to release a new deployment. As we approach&#xA;BIP148 activation it may be desirable for a majority of miners to have&#xA;a method that will ensure that there is no chain split.&#xA;&#xA;==References==&#xA;&#xA;*[https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-March/013714.html&#xA;Mailing list discussion]&#xA;*[https://github.com/bitcoin/bitcoin/blob/v0.6.0/src/main.cpp#L1281-L1283&#xA;P2SH flag day activation]&#xA;*[[bip-0009.mediawiki|BIP9 Version bits with timeout and delay]]&#xA;*[[bip-0016.mediawiki|BIP16 Pay to Script Hash]]&#xA;*[[bip-0091.mediawiki|BIP91 Reduced threshold Segwit MASF]]&#xA;*[[bip-0141.mediawiki|BIP141 Segregated Witness (Consensus layer)]]&#xA;*[[bip-0143.mediawiki|BIP143 Transaction Signature Verification for&#xA;Version 0 Witness Program]]&#xA;*[[bip-0147.mediawiki|BIP147 Dealing with dummy stack element malleability]]&#xA;*[[bip-0148.mediawiki|BIP148 Mandatory activation of segwit deployment]]&#xA;*[[bip-0149.mediawiki|BIP149 Segregated Witness (second deployment)]]&#xA;*[https://bitcoincore.org/en/2016/01/26/segwit-benefits/ Segwit benefits]&#xA;&#xA;==Copyright==&#xA;&#xA;This document is dual licensed as BSD 3-clause, and Creative Commons&#xA;CC0 1.0 Universal.</html></oembed>