Author

Topic: Any relation between the bitcoin mining difficulty and the time between blocks? (Read 149 times)

jr. member
Activity: 46
Merit: 66
#WeAreAllHodlonaut
Today I did a quick calculation.

From the Genesis block that was mined on January 3, 2009 until today there are 4793 days.
4793 days are approximately 6,901,920 minutes.
The highest block, at the time of the calculation was 723731

min/blocks = ~ 9.53 min/block

Thank you all for your answers. I will lock the thread.
legendary
Activity: 2912
Merit: 6403
Blackjack.fun
I looked at several pages with the history of the blocks and could not see one that was close or over 10 minutes.
All are under 10 minutes.
The average total should be well under 10 minutes.

The obvious answers about block time aside which has been explained in every way possible, I'm really intrigued when you looked at that statistic and how long are those pages, as you quoted block 723,577.
Well, block 723550 was mined at ‎2022-02-16 08:05 and block 723549 ‎at 2022-02-16 07:30, that's that 27 blocks from your quoted blocks and a full 35 mins between 723545 (2022-02-16 07:06) and 723544 (2022-02-16 06:49) again 17 mins.

Actually, the median time between blocks for the last 24 hours has gone really down, we had about 178 blocks mined yesterday and just 155 now.
Funny coincidence, as I'm looking now at the blockchain 3 out of the last 6 blocks have been mined over 10 minutes.



legendary
Activity: 2268
Merit: 18711
Here is a website which might help to illustrate to you what exactly is going on: https://www.bitrawr.com/difficulty-estimator

As explained above, each difficulty epoch contains 2016 blocks. The difficulty is set so that with the current hashrate, these 2016 blocks should be mined in exactly 2 weeks (which works out to 10 minutes per block on average). If we are finding blocks too quickly (shown by blocks which are "mined and unexpected"), then the difficulty will adjust upwards to make it harder to find the next 2016 blocks. If we are finding blocks too slow (shown by blocks which are "unmined and expected"), then the difficulty will adjust downwards to make it easier to find the next 2016 blocks. This constant adjustment every 2016 blocks always aims to bring the average back to 10 minutes per block.

Here is another site which shows you the full history of difficulty readjustments from the beginning of bitcoin to present day: https://btc.com/stats/diff
legendary
Activity: 2604
Merit: 2353
As it has been told above, it's mainly caused by the discrepancy between the mining difficulty and the global hashrate of the network (the hashrate has managed to overcome the mining difficulty).
But sometimes it could also be caused by the randomness. Miners iterate a nonce to find a hash shorter than the difficulty(ie with more zeros at the beginning of the hash) but this nonce can be small several times in a row. Moreover they can also iterate the nonce randomly, and being able to find the good one very quickly several times in a row thanks to their luck.  
legendary
Activity: 2450
Merit: 4414
🔐BitcoinMessage.Tools🔑
It is still not clear to me how the time between the blocks is determined and how it can be determined at 10 min?
The expected time of mining 2016 blocks is 2016 x 10 minutes = 20160 minutes. The actual time of mining 2016 blocks depends on how fast or how slow previous 2016 blocks were mined. For example, it took 10080 minutes to mine 2016 blocks, which means the average time between blocks was 5 minutes instead of 10 since the actual time was two times less than the expected time. What do we need to do to increase the time between blocks? We need to increase the difficulty of mining by 2 times. We take previous difficulty (whatever it was) and multiply it by two. That is how we ensure the average time of 10 minutes.

Non-technical explanation can be found here: https://learnmeabitcoin.com/beginners/difficulty
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
You've already got a pretty good explanation, you can read more detailed (and possibly too technical) here.
I will address the statistics and your conclusion:

Here are statistics for the last few blocks:
[~snip~]
The average total should be well under 10 minutes.

Indeed, right now, on average, the blocks are mined a little bit faster than the desired 10 minutes.
And in such case (or when in doubt) you can look at websites like https://mempool.space/
You will see that we are near the end of the 2016 blocks (92.21 %, ~1 day remaining) and then the difficulty will be adjusted (increased) by ~4.75%, making the next 2016 blocks harder to mine.

This happens because in the last 2 weeks the hash rate has been increasing and the difficulty will now also increase to remain "in sync".
It can happen (like when mining was banned from China and miners got unplugged/moved away) that hash rate falls, then the difficulty is reduced.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
At every 2016 blocks, the mining difficulty is adjusted, and this will take approximately every 2 weeks. If the mining difficulty has been adjusted and followed by increase in total mining hashrates, this will result to each block to be mined in less than 10 minutes. If the mining difficulty has just been adjusted and mining hashrate decreased, this will lead to each block mined to be more than 10 minutes during the time.

But a block can be mined less than 2 minutes while later another block can be mined after 10 minutes. I have seen blocks mined after 10 (even after 20 and 30) minutes before, like when China banned Bitcoin mining, even before and after the time, I still see it. The most appropriate word for this is 10 minutes on average.

Example of a block mined after 10 minutes
https://www.blockchain.com/btc/block/620000 - https://www.blockchain.com/btc/block/620001

Block 6200001 was mined 22 minutes after block 600000 was mined. There are still several of them like that just like below 10 minutes also. But in average, it should be approximately 10 minutes also as mining difficulty is adjusted in every 2016 block mined.
jr. member
Activity: 46
Merit: 66
#WeAreAllHodlonaut
Hello guys,

reading this:

Quote
The exact amount of time it takes for block generation varies and depends on the difficulty of the hash.

Quote
Each cryptocurrency has a different block time—Bitcoin takes around 10 minutes, while Ethereum only takes around 14 seconds
Source: https://www.investopedia.com/terms/b/block-time-cryptocurrency.asp#:~:text=Each%20cryptocurrency%20has%20a%20different,generated%20by%20the%20hashing%20algorithm).

It is still not clear to me how the time between the blocks is determined and how it can be determined at 10 min?

Here are statistics for the last few blocks:
Code:
723,582 00000000000000000000780705dd3172aa5cb960c5e7a1a796ae6585cab66ae0 2022-02-16 09:16:50 Poolin 899 1,267.60BTC 56,337,000USD 0.04BTC 1,627.17USD 623.583app.units.kb
723,581 0000000000000000000612239d746e3abf06986d3b588e4b0c820a05b359b4ce 2022-02-16 09:12:24 F2Pool 182 309.87BTC 13,771,700USD 0.02BTC 810.02USD 267.991app.units.kb
723,580 00000000000000000006355d665747311467dfbf43d248361570d0807af65989  2022-02-16 09:11:33 Unknown 1258 1,665.97BTC 74,042,200USD 0.05BTC 2,289.57USD 922.846app.units.kb
723,579 000000000000000000096b5fe0bcd5df426700c97441e596284c85beb62c3d0b   2022-02-16 09:05:18 F2Pool 1528 2,258.98BTC 100,398,000USD 0.06BTC 2,691.3USD 1,345.095app.units.kb
723,578 00000000000000000006d410b462e7babc9a1e320edad8e070d454904f0b9280  2022-02-16 08:56:25 SlushPool 75 217.39BTC 9,661,460USD 0.00BTC 129.81USD 36.624app.units.kb
723,577 00000000000000000009be5e51184e3270441cac6113eae7255a5e7b3e3fe5a8  2022-02-16 08:55:51 F2Pool 855 1,176.71BTC 52,297,700USD 0.03BTC 1,183.89USD 421.271app.units.kb
Source: https://blockchair.com/bitcoin/blocks

Mining 723578 took less than a minute, there were only 75 transactions totally 217.39 Btc
Mining 723579 took approximately 6 minutes with 1528 transactions and 2258.98 btc

The hash rate is at ATH together with the network difficulty, if it plays a role.
Source:
https://www.blockchain.com/charts/difficulty
https://www.blockchain.com/charts/hash-rate

I looked at several pages with the history of the blocks and could not see one that was close or over 10 minutes.
All are under 10 minutes.
The average total should be well under 10 minutes.


I forgot to add that nowhere in the bitcoin white paper says that the time between the blocks are 10 minutes only if they are generated too fast per hour, the difficulty increases.

Quote
A block header with no transactions would be about 80 bytes. If we suppose blocks are
generated every 10 minutes, 80 bytes * 6 * 24 * 365 = 4.2MB per year

Quote
To compensate for increasing hardware speed and varying interest in running nodes over time,
the proof-of-work difficulty is determined by a moving average targeting an average number of
blocks per hour. If they're generated too fast, the difficulty increases.
source:
https://bitcoin.org/bitcoin.pdf
Jump to: