As described in BIP-113. Wouldn't the last 12 blocks bring us closer to a one-hour offset (ie 120min, midpoint 60)?
3 Answers
BIP 113's goal is not to aim for a specific offset.
Its goal is guaranteeing monotonicity (treating every block's timestamp as strictly larger than the timestamp of each of its ancestors). It does this by leveraging the existing consensus rule which states that the median of the timestamp of a block has to be strictly larger than the median of its 11 predecessors.
As to why the number 11 eleven was chosen in that existing consensus rule, we don't know. It was chosen by Bitcoin's creator.
- 105,497
- 9
- 194
- 308
It is a median, not an average, thus it selects the 6th block's timestamp after sorting.
If you're a non-native English speaker, international maths heuristics can be quite tricky. Double-check on the Internet before translating into your head.
- 239
- 1
- 14
For posterity, I want to share what I now believe to be the reason why 11-blocks was chosen for the median_timestamp calculation.
By calculating a median timestamp value of the previous 11 blocks, we derive a best-effort assumption of when a block was mined, 6 blocks prior, while accounting for the fact that the timestamp field is inexact.
This is to say that by enforcing that the timestamp of the current block must be greater than the median_timestamp (the 'assumed actual timestamp') of the trailing 6th-prior block, we allow a 1-hour fluctuation (on average) to the value that a miner attaches to the current block.
Simply:
6 blocks ago = 1 hour ago (on average) = a reasonable round number in wall-time to allow for fluctuation, when assigning the current block's timestamp
thus it selects the 6th block's timestamp after sorting
I believe this is what Paul meant here ^^^ but hopefully this detailed explanation is helpful to others.
- 65
- 6
But thank you for your answer, it provided clear and helpful info!
– Paul Razvan Berg Jun 20 '18 at 22:46