How can an earlier block have a later timestamp?

11

1

Block #180966 has a timestamp of 2012-05-20 23:02:53.

Block #180967 has a timestamp of 2012-05-20 23:02:13.

How has the software permitted a later block to have an earlier timestamp than its predecessor?

Peter

Posted 2012-05-21T00:09:34.370

Reputation: 423

Answers

17

The root cause of this is that without a central authority, it's impossible to know for sure what the current time is.

The protocol rejects blocks with a timestamp earlier than the median of the timestamps from the previous 11 blocks or later than 2 hours after the current network time. Any other timestamp is acceptable. Note that 'network time' may differ from the actual time, since the bitcoin network attempts to correct for incorrect clock settings by taking the median of the time reported by all connected peers as the network time.

You can read about an attack that this makes possible here:

By announcing inaccurate timestamps when connecting to a node, an attacker can alter a node's network time counter and deceive it into accepting an alternate block chain. This could significantly increase the chances of a successful double-spend, drain a node's computational resources, or simply slow down the transaction confirmation rate.

Chris Moore

Posted 2012-05-21T00:09:34.370

Reputation: 13 952

I realize this is a very old post but I would ask if this vulnerability still exists?Jeff 2017-12-29T10:34:28.067

1I'm not sure, but I see no reason why it shouldn't. The rules didn't change.Chris Moore 2017-12-31T01:22:40.033

If it is still a vulnerability I am guessing there is a way to protect against it or it is not a serious one -- BTC has survived many assaults since 2012.Jeff 2017-12-31T02:35:11.677