Difference between revisions of "Block timestamp"

From Bitcoin Wiki
Jump to: navigation, search
m (phrasing)
Line 1: Line 1:
Each block contains a [http://en.wikipedia.org/wiki/Unix_time Unix time] timestamp. In addition to serving as a source of variation for the [[Block_hashing_algorithm|block hash]], there are also validity checks, that make it more difficult for an adversary to manipulate the block chain.
+
Each block contains a [http://en.wikipedia.org/wiki/Unix_time Unix time] timestamp. In addition to serving as a source of variation for the [[Block_hashing_algorithm|block hash]], they also make it more difficult for an adversary to manipulate the block chain.
  
 
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.
 
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.

Revision as of 04:15, 22 September 2014

Each block contains a Unix time timestamp. In addition to serving as a source of variation for the block hash, they also make it more difficult for an adversary to manipulate the block chain.

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.

Bitcoin uses an unsigned integer for the timestamp, so the year 2038 problem is delayed for another 68 years.