Hi all,
I'm compiling some statistics about the arrival time and I was surprised to find that the timestamp included in block n+1 can sometimes be earlier than that of the preceding block n.
The wiki in
https://en.bitcoin.it/wiki/Block_timestamp says it's ok:
A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours. "Network-adjusted time" is the median of the timestamps returned by all nodes connected to you.
Whenever a node connects to another node, it gets a UTC timestamp from it, and stores its offset from node-local UTC. The network-adjusted time is then the node-local UTC plus the median offset from all connected nodes. Network time is never adjusted more than 70 minutes from local system time, however.
So we have 2 times in a block: the miner timestamp, and the median time.
I want to classify these blocks by date, but depending on whether I choose the timestamp or the median time, the dates can be different (see below)
Height Timestamp Median time
17898 23/06/2009 23:19:42 23/06/2009 20:34:45
17899 23/06/2009 23:32:39 23/06/2009 21:05:33
17900 24/06/2009 00:12:58 23/06/2009 21:40:41 <--
17901 24/06/2009 00:35:19 23/06/2009 22:25:33 <--
17902 24/06/2009 01:04:59 23/06/2009 22:57:21 <--
My question is: which one would you choose?
If say you wanted to count the number of blocks on the 23rd, would you go with the timestamp or the median time?