How does the bitcoin network ensure that blocks continue to get mined once every 10 minutes on average?
In this thread I'll explain the Difficulty Adjustment, and why it might be the most genius part of bitcoin 👇
1) Finding some data that hashes to something beginning with one zero ("0")
or
2) Finding some data that hashes to something beginning with 10 zeros ("0000000000")
Go ahead and try it yourself with this online hash calculator if you like.
xorbin.com/tools/sha256-h…
This is.... the Difficulty Adjustment!
The number of leading zeros required for a block's hash to be valid is designed to change over time.
In other words, the mining difficulty adjusts.
Imagine if the network had required just 8 leading zeros for all block hashes, forever...
What would happen?
As a result, blocks would start getting mined very quickly. We might start getting a block once every minute, or even every second.
Here's how it works:
They then calculate the total time it took to mine all those blocks in that 2016 block window.
Call this time T
Why 2 weeks?
(10 minutes / block) * (2016 blocks) = 20160 minutes
20160 minutes = 336 Hours = 14 days = 2 weeks!
Instead of requiring 19 leading zeros for block hashes, they might bump it down to 18
Instead of requiring 19 leading zeros, they might bump it up to 20.
But how do we ensure that all nodes arrive to the same conclusion on this calculation?
Pretty genius if you ask me..
But why does it matter so much?
What's so important about making sure we have 10-minute block intervals?
Remember, each new block creates new bitcoins..
Faster or slower block times affect the rate of new bitcoins entering the market.
@saifedean has explained this wonderfully in his book The Bitcoin Standard
amazon.com/Bitcoin-Standa…
We now have a monetary asset who's supply issuance is on a FIXED schedule, for all of eternity, no matter how hard people try to create more.
Get you some and a spacesuit. We're going to the moon.