Triggering the BIP101 fork "early" with less than 75% miners

Emperor Bob

New Member
Aug 19, 2015
18
37
So Charles Lee has been warning about the risk of triggering BIP101 early due to a lucky mining streak. That isn't the only argument he's making, but he does state that "This means it can trigger with only 50% miner support + a lucky streak".

First, a theoretical note: It can trigger with one very puny, but very lucky XT miner solving 750 blocks in a row. A miner triggered fork can happen at any time, regardless of criteria, in theory.

So, when we say lucky, what do we really mean?

Assumption

First, some assumptions. We're going to define our problem in terms of:
  • A time period (defined in number of blocks): N
  • A target ratio of blocks: t
  • An actual ratio of hashrate: r
We're assuming the percentage of hashrate is constant. In practice this is the most pessimistic assumption you can expect to see:
  • If hash rate is increasing, then the net hashrate percentage when the fork triggers is higher than the average over the entire time period (more miners are on board than you'd get with steady state mining, which is a good thing).
  • If hash rate is decreasing then the fork is strictly less likely to trigger than in the preceding time period. It's more likely the fork would already have triggered.
The math
The total number of blocks with the flag (which we'll call X) is a random variable following a binomial distribution.
We can calculate the chance of a fork happening in a given N blocks by just calculating the cumulative probability function's value for N times t.

So what are the probabilities?

  • At 75% of hashrate we have a 51.7% chance of finding at least 750 blocks in the 1000 block span.
  • 74.9%: 48.8% chance
  • 74%: 24.8% chance
  • 70%: 0.0025% chance
  • Plug your own numbers here if you're curious about other percentages.

Now, this is for a single span of 1000 blocks. What if hash rate percentage stays at 70% forever? How long until we see a fork?

You may be tempted to just consider each separate 1000 block span independently (2000 blocks is 2 independent spans of 1000), but that will underestimate the probability, since the 750 can happen using part of one and part of the other.

You may instead consider each overlapping 1000 block span (so 1001 blocks is 2 independent spans of 1000), but the results of those are not independent, and so you'll massively overestimate the likelyhood of success.

Since I don't know a good math formula for this, I decided to simulate the damn thing. PM me if you want the code, but the approximate results are below:

  • At 75% of hashrate we would expect to take around 1269 blocks to trigger the fork
  • 74.9%: 1303 blocks
  • 74%: 1870 blocks
  • 72.5%: 5901 blocks
  • 70%: 301127 blocks

TL;DR: At anything less than 70% of steady hashrate, triggering a fork would take at least 6 years, and gets exponentially less likely as miner share decreases.
 

molecular

Active Member
Aug 31, 2015
372
1,391
> Since I don't know a good math formula for this, I decided to simulate the damn thing.

hehe, this made me laugh. I do this way too often and for problems too simple.

Thanks for those interesting results.

Of course it would've been cool to know the numbers for the 50% example given by Lee. I understand why you didn't post the probability from the calculator you linked: it's not precise enough and it says plainly "0".

I can also assume you didn't post results of your simulation for 50% because it's still running? ;-)

we can derive another TL;DR: triggering a fork with 50% mining support + lucky streak = it's not going to happen. Charles Lee might be fear-mongering.
 

solex

Moderator
Staff member
Aug 22, 2015
1,558
4,693
Charles Lee launched Litecoin, yet he is another hard-bitten 1MBer.
Clearly the odds of BIP101 triggering a fork with 50% mining support + lucky streak is as unlikely as a major asteroid strike while aliens are invading. Yet Charlie runs his mouth without putting his brain in gear.

Or is this yet another conflict of interest? Litecoin is the one enterprise best placed to gain traction if Bitcoin gets crippled.