4 ms·
If I'm stranded in Antarctica, and decide to compute hashes with my pocket calculator to pass the time, and drop the difficulty to zero (because I can do one ha
by Imnimo 6y ago
If I'm stranded in Antarctica, and decide to compute hashes with my pocket calculator to pass the time, and drop the difficulty to zero (because I can do one hash every 10 min, so they all have to be winners), does the bitcoin protocol say that my chain of empty blocks is a valid contender for longest chain? Or does "longest chain" also take into account difficulty? (Setting aside the obvious fact that in reality everyone would obviously just ignore me)
- ashtonkem 6y agoThis isn’t quite how the algorithm works. To make a valid block, you have to start with another valid block. The difficulty is set (edit: I was wrong, and I fixed this) every 2016 blocks based on how long they took to mine. This works out to about 2 weeks at the expected rate of mining. The average time of those 2016 blocks is then used to calculate the difficulty of the next 2016 blocks, and the difficulty is marked down in the chain itself. So in your hypothetical you’d have to solve around two weeks worth of blocks at the current difficulty level, which isn’t possible in a human lifespan. After that the difficulty for your chain would rapidly fall, but your sub-chain would already be very far behind and would never catch up.
- Imnimo 6y agoThat makes sense, I remembered that it adjusted every 2 weeks, but I forgot that the 2 weeks was actually measured in blocks, not wall time.
- benchaney 6y agoIn practice you wouldn’t be able to mine at all, because the difficulty updates infrequently, so you would have to mine several blocks at the old difficulty. Obviously this is impossible on a pocket calculator. I’ve always assumed that the notion of longest chain takes difficulty into account, although I haven’t really been able to find confirmation of this.