What is a Hard Fork? How It Works?

A fork in cryptocurrency occurs when there's a split – permanent or otherwise – in a blockchain. Often, these splits happen as a result of developers or other network participants propose changes to the protocol.

Upgrades or software updates are connected to two major fork types in the blockchain space: hard fork and soft fork. In this article, we focus on the hard fork – what it is and how it works.

What is a hard fork?

A hard fork is an upgrade to the protocol that introduces backward incompatible rules to the network.

For example, if a network only accepts 1MB blocks and a new rule allows for 2MB blocks, backward incompatibility means that a node running the updated software would reject transactions handled using the old 1MB rule as invalid.

As such, a hard fork requires that all network nodes upgrade to the new software version to continue processing new transactions. If some nodes do not upgrade and continue using the old rules, miners will only communicate with those using the same version of the software.

This is a feature of hard forks and one that leads to the creation of two different blockchains that share a history up to a certain point.

To use the above example, if one group proceeds to accept 2MB blocks and the other sticks to the 1MB block size, two different sets of blocks would be valid. As both sets of blocks get added to the separate chains, it effectively splits the blockchain into two.

In this case, the newly formed network takes a snapshot of the older chain. This is achieved by copying the ledger's transaction history right from the genesis block up to the point of the hard fork.

This means it will have an equivalent number of blocks and coins. New coins are then minted and airdropped to the holders of the "older" cryptocurrency as per their balances at the time of the split.

For example, if you held 200 ETH at the time of the Ethereum hard fork in 2016, you'd receive 200 new coins from the Ethereum Classic network.

Bitcoin fork

The simplest definition of a Bitcoin fork is that it is a split in the main blockchain as a result of changes to the Bitcoin protocol.

A developer taking the open-source BTC code and introducing alterations to create a new cryptocurrency will be said to have forked Bitcoin. This explains the hundreds of Bitcoin forks, most of which have not survived.

But the Bitcoin network itself has also had to implement certain changes to its protocol. These have led to soft forks and hard forks, with a few of the splits now major cryptocurrency platforms in their own right.

In August 2017, Bitcoin split into Bitcoin (BTC) and Bitcoin Cash (BCH). The hard fork was a result of a long-drawn debate on how to solve the network's scaling problem. Some participants felt using Segregated Witness (SegWit) would help significantly increase transactions per block without increasing the block size that was coded as 1MB.

A group with divergent views felt increasing block size was the solution. The disagreement saw the implementation of backward-incompatible change that increased the block size from 1MB to 8MB.

Those who updated their computers (nodes) to accept the changes created a new chain dubbed Bitcoin Cash (BCH). The rest followed the old rules and continued to mine Bitcoin (BTC).

Other notable hard forks that share the Bitcoin history are:

  • Bitcoin Gold (October 2017): Forked Bitcoin code and introduced a different mining algorithm intended to counter what they termed as continued centralization of mining Bitcoin's SHA-256.
  • Bitcoin Diamond (November 2017): Hard forked Bitcoin by tweaking the protocol to increase maximum supply from 21 million to 210 million.
  • Bitcoin SV (November 2018): Forked from Bitcoin Cash and increased the block size from 8MB.

Why does hard fork happen?

Reasons for a hard fork can vary from time to time, but generally, it is meant to introduce changes. Such changes could include upgrades to the protocol for security reasons; provide solutions to issues like scaling or reverse transactions.

While a hard fork typically involves network participants – developers, miners, and community – sometimes a developer or group of developers can just fork the network without involving the participants. That was the case with Bitcoin Gold and Bitcoin Diamond as shown in the examples above.

A hard fork can happen in two ways: it can be planned (coded into the protocol) or disputed (the result of a disagreement among the community members).

Planned hard forks are intended to introduce specific backward-incompatible changes that the community is unanimous about. In this case, all nodes upgrade to the new version and the chain does not split. There are also no new coins created when such a hard fork happens.

A disputed hard fork is one where the community holds two divergent views. With no agreement on how to proceed, they start following different rules and thus split into two blockchains.

Difference between hard forks and soft forks

The main difference between hard forks and soft forks primarily comes down to backward compatibility or lack of it. While a soft fork is backward compatible and allows both old and new nodes to process transactions, a hard fork is the opposite.

Backward-incompatibility means that nodes must upgrade to process new transactions. The contention leads to competing chains, which is what brings about the creation of a new cryptocurrency.

Conclusion

The concept of a hard fork in blockchain technology is one that represents the splitting of a blockchain platform. In most cases, it results in the creation of two philosophically and ideologically disinclined platforms. The hard fork leads to changes that cause a permanent change in software protocol, but when consensus fails, the ledger splits. It's not such a popular idea in the cryptocurrency space due to the contention that comes with it. However, when important changes need to happen, a hard fork might be inevitable.