Mining Diversions , Retargeting and Contentious Hard Forks

In this article, we learn about contentious hard forks and how mining diversions and retargeting are done when they happen.

Table of contents.

  1. Introduction.
  2. Mining Diversions and Retargeting.
  3. Contentious Hard Forks.
  4. Summary.

Prerequisites.

hard forks and changing the consensus rules

Introduction.

In the prerequisite article, we learned about hard forks, a radical change to the underlying blockchain network protocol that makes previously valid blocks invalid and previously invalid blocks valid. In a hard fork, there is no backward compatibility since all participants must upgrade their clients in order to remain valid.
Forks come as a result of a bug fix or deliberate changing of the consensus rules. They can be classified into two types, contentious or non-contentious.

As the blockchain splits, we don't expect the difficulty to remain the same. A lot goes on to correct the network. Retargeting is one of such corrections whereby a retargeting/difficulty adjustment algorithm adjusts the PoW consensus mechanism. For example, in a chain split, one side will be left with fewer nodes, and less hashing power meaning more time needed to process transactions.

In this article, we learn about how miners diverge to form new chains, how retargeting is done and the different types of blockchain forks, and why they happen.

Mining Diversions and Retargeting.

When a hard fork happens, miners diverge into different chains each using different consensus rules. Apart from a chain split, the total network's hashing power is also split into two. Once serving the old chain and the other the new chain. In most cases, the split won't be a 50/50 split. We will find that a chain will have more hashing power than its counterpart.

Take the case of a 60/40 split where 60% of the miners adapt to the new consensus rules. Also, we assume this split took place after the retargeting period. This is when the retargeting/difficulty adjustment algorithm adjusts the PoW consensus mechanism. In this case, the two chains also inherit difficulty from the retargeting period.

Each block on the blockchain is created as a result of a miner solving a complex cryptographic puzzle specified by the network protocols. As we know, mining has evolved from hardware mining to the use of ASIC miners. This move towards more powerful technologies is an indication that the puzzle gets harder over time therefore more computational power is needed to solve it.

For miners to solve the puzzle by finding a nonce that produces a hash that is less than the target, they use the SHA-256 algorithm. If the target is not reached after 4 billion nonces are used, other ways such as the extra nonce solution or readjusting block header parameters are used.

The target to be met in order to solve the puzzle is readjusted after every 2016 blocks have been mined. If we consider the 10-minute interval for a block to be mined, then this takes about 14 days/2 weeks. This process is referred to as retargeting. It ensures the 10-minute interval is maintained by increasing the difficulty of the puzzle or reducing it in the case the network has shrunk.

Retargeting is generated by dividing the hash of the target of the first block by the hash of the target of the current block. In most cases, the difficulty will increase over time as the network grows bigger and the mining power increases.

Now, the new consensus rules have 60% out of the previously available hashing power. In other words, the mining power has been reduced by 40% for the new miners on the new chain. For the old miners using the old rules, their mining power sees a 60% decrease. The decrease in mining power means that blocks are being mined a little over the 10-minute interval and worse for the miners using the old consensus rules.

The retargeting period serves to return the speed at which blocks are being mined back to the 10-minute period by adjusting the difficulty.
Generally, chain splits weaken the network and slows the processing of transactions. The weaker the chain the more time it will take for it to readjust, within this period, the network processed transactions rather slowly. At this stage, the network is vulnerable to attacks such as the 51% attack.

Contentious Hard Forks.

A hard fork in blockchains can occur as a result of valid reasons and at other times they may seem contentious and come about as a product of disagreements between participating parties.

Hard forks are viewed as risky since they force the minority of participants to either change their client software or get invalidated. This makes developers skeptical to use hard forks as a way of implementing changes to the consensus rules unless the whole network unanimously agrees.

Hard forks that don't have unanimous support from the whole network are considered contentious and viewed as risky. While others see it this way, others also view hard forks as a means to avoid technical debt by providing a clean exit from past mistakes.

Generally, forks can be seen as contentious and non-contentious. The former occurs as a result of disagreements between miners and other stakeholders in the blockchain. Here the disagreeing group creates, implements, and adopts their own changes making the other side invalid.
Non-contentious forks come as a result of participants wanting and coming to a consensus to fix a bug in the existing network.

An example of a contentious fork occurred in 2017 when bitcoin(BTC) stakeholders decided that the network was slow, fees were too high, the block size was too small, and it could not scale thereby creating Bitcoin Cash(BCH), a faster network with cheaper fees that could be used for day-to-day bitcoin transactions. In this case, Bitcoin holders received an equivalent of Bitcoin Cash on the Bitcoin Cash network using airdrop.

Another example of a hard fork was between Ethereum and Ethereum Classic. This was caused by a DAO which was exploited by a hacker who siphoned 3.6 million. A hard fork ensued that was aimed to recover the stolen funds. A version of Ethereum where the 3.6 million was returned was the result of this hard fork. Ethereum Classic is still operational but with a minority of participants compared to the main Ethereum.

Summary.

Contentious forks occur as a result of disagreements between miners and other stakeholders in the blockchain. Famous contentious hard forks include Bitcoin/Bitcoin Cash and Ethereum and Ethereum Classic.
Non-contentious forks come as a result of participants wanting and coming to a consensus to fix a bug in the existing network.

Miners solve the specified cryptographic puzzle by finding a nonce that produces a hash that is less than the target. The SHA-256 hashing algorithm is used.
Retargeting is generated by dividing the hash of the target of the first block by the hash of the target of the current block.

The retargeting period serves to return the speed in which blocks are being mined back to the 10-minute period by re-adjusting the difficulty.