Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: nimda on September 16, 2012, 04:08:52 AM



Title: How do bitcoin clients agree on what time it is?
Post by: nimda on September 16, 2012, 04:08:52 AM
In order for the difficulty to be changed every 2016 blocks, the clients need to know how long it has been since the last retarget. Clocks aren't perfect, though, and there could be malicious clients. How do nodes agree?


Title: Re: How do bitcoin clients agree on what time it is?
Post by: Revalin on September 16, 2012, 04:15:38 AM
https://en.bitcoin.it/wiki/Block_timestamp

Timestamps are checked against network time and your local time.  Nodes refuse to relay if the block's time is too far off.


Title: Re: How do bitcoin clients agree on what time it is?
Post by: finkleshnorts on September 16, 2012, 05:22:31 AM
I read a paper once, posted here on these forums, about this being a potential attack vector.


Title: Re: How do bitcoin clients agree on what time it is?
Post by: Stephen Gornick on September 16, 2012, 06:46:06 AM
I read a paper once, posted here on these forums, about this being a potential attack vector.

Probably here:

 - http://bitcointalk.org/index.php?topic=43692.msg521772#msg521772


Title: Re: How do bitcoin clients agree on what time it is?
Post by: nimda on September 16, 2012, 03:13:01 PM
Does this mean that a large miner or a pool op could timestamp blocks either at the minimum or maximum variance allowed to manipulate the difficulty?


Title: Re: How do bitcoin clients agree on what time it is?
Post by: Revalin on September 16, 2012, 03:38:41 PM
Yes, a corrupt operator can slightly manipulate the timestamps for a marginal benefit.

Doing a it would in a big way would require a significant 51% attack where considerable amounts of history were rewritten in order to achieve a moderate benefit. It is theoretically a problem, but the risk/cost/reward is poor.  As such I don't think anyone has ever bothered.