Re:Bitcoin From Scratch – Part 1
by tromp on Saturday July 04, 2020 @04:06AM
(#23730900)
It is computed using only information embedded in the block chain, specifically the timestamps of blocks 2016 * i and 2016 * (i+1).
[ Parent
| on HN ]
But aren't blockchain timestamps unreliable? It was my understanding that difficulty was based on subjective node timestamps..
The miner embeds their current (local) timestamp in the header, so there can be small variations. In fact the only requirement on the next timestamp is that it not be less than the median of the past 11 timestamps.
Once embedded in the header, everyone will agree on past timestamps as they agree on the chain with the most accumulated difficulty.