The timestamps starting at block 145044 are:

145044: 2011-09-12 15:46:39     
145045: 2011-09-12 16:05:07 
145046: 2011-09-12 16:00:05 // ~5 minutes before prior block
145047: 2011-09-12 15:53:36 // ~7 & ~12 minutes before 2 prior blocks
145048: 2011-09-12 16:04:06 // after 2 prior blocks but still before 145045

How does this occur?

  • is the notion of time in btc still this fuzzy in 2016? has there been any BIP to make this more strictly ordered? – smatthewenglish Sep 22 '16 at 21:13

From the wiki:

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.

It's not obvious that there aren't any problems with this way of timestamping. See the blog post Timejacking & Bitcoin and the discussion about it here.

| improve this answer | |
  • 1
    So block producers out of sync by up to an hour or 2 cause no real problems so long as they remain in the minority. – Mocky Sep 12 '11 at 17:54
  • 1
    I added some info on potential problems to the answer. – D.H. - bitcoin.se Sep 12 '11 at 19:59
  • so then the blockchain is more about ordering, and timestampedness only in a more abstract sense is it? – smatthewenglish Sep 14 '16 at 14:32
  • What do you mean by ****greater than the median timestamp of previous 11 blocks**** ? – jean-mickael nounahon Apr 18 '17 at 12:42

To add a bit to the other answers: Imagine if the protocol required that timestamps increase. Now imagine somebody mines a block with a timestamp a minute in the future as far as you can tell. What do you do? If you try to mine blocks with the timestamp you currently believe is correct, your blocks will get rejected (since they'd have a timestamp earlier than the last accepted block).

Due to the requirement that the network easily agree on whether a block is valid or not, the protocol can't require highly-accurate timestamps as a condition of accepting a block as valid. As a result, requiring monotonic timestamps would likely make things worse rather than better.

| improve this answer | |

I believe the timestamp is based off of the machine hosting the bitcoin client that submitted the block, and variance is allowed as not everyone has their computer time synched properly.

| improve this answer | |
  • Do you know where is the code that performs this function? – smatthewenglish Sep 22 '16 at 16:47

At least one mining pool deliberately sets timestamps 6 minutes in the future and Block 145045 appears to be from Eligius (the generation transaction is split into multiple addresses).

| improve this answer | |
  • why do they do that? do they still do it? – smatthewenglish Sep 22 '16 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.