Understanding the DAA's Timing Mechanism

3 replies 28 views
lynx_2011Full Member
Posts: 2 · Reputation: 642
#1Aug 10, 2022, 01:35 AM
Every two weeks, the DAA checks how many blocks were mined and compares that with what should've been mined based on a ten-minute target. If there are too many blocks, it raises the difficulty, and if there are too few, it lowers it. So, my question is, what exactly is the ‘clock’ or ‘calendar’ that this algorithm uses for those block times? Do they rely on timestamps from the block headers or are they using some internet time servers?
2 Reply Quote Share
fullnodeSenior Member
Posts: 151 · Reputation: 1205
#2Aug 10, 2022, 04:47 AM
They actually depend on the timestamps in the block headers. If they relied on internet time servers, then the entire process for adjusting difficulty wouldn’t make sense. Plus, it opens up possibilities for manipulation. If you check Section 3 of the whitepaper, it gives some insight into this. Here are a couple of links that might help: 1. block-timestamp info 2. CoinMetrics on normalizing block times.
2 Reply Quote Share
chrisomegaFull Member
Posts: 51 · Reputation: 631
#3Aug 11, 2022, 12:08 PM
That's not accurate. The algorithm doesn't just look at the number of blocks mined over two weeks. It compares the average block time of the last 2016 blocks with the expected average of 10 minutes. Also, the difficulty adjustment period can vary, not always two weeks.
4 Reply Quote Share
j0hn.ga5Newbie
Posts: 29 · Reputation: 19
#4Aug 11, 2022, 02:08 PM
The DAA uses the timestamps from the blockchain itself, with some checks in place. The difficulty adjusts every 2016 blocks, not every two weeks. The target time for these blocks is 1,209,600 seconds. The nodes trust the block headers and keep them within certain limits: For a new block, its time has to be later than the MedianTimePast of the previous 11 blocks, and it can't be too far in the future. They do some math to clamp the actual timespan to check against the target timespan.
3 Reply Quote Share

Related topics