March 24, 2023

Blockchain: The secret of mining complexity and block time (finding)

The difficulty of mining lies in the degree that determines how difficult it is for miners to spend hashing power (and thereforetime) to find a suitable hash amount, or, in other words, a signature for your block (each transaction block needs to have a hash meeting the established criteria to verify it and then add it to the blockchain). In the Bitcoin blockchain, miners try to find the required hash amount by hashing random numbers. Let's take a quick look at this process.

What is mining (aka hashing) - refresh material

Let's quickly go over this topic again. If you read my article “How mining works and how transactions are processed”, then you already know that the block of transactions will be accepted by the rest of the network only if it has a signature (hash) that meets the established requirements (for example, in the Bitcoin blockchain a block signature must begin with a certain number of zeros). In order to find such a signature, miners spend their computing power (hashing power) on performing many predefined operations on random numbers until they find the necessary number, which ultimately leads to a certain output number, which will fit the specified criteria. Finding output as a number that starts with only one zero is much easier (and usually more often) than finding a numerical value that starts with five consecutive zeros (this is a fairly rare occurrence, so much more time to find the desired number, which will lead to such output data).

Block signature (hash) satisfying the criteria - or mining difficulty

So, exactly the number of zeros from which shouldthe signature begins according to the requirements of the blockchain, determines how difficult it will be for miners to find it (how much on average hashing power or time is required). This is the difficulty of mining. The more zeros required, the more difficult it is to find a suitable signature (= higher complexity). But what determines the complexity of mining?

What determines the complexity of mining?

The complexity of mining in the network is automatically adjusted every two weeks depending on the the speed of finding new blocks. Total network hashing powerincreases when an increasing number of miners join it to mine bitcoins. Therefore, we can assume that in this case the network as a whole will find suitable signatures faster, which means that blocks will be added to the blockchain faster as well.

Here is an example:

  • Suppose all miners in this examplehave the same processing power (hash rate). An average miner takes 1 hour to find a satisfying hash. Thus, one miner finds one suitable hash per hour, but ten miners will already find ten matching hashes in the same time. So, the block finding speed for one miner is 1 block per hour, but for ten miners it will already be 10 blocks per hour, which is much faster!

In Bitcoin blockchain, mining complexity is adjusted every two weeks, so that total network hashing power average produced 1 block every 10 minutes. If a lot of people join the Bitcoin blockchainminers and the total hash power increases, then the speed of finding a block can increase from 1 block in 10 minutes to 9 minutes per 1 block. After some time, this will also increase the complexity of mining, so even with this additional hashing power, the production speed of blocks will maintain a steady pace of 1 block in 10 minutes. The same applies to the opposite scenario, when miners stop mining on the blockchain and the total hash rate decreases, the mining complexity also decreases. The main question is - why is 1 block every 10 minutes?

But why just one block in ten minutes ?!

You may not be aware of this right now, but this is really a very good question. Personally, it took me a long time to figure this out, and, apparently, I was not the only one.

Results of a search query about the time the block was located.

But why should complexity increase at allmining? Indeed, to process the same number of transactions will require more electricity. Why not just reduce the complexity of mining and thereby speed up the pace of finding new blocks? It would also make Bitcoin transactions process much faster.

Search query results: “why only 1 block in 10 minutes?”

For a long time this question does nothaunted my head until one day someone on Reddit finally offered an answer. It turned out that this was the sole decision of Satoshi Nakamoto (inventor of Bitcoin), so that the production speed of blocks was maintained at a stable level and amounted to an average of 1 block every 10 minutes, for the reason that it will take about 10 minutes for the blockchain to distribute the last block (s) to all network nodes around the world so that the blockchain remains properly synchronized. If blocks are created at a faster pace, thensome nodes on the other side of the globe may not be able to quickly and timely include the data of recent transactions in their copies of the blockchain. This, in turn, can lead to the fact that the nodes will no longer be correctly synchronized. The consequence of such a desynchronization of network nodes may be the emergence of the so-called “orphan” blocks (or branching chains), which are “orphan” blocks or blocks excluded from the main blockchain chain. Blockchains should be avoided whenever possible in order to remain safe. Sure, this answer seems pretty simple, but it makes sense.

So - the difficulty of finding a block

Let's summarize - the difficulty of findingblock is based on the total hashing power of the network and is adjusted every two weeks to maintain a stable pace of creating new blocks, amounting to 1 block in 10 minutes. This gives the network time to synchronize and update the blockchain registry on a global scale and is critical for registry security (“Orphan blocks” reduce network security because they can become invalid even after their validity has been verified)

The more miners join the network, themore aggregate computing power will be spent on finding eligible signatures, and the faster the blocks will be added to the blockchain if the complexity of the decision blocks is not changed. Therefore, complexity increases when the total hash power increases, and vice versa, as complexity decreases, hash power also decreases. As can be seen below, the total hash power (hashrate) currently stands at 51 billion GH / s. The higher the hashrate, the higher the block complexity.

Date - Date
Difficulty - Difficulty
Change - Change
Hash rate - hash rate

As illustrated below, block 100 (back in 2009year) required a signature that began with only eight consecutive zeros, while the last block at the time of writing of this article (block 542865) needed a signature that began with at least 18 zeros following each other. The number of zeros is what reflects the level of difficulty. Finding the output with so many consecutive zeros requires either much longer time or much greater hash power. And today, the complexity of finding a block is much higher, for the simple reason that the Bitcoin blockchain consumes significantly more hashing power (due to the increased number of miners).

The complexity of block 100 was 8 consecutive zeros.

The complexity of block 542864 was 18 consecutive zeros.

As you can see, aggregated hashing power on the Bitcoin blockchain in 2018 in many, manytimes more than in 2009. A small note: the chart below only shows the ever-increasing complexity of mining bitcoins until March 2018, but it has been decreasing since October 2018, when miners were forced to stop mining because their operating expenses began to exceed the profit from mining, as bitcoin prices fell rapidly.

The complexity of Bitcoin mining has increased significantly since its birth, because since then more miners have joined the network (hash power has increased).

Well, what if you increase the block size?

Yes, this is a fairly widely discussed topic. If the block size increases, regardless of complexity, then more transactions will be placed in the block, therefore, more transactions will be processed in a given period of time. Although this may look like a solution, it really is not. There are several arguments against increasing the size of the block, one of which is that a longer propagation time of blocks between nodes will lead to a higher rate of appearance of orphan blocks. Essentially this the tradeoff between scalability and securityhowever, this is only a temporary solution at the cost of network integrity.

Where can I find real-time reports on adding new blocks to Bitcoin and Ethereum blocks?

You can find scanners providingreal-time information on the following parameters - the time the block was located, the complexity of the block, hashrate, etc., here for the Bitcoin blockchain, and here for Ethereum.