Andreas Antonopoulos, the author of Mastering Bitcoin and a well-known Bitcoin proponent, spoke about the difficulty of Bitcoin mining and why each block of Bitcoin is mined every ten minutes, during a Q&A session on Youtube.

The author stated that he was asked whether it is a rule or an average number based on computation power that blocks are formed every ten minutes. To which, he stated that it is both, adding that it is a rule in Bitcoin that the difficulty target is based on the computational power of the network that forms blocks every two weeks.

He went on to say:

“The rule in Bitcoin is [about] the difficulty of doing the calculation, which is adjusted every two weeks. The average number of blocks in a period of time [will] equal a block about every ten minutes.”

Andreas stated that this would result in the 2016 blocks mined within a timespan of two weeks. He added that if the blocks mined the previous two weeks are exactly 2016, then the difficulty of solving the PoW algorithm and the amount of hash power committed by the miners for Bitcoin mining is perfect.

The author further stated:

“Let’s say that instead of 2016 blocks, we had 2217 blocks, or effectively 10% more blocks. The network [would adjust] the difficulty [to be] 10% [more difficult], the same ratio as the [percentage] of extra blocks we had versus the number of blocks we should have.”

Andreas continued to say that if there was a difference of 10%, then the difficulty target will also be adjusted by 10%, because of which 10-minute blocks would be “closer” in the future. He further elucidated the result if it was 10% lower, stating:

“[…] 10% short, we would adjust by about 10% in the difficulty target. That calculation happens every two weeks, at exactly the same block, and affects the difficulty of the next block across the entire network [of nodes].”

The Bitcoin proponent stated that every computer in the network counts the number of blocks noticed over the past two weeks, measuring the amount of time between the blocks, and adjusts the difficulty in accordance, “and arrives at the same answer, as the entire network switches [the difficulty target]. For the exact same amount, every two weeks.”