Bitcoin Forum
June 17, 2024, 05:46:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What clock is used by bitcoin?  (Read 537 times)
wingding (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 504



View Profile
April 16, 2014, 06:21:53 PM
 #1

I understand that the bitcoin algorithm adjust difficulty by measuring the time it took to find the last 2016 blocks. What clock is used?
DubFX
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


View Profile
April 16, 2014, 06:25:53 PM
 #2

I understand that the bitcoin algorithm adjust difficulty by measuring the time it took to find the last 2016 blocks. What clock is used?
Here you go:https://en.bitcoin.it/wiki/Difficulty
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1084


View Profile
April 16, 2014, 06:31:25 PM
 #3

I understand that the bitcoin algorithm adjust difficulty by measuring the time it took to find the last 2016 blocks. What clock is used?

Each miner determines his own clock.  

There are 2 "clocks" actually.

- the miner's system clock
- the median of the timestamp when peers connect

At least one of the first five peers you connect to must have a clock within 5 minutes of your computer or it displays a warning to fix your system clock.

If the median of the other peers is within 70 minutes, it uses that time as your time.

This is the code.

Each miner decides what timestamp to add to its block.  It can set it to anything but if it is more than 2 hours in the future, the block will not be accepted.

If it is to far in the past, it will also not be accepted.  A block's timestamp must be later than then median time of the 11 blocks before the block.

This gives a short time window of acceptable times. 

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
wingding (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 504



View Profile
April 16, 2014, 07:14:02 PM
 #4

Thanks TierNolan!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!