April 25, 2024

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

</p>

The difficulty of mining is the degree to which it determines how difficult it is for miners in terms of spendinghashing 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) – let's refresh your memory

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).

A block signature (hash) that satisfies the criteria – or mining difficulty

So, it is the number of zeros with which the signature must begin according to the requirements of the blockchain that determineshow difficult it will be for miners to find it (how much hashing power or time is required on average).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 difficulty of mining on the network is automatically adjustedevery two weeksDepending on thethe 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 the Bitcoin blockchain, the mining difficulty is adjusted every two weeks, so thattotal network hashing powerAverageproduced 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: &#171;why only 1 block per 10 minutes?&#187;

For a long time this question has not been solvedwas bugging my head until one day someone on Reddit finally offered an answer. It turned out that it was the sole decision of Satoshi Nakamoto (the inventor of Bitcoin) to keep the block production rate stable at an average of 1 block every 10 minutes, for the reason thatit will take approximately 10 minutes for the blockchain to propagate the latest block(s) to all network nodes worldwide,  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 &#8212; difficulty finding a block

Let's sum it up &#8212; complexityThe block discovery rate is based on the total hashing power of the network and is adjusted every two weeks to maintain a steady rate of 1 block every 10 minutes. This gives the network time to synchronize and update the blockchain ledger globally and is critical to ensuring the security of the ledger (“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&#8212; date
Difficulty &#8212; Complexity
Change&#8212; Change
Hash rate &#8212; hashrate

As illustrated below, block 100 (back in 2009year) required a signature that began with only eight consecutive zeros, while the latest block at the time of this writing (block 542865) required a signature that began with at least 18 consecutive zeros. Number of zeros &#8212; this is what reflects the level of difficulty. Finding output with that many consecutive zeros requires either much more time or much more hashing power. And today, the difficulty of finding a block is much higher, for the simple reason that the Bitcoin blockchain uses 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 poweron the Bitcoin blockchain in 2018 in many, manytimes more than in 2009. Quick note: The graph below only shows the ever-increasing difficulty of mining Bitcoin up to March 2018, but it has been declining since October 2018, when miners were forced to stop mining because their operating costs began to exceed mining profits 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 fit into the block, therefore more transactions will be processed in a given time period. While this may look like a solution, it really isn't. There are several arguments against increasing the block size, one of which is that longer block propagation times between nodes will lead to a higher rate of orphan blocks. Essentially this isthe 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.

</p>