8 ms·
Why Is It Taking 20 Minutes to Mine This Bitcoin Block?
- CyrusL 9y ago"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 9y agoThis 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 9y agoCan you explain the multiple meanings you see in the question?
- deleted 9y ago[deleted]
- Spivak 9y ago* 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 9y ago>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.
- rajacombinator 9y agoWhat an appropriate username for that comment...! (Yes, the question is poorly worded.)
- tgb 9y agoDoesn't "If I uniformly randomly pick a point in time..." uniquely specify the latter?
- benchaney 9y agoI don't think the question is poorly stated, and all of your questions miss the interesting bit of this one, which is that you are more likely to randomly select a long interval rather than a short one.
- etoir 9y agoYour questions have been answered, by Poisson. (The answers are all e to the minus something or other.)
- lawlessone 9y agoWhat is the issue people have with Common core? seems to be just ideological.
- lisper 9y agoThe 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.
- alschwalm 9y agoThe 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-hitchhiking-on-the-road/ https://the8layers.com/2016/10/30/how-long-will-you-wait-hit...
- travisjungroth 9y agoThis 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 9y agoThat'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 9y agoThat'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).
- foota 9y agoWouldn't cross wind cancel out in average though? (even though head and tail winds don't)
- travisjungroth 9y agoNo, because you spend some of your forward speed flying into the wind to keep the desired ground track. Imagine an airplane that flies 100mph. You want to fly north, but you have a 90pmh crosswind from the east. You have to point almost directly into the wind just to keep from getting blown off course. You can turn a little to the north, and you'll go very slowly. If you instead have the wind come from the east, you still have the same problem. Maybe easier analogy: to get directly across a river, would you rather swim across one going fast or slow?
- nosuchthing 9y agoBitcoin 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.
- ilovecars2 9y agoThe excessive mempool size caused a lot of trouble for us when attempting to read it from bitcoind. Since the mempool was so large, JSON-RPC requests were taking upwards of 15-20 seconds. I’m surprised such a critical endpoint is so sub-optimised.
- SilasX 9y agoBCH 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 9y agoThis 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 9y agoNot 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-updated-new-difficulty-adjustment-algorithm-chosen/ https://news.bitcoin.com/bitcoin-cash-hard-fork-plans-update...
- memming 9y agoInspection paradox: https://en.wikipedia.org/wiki/Renewal_theory#The_inspection_paradox https://en.wikipedia.org/wiki/Renewal_theory#The_inspection_...
- ballenf 9y agoDoes 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).
- deleted 9y ago[deleted]
- viraptor 9y agoYou can see the whole history at https://bitinfocharts.com/comparison/bitcoin-confirmationtime.html https://bitinfocharts.com/comparison/bitcoin-confirmationtim...
- xyzzyz 9y ago> Final question -- do large mining operations network their miners so that they don't overlap their hashes. There is no need to do it -- if each miner has a source of true randomness, then it's enough that each miner randoms large number (how large, depends on the number of miners, see the birthday paradox), and slap it on to "salt" their block. If the number space is large enough, it is unlikely that two different miners will get the same salt.
- contravariant 9y ago> Does this mean that the second block from a random point in time is, on average, 20 minutes away? No, under the assumptions in this article the next block is on average 10 minutes away. The paradox is that at any random point in time the previous block will also have been, on average, 10 minutes ago. Meaning that if you pick a random point in time and wait for the next block then on average you'll wait for 10 minutes, but the block will have taken 20 minutes in total to mine. Despite the fact that blocks are only supposed to take 10 minutes on average.
- gtrubetskoy 9y ago
- sebbyBinx 9y agoThe 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
- ronyfadel 9y agoThis 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 9y agoI enjoy Statistics Done Wrong https://www.statisticsdonewrong.com https://www.statisticsdonewrong.com
- ronyfadel 9y agoThanks!
- gtrubetskoy 9y agoA 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.
- kristianp 9y agoThis 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 9y agoMost 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-target-block-time-chosen-to-be-10-minutes https://bitcoin.stackexchange.com/questions/1863/why-was-the...
- dlubarov 9y ago10 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/49318d3f56c1d525aabf7fda78b23fc0/P2P2013_041.pdf http://www.tik.ee.ethz.ch/file/49318d3f56c1d525aabf7fda78b23...
- jron 9y agoEthereum'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 9y ago
- rusbus 9y agoTLDR: 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 9y agoThanks. 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.
- axitanull 9y agoUnderstanding is one thing, explaining in layman or easy to undertand terms is another, and sometimes it takes a lot of effort.
- wickawic 9y agoExplaining is usually more difficult than understanding, as well.
- southpawflo 9y agoI've had multiple teachers tell me that if you can't explain something you don't completely understand it yet. grok what I'm saying? :)
- nostalgiac 9y agoI've heard this a few times but thoroughly disagree. Being able to explain/teach something to others is a very different skill to understanding it and isn't compulsory.
- anonytrary 9y agohttps://www.youtube.com/watch?v=FjHJ7FmV0M4 https://www.youtube.com/watch?v=FjHJ7FmV0M4 You guys would love Richard Feynman.
- marmaglade 9y agoThe 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 9y agoThis 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.
- natch 9y agopdf == probability density function
- jlhawn 9y agoI 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 9y agoI updated it with some comments explaining what's going on: https://play.golang.org/p/xEnlcwBX4CN https://play.golang.org/p/xEnlcwBX4CN
- fyfy18 9y agoSay 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.
- Retric 9y agoThere is zero benefit in waiting. Supose you had 1/3 of the hashing power and got it in the first second. You have a 1/3 chance of getting the extra block before someone else gets the first block and published risking your block. However, if you publish the first block you still have a 1/3 chance of getting the next block first and ending up with 2 blocks. Thus waiting provides risk but zero gain. In theory this changes if you can do a 51% attack, but that erodes trust in the block chain.
- rjp0008 9y agoThere is more than one solution to a block, so if someone does find it before you it's probably not the same solution. Making your head start worthless.
- benchaney 9y agoAdding to this. If two miners both discover a solution it is astronomically unlikely that it will be the same solution.
- mnw21cam 9y agoGiven that two different miners will be setting the mining fee address differently, I'd say that it is guaranteed that they will have different solutions.
- JeremyBanks 9y agoMore 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
- deleted 9y ago[deleted]
- tvladeck 9y ago> 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/e7a164dfe70fa765b10c1af64b382b02 https://gist.github.com/tvladeck/e7a164dfe70fa765b10c1af64b3...
- taejo 9y agoYou've made the exact mistake the article is talking about. You're weighting all blocks equally, but at any moment the current block is more likely to be one that was the current block for a long time.
- modeless 9y agoYou 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#Simulation https://en.wikipedia.org/wiki/Poisson_point_process#Simulati... With correct block times, I get ~20 minutes from your formula.
- tvladeck 9y agoahhh you're right
- waytogo 9y agoOT: 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 9y agohttps://www.goodreads.com/quotes/65213-briefly-stated-the-gell-mann-amnesia-effect-is-as-follows-you https://www.goodreads.com/quotes/65213-briefly-stated-the-ge... When it's in the topic of your domain expertise, you perceive HN to be incorrect, but in all other domains, to be right?
- deleted 9y ago[deleted]
- waytogo 9y agoMaybe most of the tech fields covered by HN are also of my domain expertise.
- dmitriid 9y ago> but often anti-blockchain This is precisely because of: "The upvoted stories, the comments, the discussion are of such a high quality. It's just the best resource to stay informed and educated in tech." If the best, the brightest, the most educated are anti-blockchain, there are definitely reasons for them to be. --- BTW. Is this true what the article is saying: it takes 10 minutes for a transaction to clear in bitcoin?
- modeless 9y agoYes, it takes 10 minutes on average for a transaction to be included in a block. Potentially much longer if you are unlucky or didn't pay a high enough fee. On top of that most places won't accept just one block. The standard is 6 blocks, so 1 hour on average. That's the price you pay for a truly trustless distributed system. Still (much) faster than ACH or wire transfers or securities trade settlement.
- Molaxx 9y agoVery nice explanation for the initiated. Thanks!
- meuk 9y agoI 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 9y agoIt'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 9y agoAs 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 9y agoThat's not what the OP is talking about. Trying re-reading his comment.
- tobiaswk 9y agoWith 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 9y agoThis 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.
- just_one_time_ 9y agoThis is a problem introduced into only the forked version of Bitcoin, Bitcoin Core/SegWit controlled by the company Blockstream, the original Bitcoin, and now Bitcoin Cash, do not suffer this problem as 0-confirmation transactions were not disabled (as they were in Bitcoin Core-SegWit). The only real questions here are: 1) why would the Core team disable this type of transaction? The answer is to force fees to increase which would push users onto their "2nd layer" solution products such as "Liquid"(R) or "Lightning"(R) Networks. 2) Why is anyone still using such a worthless cryptocurrency? That I don't know, Bitcoin Cash is Bitcoin now, Ethereum is Bitcoin 2.0 and already we have plenty of block space on literally thousands of other coins with no fees.
- anon335dtzbvc 9y agoHmm 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).