{"type":"rich","version":"1.0","author_name":"npub10r9d6edmnrljk59wsf06zqp494l3qtjpa3w245hy6t5euqxlzw2qdkgk2d","author_url":"https://nostr.ae/npub10r9d6edmnrljk59wsf06zqp494l3qtjpa3w245hy6t5euqxlzw2qdkgk2d","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2017-06-06\n📝 Original message:Due to the proposed calendar(https://segwit2x.github.io/) for the\nSegWit2x agreement being too slow to activate SegWit mandatory\nsignalling ahead of BIP148 using BIP91 I would like to propose another\noption that miners can use to prevent a chain split ahead of the Aug\n1st BIP148 activation date.\n\nThe splitprotection soft fork is essentially BIP91 but using BIP8\ninstead of BIP9 with a lower activation threshold and immediate\nmandatory signalling lock-in. This allows for a majority of miners to\nactivate mandatory SegWit signalling and prevent a potential chain\nsplit ahead of BIP148 activation.\n\nThis BIP allows for miners to respond to market forces quickly ahead\nof BIP148 activation by signalling for splitprotection. Any miners\nalready running BIP148 should be encouraged to use splitprotection.\n\n\u003cpre\u003e\n  BIP: splitprotection\n  Layer: Consensus (soft fork)\n  Title: User Activated Soft Fork Split Protection\n  Author: James Hilliard \u003cjames.hilliard1 at gmail.com\u003e\n  Comments-Summary: No comments yet.\n  Comments-URI:\n  Status: Draft\n  Type: Standards Track\n  Created: 2017-05-22\n  License: BSD-3-Clause\n           CC0-1.0\n\u003c/pre\u003e\n\n==Abstract==\n\nThis document specifies a coordination mechanism for a simple majority\nof miners to prevent a chain split ahead of BIP148 activation.\n\n==Definitions==\n\n\"existing segwit deployment\" refer to the BIP9 \"segwit\" deployment\nusing bit 1, between November 15th 2016 and November 15th 2017 to\nactivate BIP141, BIP143 and BIP147.\n\n==Motivation==\n\nThe biggest risk of BIP148 is an extended chain split, this BIP\nprovides a way for a simple majority of miners to eliminate that risk.\n\nThis BIP provides a way for a simple majority of miners to coordinate\nactivation of the existing segwit deployment with less than 95%\nhashpower before BIP148 activation. Due to time constraints unless\nimmediately deployed BIP91 will likely not be able to enforce\nmandatory signalling of segwit before the Aug 1st activation of\nBIP148. This BIP provides a method for rapid miner activation of\nSegWit mandatory signalling ahead of the BIP148 activation date. Since\nthe primary goal of this BIP is to reduce the chance of an extended\nchain split as much as possible we activate using a simple miner\nmajority of 65% over a 504 block interval rather than a higher\npercentage. This BIP also allows miners to signal their intention to\nrun BIP148 in order to prevent a chain split.\n\n==Specification==\n\nWhile this BIP is active, all blocks must set the nVersion header top\n3 bits to 001 together with bit field (1\u003c\u003c1) (according to the\nexisting segwit deployment). Blocks that do not signal as required\nwill be rejected.\n\n==Deployment==\n\nThis BIP will be deployed by \"version bits\" with a 65%(this can be\nadjusted if desired) activation threshold BIP9 with the name\n\"splitprotecion\" and using bit 2.\n\nThis BIP starts immediately and is a BIP8 style soft fork since\nmandatory signalling will start on midnight August 1st 2017 (epoch\ntime 1501545600) regardless of whether or not this BIP has reached its\nown signalling threshold. This BIP will cease to be active when segwit\nis locked-in.\n\n=== Reference implementation ===\n\n\u003cpre\u003e\n// Check if Segregated Witness is Locked In\nbool IsWitnessLockedIn(const CBlockIndex* pindexPrev, const\nConsensus::Params\u0026 params)\n{\n    LOCK(cs_main);\n    return (VersionBitsState(pindexPrev, params,\nConsensus::DEPLOYMENT_SEGWIT, versionbitscache) ==\nTHRESHOLD_LOCKED_IN);\n}\n\n// SPLITPROTECTION mandatory segwit signalling.\nif ( VersionBitsState(pindex-\u003epprev, chainparams.GetConsensus(),\nConsensus::DEPLOYMENT_SPLITPROTECTION, versionbitscache) ==\nTHRESHOLD_LOCKED_IN \u0026\u0026\n     !IsWitnessLockedIn(pindex-\u003epprev, chainparams.GetConsensus()) \u0026\u0026\n// Segwit is not locked in\n     !IsWitnessEnabled(pindex-\u003epprev, chainparams.GetConsensus()) ) //\nand is not active.\n{\n    bool fVersionBits = (pindex-\u003enVersion \u0026 VERSIONBITS_TOP_MASK) ==\nVERSIONBITS_TOP_BITS;\n    bool fSegbit = (pindex-\u003enVersion \u0026\nVersionBitsMask(chainparams.GetConsensus(),\nConsensus::DEPLOYMENT_SEGWIT)) != 0;\n    if (!(fVersionBits \u0026\u0026 fSegbit)) {\n        return state.DoS(0, error(\"ConnectBlock(): relayed block must\nsignal for segwit, please upgrade\"), REJECT_INVALID, \"bad-no-segwit\");\n    }\n}\n\n// BIP148 mandatory segwit signalling.\nint64_t nMedianTimePast = pindex-\u003eGetMedianTimePast();\nif ( (nMedianTimePast \u003e= 1501545600) \u0026\u0026  // Tue 01 Aug 2017 00:00:00 UTC\n     (nMedianTimePast \u003c= 1510704000) \u0026\u0026  // Wed 15 Nov 2017 00:00:00 UTC\n     (!IsWitnessLockedIn(pindex-\u003epprev, chainparams.GetConsensus()) \u0026\u0026\n // Segwit is not locked in\n      !IsWitnessEnabled(pindex-\u003epprev, chainparams.GetConsensus())) )\n // and is not active.\n{\n    bool fVersionBits = (pindex-\u003enVersion \u0026 VERSIONBITS_TOP_MASK) ==\nVERSIONBITS_TOP_BITS;\n    bool fSegbit = (pindex-\u003enVersion \u0026\nVersionBitsMask(chainparams.GetConsensus(),\nConsensus::DEPLOYMENT_SEGWIT)) != 0;\n    if (!(fVersionBits \u0026\u0026 fSegbit)) {\n        return state.DoS(0, error(\"ConnectBlock(): relayed block must\nsignal for segwit, please upgrade\"), REJECT_INVALID, \"bad-no-segwit\");\n    }\n}\n\u003c/pre\u003e\n\nhttps://github.com/bitcoin/bitcoin/compare/0.14...jameshilliard:splitprotection-v0.14.1\n\n==Backwards Compatibility==\n\nThis deployment is compatible with the existing \"segwit\" bit 1\ndeployment scheduled between midnight November 15th, 2016 and midnight\nNovember 15th, 2017. This deployment is also compatible with the\nexisting BIP148 deployment. This BIP is compatible with BIP91 only if\nBIP91 activates before it and before BIP148. Miners will need to\nupgrade their nodes to support splitprotection otherwise they may\nbuild on top of an invalid block. While this bip is active users\nshould either upgrade to splitprotection or wait for additional\nconfirmations when accepting payments.\n\n==Rationale==\n\nHistorically we have used IsSuperMajority() to activate soft forks\nsuch as BIP66 which has a mandatory signalling requirement for miners\nonce activated, this ensures that miners are aware of new rules being\nenforced. This technique can be leveraged to lower the signalling\nthreshold of a soft fork while it is in the process of being deployed\nin a backwards compatible way. We also use a BIP8 style timeout to\nensure that this BIP is compatible with BIP148 and that BIP148\ncompatible mandatory signalling activates regardless of miner\nsignalling levels.\n\nBy orphaning non-signalling blocks during the BIP9 bit 1 \"segwit\"\ndeployment, this BIP can cause the existing \"segwit\" deployment to\nactivate without needing to release a new deployment. As we approach\nBIP148 activation it may be desirable for a majority of miners to have\na method that will ensure that there is no chain split.\n\n==References==\n\n*[https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-March/013714.html\nMailing list discussion]\n*[https://github.com/bitcoin/bitcoin/blob/v0.6.0/src/main.cpp#L1281-L1283\nP2SH flag day activation]\n*[[bip-0009.mediawiki|BIP9 Version bits with timeout and delay]]\n*[[bip-0016.mediawiki|BIP16 Pay to Script Hash]]\n*[[bip-0091.mediawiki|BIP91 Reduced threshold Segwit MASF]]\n*[[bip-0141.mediawiki|BIP141 Segregated Witness (Consensus layer)]]\n*[[bip-0143.mediawiki|BIP143 Transaction Signature Verification for\nVersion 0 Witness Program]]\n*[[bip-0147.mediawiki|BIP147 Dealing with dummy stack element malleability]]\n*[[bip-0148.mediawiki|BIP148 Mandatory activation of segwit deployment]]\n*[[bip-0149.mediawiki|BIP149 Segregated Witness (second deployment)]]\n*[https://bitcoincore.org/en/2016/01/26/segwit-benefits/ Segwit benefits]\n\n==Copyright==\n\nThis document is dual licensed as BSD 3-clause, and Creative Commons\nCC0 1.0 Universal."}
