5
1
What is the reason for the timestamp field in the block header? Surely the nonce should be the only property that changes? Should the nonce reset to 0 everytime the timestamp changes?
5
1
What is the reason for the timestamp field in the block header? Surely the nonce should be the only property that changes? Should the nonce reset to 0 everytime the timestamp changes?
5
The timestamp exists so there will be a permanent record of when the block was found. The timestamp needs to pass some sanity tests for the block to be considered valid.
One of the key uses of the timestamp is in calculating difficulty retargets.
But the timestamp (block header field) is hashed? How is that useful to the blockchain? Surely the time the new block is announced to the blockchain is the time value that is recorded? – Anonymous – 2013-08-27T13:23:00.617
2@Anonymous: The network isn't a monolithic entity. Different nodes get the block at different times, and new nodes don't have firsthand knowledge of the history. Having the timestamp part of the hashed data means everyone can agree on the timestamp, and this can never be changed without altering the hash and breaking the chain. The synchronization challenge is why the blockchain exists in the first place. – Meni Rosenfeld – 2013-08-27T13:27:00.260
Does the time stamp change every few seconds. If yes then if a miner is still hashing while time stamp changes and then it finds a hash lower that target, will that hash be considered valid if other conditions are satisfied? – bytefire – 2013-09-06T16:13:56.990
2
@bytefire: The miner chooses which timestamp to put in the block. Nodes will reject blocks with timestamp that doesn't make sense, but that's on a scale of hours, so there shouldn't be a problem. (See also http://bitcoin.stackexchange.com/questions/3743/how-can-an-earlier-block-have-a-later-timestamp).
– Meni Rosenfeld – 2013-09-07T17:05:26.277