CoinDesk Explainer: How BIP 91 Enacts SegWit While Avoiding a Bitcoin Split
While many thought signaling for the controversial scaling proposal Segwit2x wouldn't begin until July 21, bitcoin miners are now doing just that by way of a piece of code called BIP 91.
At press time, nearly 60% of the last 144 blocks mined have signaled support for the measure. But, what are miners signaling for, and what does bitcoin improvement proposal (BIP) 91 mean for the network?
As the first part of the SegWit2x scaling plan, BIP 91 does two things:
It makes it significantly easier for the network to adopt Segregated Witness (SegWit), a backward compatible upgrade that fixes transaction malleability and clears the path for off-chain solutions like Lightning Network.
If activated by July 31, BIP 91 will supersede BIP 148, a proposal that poses a risk of causing the network to split.
The basics
SegWit2x was introduced during CoinDesk's Consensus 2017 conference in May. Based on a fork of the Bitcoin Core software client called BTC1, SegWit2x seeks to both implement SegWit and raise the block size limit.
About a month later, in response to that, Bitmain Warranty engineer James Hilliard introduced BIP 91 as a way to implement SegWit quickly and safely, without the risk of splitting the network.
He specifically developed the proposal with two other active proposals for scaling bitcoin in mind.
These include:
BIP 141: Introduced in November 2016, BIP 141 is the original plan for activating SegWit.
BIP 148: Released in March, BIP 148 was developed as a way to push through the stalled BIP 141 via a user-activated soft fork (UASF).
But, more importantly, BIP 91 was proposed as an alternative to having to completely redeploy BIP 141, a task that would have been technically infeasible, given that BIP 141 does not expire until mid-November.
To explain further, bitcoin soft fork deployment requires that miners set a bit in the version field of blocks they mine to signal their readiness to enforce new rules. Segwit2x originally called for BIP 141 to require a "bit 4" signalling, but BIP 141 was already coded to respond to "bit 1" signalling.
So, to get around that, BIP 91 employs a clever trick. Rather than change the existing SegWit activation logic, it uses a secondary bit to signal mandatory enforcement of the original bit.
As such, BIP 91 uses the same BIP 9 soft fork deployment method as BIP 141, but with a few key differences:
Miners signal with "bit 4," as opposed to "bit 1"
Activation only requires 80% as opposed to 95% of hash power support
The activation window is 336 blocks, as opposed to 2,016.
So, once that 80% threshold is reached, BIP 91 locks in, and another 336 blocks later, it activates.
At that point, BIP 141 is enforced using the same technique as BIP 148:
Miners begin signaling with "bit 1"
Any blocks that do not signal with "bit 1" will be blocked from the network.
As long as 51% of miners (by hash power) enforce the mandatory "bit 1" signalling, the chain will not split. And since a majority will have already supported BIP 91 activation via the "bit 4" signalling, maintaining that hash power is unlikely to be a problem.
As an added incentive to signal for SegWit via "bit 1," those who do not will run the risk of losing their 12.5 bitcoin block reward.
Opposition and support
BIP 91 was also a recognition of the realities of the scaling debate.
Namely, the fact that, nearly a year down the road, BIP 141 still has not gained traction with miners. While BIP 141 requires a 95% miner support (by hash power), the figure has remained stuck at around 30%, though recently it increased to 45%.
But if BIP 91 is almost identical to BIP 141, why didn't miners signal support for the latter?
The reason is two-fold:
First was the high bar set to achieve activation. BIP 141 requires a super majority of miners to signal their readiness within a two-week (2,016 block) activation period.
Second, it is possible some miners were holding out for a block-size increase, a measure that has been embraced by the SegWit2x proposal.
A fast lane to SegWit
But, the proposal that has had the biggest impact on BIP 91's design is BIP 148, the so-called UASF discussed above.
In many ways, BIP 91 can be read as an effort to front-run the BIP 148 proposal, thus removing the potential of creating two rival bitcoin blockchains, each with competing assets.
To resolve that issue, Hilliard proposed that BIP 91 should activate before BIP 148's August 1 deadline. And of course, he made that possible by essentially shortening BIP 141's original two-week activation period to 56 hours.
Miners today are signaling their support for BIP 91 early because of the perceived need to avoid the split BIP 148 could create or, as others speculate, because some miners think that a successful UASF would reduce their control over network changes.
For now, your best bet is to watch the upcoming 336-block period. Beginning tonight at block 476,448, this is the next period during which miners can signal for BIP 91.
Should 226 blocks signal for BIP 91 within a 56-hour window, BIP 91 will lock-in, setting the stage for the next phase of SegWit2x this autumn, or possibly later.
And, with bitcoin's three largest mining pools throwing their computing power behind the effort, it is possible that the threshold will be reached before the end of the week.
Disclosure: CoinDesk is a subsidiary of Digital Currency Group, which helped organize the Segwit2x agreement.
Thanks for the deatailed explanation. I didn't understand the technical jargon and details, but I now have a basic understanding of what has gone down.
thank you for your vote and comment