1

I am reading Bitcoin wiki and it says

over the previous 2016 blocks. Can be further simplified to

D * 2**32 / 600

without much loss of accuracy.

I guess the reason of reducing to 2**32 is for computing convenience (bit operation). However, 0xffffff / 2016 = 32.507440476190474 and 0xffffff / 2048 = 31.99951171875 which is more accurate.

Why was 2016 chosen instead of 2048?

1

2016 blocks at an expected interval of 10 minutes are exactly 14 days. Likely the window for the difficulty period and interval were picked first and 2016 resulted from that.

0

For calculating the difficulty retargeting, the equation is:

New Difficulty = Old Difficulty * (Actual Time of Last 2015 Blocks / 20160 minutes)

20,160 minutes is two weeks based upon a desired 10-minute block time; hence the 2016 blocks.

P.S. I actually do mean 2015 blocks. Even though the retargeting itself happens every 2016 blocks, due to an off-by-one error in the original Bitcoin Core client (my bad ;)) it is based on the total time of the previous 2015 blocks only.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.