
Why Is It Taking 20 Minutes to Mine This Bitcoin Block? - CyrusL
http://r6.ca/blog/20180225T160548Z.html
======
alschwalm
The article on the "hitchhiker's paradox" that this links to made this much
more clear to me (as well as being shorter):
[https://the8layers.com/2016/10/30/how-long-will-you-wait-
hit...](https://the8layers.com/2016/10/30/how-long-will-you-wait-hitchhiking-
on-the-road/)

~~~
travisjungroth
This reminds me of headwinds in airplanes. You might think that on average,
wind cancels out. Sometimes you have a tailwind, sometimes you have a headwind
and over time it will all average out. This is not the case.

On average, wind reduces your groundspeed. The short of it is you spend more
time in a headwind, so you spend more time experiencing the bad than good.

There's also the fact that even a direct crosswind slows down you ground speed
(you lose some speed for correcting your course) but I don't think this
compares to block chains or hitchhikers.

~~~
foota
That's really neat, thanks!

An interesting related fact is that with equal distance traveled through
headwinds and tailwinds a slower plane will be relatively more affected. From
~12% longer time with a wind speed 1/3rd plane speed down to ~1% with a wind
speed 1/10th plane speed.

~~~
travisjungroth
That's one of the reasons it's easier to navigate in a fast airplane than a
slow one (another being you see more ground in the same amount of time).

------
meuk
I have been thinking about this as well, in another context. When I am at the
tennis court, I always seem to be surrounded by players which are far above
average.

This seems paradoxical, but you're more likely to meet the players which train
most often, and they are also most likely to be the best tennis players.

~~~
gowld
It's also the reason why most people are less popular than their average
friend is, even though they are (on average) as popular as the average person!
Since popular people are on everyone's friend list, but unpopular people are
only on a few friend lists, your friend list is biased toward popular people.

Mathematical explanation of why Facebook makes you depressed.

~~~
mkirklions
As someone that has more friends('popular'), its all a matter of effort.

I go out every weekend, I talk to everyone, I ask everyone for follow up
contact info.

Yeah I get turned down probably 50% of the time, but its a numbers game.
Sometimes you meet incredible people, but its taking that first step that
matters.

Anyway, if you want to meet people, always go to events you are invited to,
meet people. No one remembers how a conversation starts, people that are weird
about communication are forgettable.

~~~
csomar
That's not what the OP is talking about. Trying re-reading his comment.

------
nosuchthing
Bitcoin mining = "Guess a random number between 1 and 5"

If the network guesses too fast due to more cumulative guesses per second, the
target number increases.

Interesting historical antidote, in early November of 2017 there was an event
where it became more profitable to mine Bitcoin Cash. During that time about
60% of the miners left BTC Core in unison to focus on BTC Cash. Transactions
for BTC Core started taking upwards two to three times as long as there wasn't
enough hash power to guess the magic number in time.

Eventually the miners returned to mine BTC core and transaction times returned
to normal, other than the backlog in the memory pool that built up during that
period.

~~~
SilasX
BCH is frequently more profitable than BTC -- the mining power constantly
oscillates between the two.

Checkout fork.lol which tracks DARI, an estimate of the profitability of
mining the coin, you see how the more profitable one frequently switches:

[https://fork.lol/reward/dari/btc](https://fork.lol/reward/dari/btc)

~~~
rory096
This is of course not surprising - in the long run all difficulties (for
similarly hashed coins) should trend towards equalizing profitability lest
they create an arbitrage opportunity. The driving factor in the grandparent's
case was the short-term spike in BCH after it was listed on Coinbase.

~~~
nosuchthing
Not entirely. There was a flaw/feature in the difficulty algo for BTC Cash
that allowed miners to generate a significant quantity of blocks very rapidly.

[https://news.bitcoin.com/bitcoin-cash-hard-fork-plans-
update...](https://news.bitcoin.com/bitcoin-cash-hard-fork-plans-updated-new-
difficulty-adjustment-algorithm-chosen/)

------
CyrusL
"Assume a hashrate and difficulty corresponding to 1 block per 10 minutes. If
I uniformly randomly pick a point in time, what is the expected time between
the previous block and the next block?"

[https://twitter.com/pwuille/status/967878361782652928](https://twitter.com/pwuille/status/967878361782652928)

~~~
zaroth
This is like a common core math problem. Poorly worded to the point of
obscuring any real math talent that could be applied in finding a “correct”
result, and instead we get to debate what the question _means_.

A more interesting question, I think, is given a POW algorithm which adjusts
difficultly to target a 10 minute block rate, and assuming network hash rate
is constant and propagation is instant, what percentage of blocks take 20
minutes to solve? 60 minutes? And what’s the odds of solving two blocks in <=
60 seconds?

~~~
hexane360
Can you explain the multiple meanings you see in the question?

~~~
Spivak
* What is the average time it takes to mine a block?

* If I choose a time uniformly what is the expected time it will take to mine that particular block.

The difference between them being that blocks that take a long time occupy
more space on the timeline than shorter blocks and are therefore more likely
to be chosen.

~~~
gizmo686
>What is the average time it takes to mine a block?

How do you get this question from CyrusL's original question? CyrusL
explicitly specifies that it is 10 minutes per block [0], and that he is
uniformly picking a point in time.

[0] Admittedly, he does not specify that it is a Poisson distribution.

------
kristianp
This is why I like block times of 2.5 minutes that Litecoin does. Rarely the
block takes over 4 minutes. So even if it takes a couple of blocks, it's still
within 10 minutes. Even 5 minutes a block would be better than bitcoin's 10.
With bitcoin, if you put a reasonable fee, but your transaction doesn't make
the next block, it can take more than an hour, which makes impractical certain
transaction types like online shopping.

~~~
oska
Most simple criticisms of why Bitcoin does things the way it does and then
suggestions for simple ‘improvements’ such as yours (5 minute interval) tend
to be naive and wrong. The 10 minute interval for Bitcoin transactions was
chosen as the best tradeoff to balance pros and cons for making it shorter or
longer.

Stackexchange has a good discussion on the topic:

[https://bitcoin.stackexchange.com/questions/1863/why-was-
the...](https://bitcoin.stackexchange.com/questions/1863/why-was-the-target-
block-time-chosen-to-be-10-minutes)

~~~
dlubarov
10 minutes was Satoshi's very rough guess at what a reasonable compromise
might be. He didn't have any empirical data and probably didn't give it much
thought. Since then we have some real data about propagation times, e.g. [1],
and most other blockchains have chosen much faster block times, like ~12s for
Ethereum.

[1]
[http://www.tik.ee.ethz.ch/file/49318d3f56c1d525aabf7fda78b23...](http://www.tik.ee.ethz.ch/file/49318d3f56c1d525aabf7fda78b23fc0/P2P2013_041.pdf)

~~~
jron
Ethereum's security model is totally different:
[https://eprint.iacr.org/2016/555.pdf](https://eprint.iacr.org/2016/555.pdf)
If you look at bitcoin based POW intervals, 10 minutes is very close to
optimal:
[https://eprint.iacr.org/2015/1019.pdf](https://eprint.iacr.org/2015/1019.pdf)

~~~
dlubarov
According to figure 2 in your second link, a blockchain with 1.5 rounds per
block (or one block every ~19 seconds, based on their round length estimate)
can withstand at least 40% hash power attacks. That seems like a reasonable
tradeoff to me.

If you think 40% is not good enough, okay, let's target 48%. That's still just
~6.5 rounds per block (~82 seconds per block). Bitcoin's parameter of ~47
rounds per block is clearly overkill; the authors' graphs don't even go that
far out (see figure 3).

Interestingly, the first paper you linked mentions that although Ethereum was
_intended_ to use single-level GHOST scoring, uncle blocks aren't actually
counted toward chain difficulty, so it really has the same security model as
Bitcoin. This was also confirmed by an Ethereum dev [1].

[1]
[https://ethereum.stackexchange.com/a/13750](https://ethereum.stackexchange.com/a/13750)

------
fyfy18
Say you have 10,000 miners, once you find a hash you can start all your miners
mining the next block. Can you use the time between blocks to your advantage?

If you find the hash after say 6 minutes, you could delay broadcasting the
block to the network for another minute or two, and give yourself an
advantage.

Yes there’s a risk another miner would find the same hash, but statistically
you could estimate the optimal delay for risk vs reward.

~~~
JeremyBanks
More or less, yes. This is a known minor weakness in the protocol. See
[https://arxiv.org/abs/1311.0243](https://arxiv.org/abs/1311.0243)

~~~
mihaifm
Interesting. Any ideas if this is indeed a realistic scenario, or if it has
been addressed yet?

------
gtrubetskoy
A related statistical "mystery" is the miner cooperation without communication
property of Proof-of-Work I describe here:
[https://grisha.org/blog/2018/01/23/explaining-proof-of-
work/](https://grisha.org/blog/2018/01/23/explaining-proof-of-work/) It too is
rooted in that the mining problem is progress-free.

Contemplating adding the "20 minute paradox" as a section since I already
explain the foundational principles in the write-up.

------
sebbyBinx
The timing of block arrivals also greatly affects the guarantees against
double spending, so this paradox may have some security implications.

Accepting transactions blindly after 5 confirmations/blocks throws away the
information of the amount of time it takes to generate those blocks

[https://eprint.iacr.org/2018/040](https://eprint.iacr.org/2018/040)

------
lisper
The Monty Hall problem for the 21st century.

Note that the dependency of the expected value on sampling method also show up
in other places, like Benford's law. The expected value of the first digit of
a number drawn from a uniform distribution depends on how the upper bound of
that distribution is chosen.

------
marmaglade
The hitchhiker's paradox is correct, taking a point and looking backward or
forward will correctly give an average event 10 minutes away, but combining
the events to give an average of 20 minutes is false. Two events have been
chosen resulting in a conditional probability.

Put more clearly, an event happens on average 10 minutes in the past, but
using the same starting point for the event in the future links the events
with a dependency. We could also arbitrarily start looking forward at the
instance of the event in the past, or another random point in time.

~~~
gowld
This is simply incorrect, and the (hypothetical) burden is on you to disprove
the theoretical and empirical results that have been shown to prove the
solution.

The conditional probability is equal to the unconditional probability,
specifically because the Poisson model (which Bitcoin hashing approximates) is
a model of fully independent events.

------
jlhawn
I wrote a quick little program to sort of prove this to myself:
[https://play.golang.org/p/fITZrZgzTT7](https://play.golang.org/p/fITZrZgzTT7)

While the average difference in time between one record and the next is 10,
the weighted average over the entire duration is 20.

~~~
jlhawn
I updated it with some comments explaining what's going on:
[https://play.golang.org/p/xEnlcwBX4CN](https://play.golang.org/p/xEnlcwBX4CN)

------
memming
Inspection paradox:
[https://en.wikipedia.org/wiki/Renewal_theory#The_inspection_...](https://en.wikipedia.org/wiki/Renewal_theory#The_inspection_paradox)

------
tvladeck
> Correct, that is exactly what I am saying. If you pick a random point in
> time, you expect 20 minutes between the previous block and the next block on
> average.

I thought this sounded funny, and I did a little simulation to see if it was
correct. Given his assumptions (poisson with lambda 10), you do not get that
answer. I got right around 10, which is what I would expect.

[https://gist.github.com/tvladeck/e7a164dfe70fa765b10c1af64b3...](https://gist.github.com/tvladeck/e7a164dfe70fa765b10c1af64b382b02)

~~~
modeless
You are using rpois as if it returned the time between blocks, but that's
wrong. It returns a _count_ of blocks mined in a certain amount of time.

Here is a formula to calculate your cumulative_times array correctly for a
10,000 minute period (which is expected to generate 1,000 blocks but may vary
of course):

    
    
        minutes = 10000
        cumulative_times <- sort(runif(rpois(1, minutes/10), 0, minutes))
    

See
[https://en.wikipedia.org/wiki/Poisson_point_process#Simulati...](https://en.wikipedia.org/wiki/Poisson_point_process#Simulation)

With correct block times, I get ~20 minutes from your formula.

~~~
tvladeck
ahhh you're right

------
ballenf
Does this mean that the second block from a random point in time is, on
average, 20 minutes away?

Anyone know what the longest wait time on a block in recent history was?

Final question -- do large mining operations network their miners so that they
don't overlap their hashes. I'm thinking the overhead in doing that would
probably be counter-productive given the massive problem space. But, if they
were networked that then the probability would eventually go down for a long
enough wait between blocks (assuming there exists some massive mining
operation).

~~~
sebbyBinx
There was a 1.5 hour gap after this block:

[https://blockchain.info/block-height/152217](https://blockchain.info/block-
height/152217)

~~~
branx
I'm confused...it says the Block Reward was 50BTC but I thought that miners
are only supposed to get 1 per block?

------
tobiaswk
With bitcoin (not bitcoin cash) the difficulty is adjusted every 2016 blocks.
If too many blocks were mined in this period the difficulty will decrease and
vice versa. This means that many blocks could be mined faster or slower in
this period. Until of course the difficulty adjustment occurs again. You use
what is called the nonce in the block header. Each time you do a hash of the
block you increment this nonce. If your hash is under or equal to the
difficulty the block is valid. The difficulty essentially means how many
zeroes are in front of your hash.

What big mining operations do is to slice this nonce into appropriate ranges
for each miner. So no miner is hashing with the same nonce. So miner 1 starts
at nonce=0 and miner 2 on nonce=2000. The nonce range depends on how many
hashes each miner can do in a ten minutes span. By doing this each miner is
not doing hashing with the same nonce. That would be wasting hashing
operations.

Now bitcoin cash changed the difficulty adjustment algorithm (DAA). Instead of
adjusting the difficulty every 2016 blocks this is done after each block has
been found. This was done to stabilize the difficulty. So miners stay mining
bitcoin cash instead of switching between the most profitable chain (bitcoin
or bitcoin cash). This was a problem before the new DAA was implemented for
bitcoin cash.

There has been times in recent history were no new block was found for 20
minutes on bitcoin. For bitcoin cash around 2 hours. This was in November
2017. It has been 10 minutes stable ever since.

You can check this yourself on bitinfocharts.com for each blockchain under
Block Time.

~~~
eterm
This article is completely independent of difficultly adjustment. The 20
minute average gap is a consequence of bitcoin mining being a Poisson process
and the lack of memory property that follows.

------
anon335dtzbvc
Hmm if this is similar to the hitchhiker’s paradoxon, then one would expect to
wait 5 min for the next block by intuition, which is wrong and we have to wait
10 minutes. But i do not get why the intuition should be wrong by a factor of
4x (20 mins) instead by a factor of 2x (10 mins).

------
ronyfadel
This was an enjoyable read. Slightly off-topic: are there any books that
approach Probability in a fun way? (i.e. that I can read on the train)

~~~
bgschiller
I enjoy Statistics Done Wrong
[https://www.statisticsdonewrong.com](https://www.statisticsdonewrong.com)

~~~
ronyfadel
Thanks!

------
Molaxx
Very nice explanation for the initiated. Thanks!

------
natch
pdf == probability density function

------
rusbus
TLDR: Since blocks that take a long time to mine fill up more wall-clock time,
if you pick an arbitrary instant of wall clock time, you're more likely to be
in a "slow" block than a fast block. Specifically, you expect to wait 2x the
average.

~~~
justonepost
Thanks. Why can't all math teachers talk like that? I mean... I know you're
clever and all, but if you were really clever you'd explain it in a way that's
easy to understand.

Still, kudos to the OP. That was a great attempt to be precise.

~~~
modeless
That simple explanation is exactly wrong though! You don't expect to _wait_ 2x
the average. You expect to wait 1x the average, but you also expect that when
you _start_ waiting the previous block happened 1x the average time ago, and
1+1=2.

~~~
lordnacho
This is the best explanation of the phenomenon. Simple and actually explains
why it's 2x and not 3x or 4x.

~~~
thaumasiotes
Is it actually true though? Compare these two comments buried downthread:

[https://news.ycombinator.com/item?id=16470358](https://news.ycombinator.com/item?id=16470358)

> The hitchhiker's paradox is correct, taking a point and looking backward or
> forward will correctly give an average event 10 minutes away, but combining
> the events to give an average of 20 minutes is false.

[https://news.ycombinator.com/item?id=16471544](https://news.ycombinator.com/item?id=16471544)

> I thought this sounded funny, and I did a little simulation to see if it was
> correct. Given his assumptions (poisson with lambda 10), you do not get that
> answer. I got right around 10, which is what I would expect.

~~~
modeless
Yes, it is true. I'm not sure what the first commenter is trying to say
exactly. The second commenter's code was wrong, and correcting it gives the
expected 20 minute average period.

------
waytogo
OT: From my perspective, HN is the reference regarding tech content. The
upvoted stories, the comments, the discussions are of such a high quality.
It's just the best resource to stay informed and educated in tech.

Surprisingly this is not true with Blockchain topics. Upvoted Blockchain
stories feel ok but not that relevant or often random. Comments, discussions
are sometimes constuctive (like this one) but often anti-blockchain or of low
quality.

~~~
sbierwagen
[https://www.goodreads.com/quotes/65213-briefly-stated-the-
ge...](https://www.goodreads.com/quotes/65213-briefly-stated-the-gell-mann-
amnesia-effect-is-as-follows-you)

When it's in the topic of your domain expertise, you perceive HN to be
incorrect, but in all other domains, to be right?

~~~
waytogo
Maybe most of the tech fields covered by HN are also of my domain expertise.

