As a mobile phone user, you will be familiar with the updates that make your apps run more efficiently. Cryptocurrencies are powered by blockchain, a decentralized software that also needs regular updates and upgrades.
However, while mobile apps can easily be updated at the touch of a button, making changes to a blockchain’s protocol requires a more complex approach. Most blockchains are open-source, decentralized, and require user consensus to update. The unique process of updating a blockchain is called a fork, and it can be a major one or a minor one.
A lot of times, forks are initiated by community members or developers through node operators—the machines that are connected to the blockchain to validate transactions.
There are two types of forks:
- Hard fork
- Soft fork
Let's find out more about these.
What's a Fork?
In simple terms, a blockchain can be pictured as a straight path made of data blocks, linked to one another by cryptographic keys. They are joined together by a consensus, and any system upgrade requires a change of consensus on all blocks. That would mean rewriting each block, an impractical approach. So a fork is created. It is an event that copies the original blockchain and makes the desired changes to it. It splits the chain into two branches, creating a fork-like diversion.
Hard Fork Explained
Reminder: even though the merge is coming around Sep 10-20, the beacon chain hard fork is on Sep 6. Make sure to update your clients before then! https://t.co/x8GQCbtNNk
— vitalik.eth (@VitalikButerin) August 30, 2022
A hard fork is an upgrade that makes the previous blockchain protocol versions invalid or irrelevant. Even if the previous versions are still in the running phase, they will be transferred to a different protocol and will run on different data entirely. However, this version of the fork can cause a lot of confusion and errors as well.
A hard fork updates the algorithm, block size, and several other features. These changes make the blocks go to a new protocol, and are rejected by older versions, which can cause chaos on the network.
So let’s say that the block size limit is increased from 1 megabyte to 4 megabytes. A 2-megabyte block would be accepted by a new version. However, it would be rejected by the older version entirely. This will cause a conflict, and you’ll have two blockchains.
Hard forks are usually chaotic and risky at the same time. It can cause fund losses and a lot of other problems that developers would like to avoid.
Why Do Hard Forks Happen?
But if hard forks are risky for both security and the network, why do we have them at all? Well, the answer is quite simple. Hard forks incorporate the updates that must be done on the system. These upgrades are often innovative and need to be done to provide new functionalities and upgrades across the entire system.
Ethereum’s recent hard fork allowed it to break away from the chain and convert its system to Proof-of-Stake consensus.
Another famous example of a hard fork was Bitcoin’s 2017 fragmentation into 2 chains. One was the regular Bitcoin (BTC), and the other one was Bitcoin Cash (BCH). The main idea of the fork was to accommodate a larger block size that would allow more transactions.
Soft Fork Explained
On August 1, 2017, Bitcoin users successfully deployed a user-activated soft fork (UASF) to circumvent big blockers/corporate interest. This demonstrated:
— Bitcoin Magazine EDU (@BitcoinMagEDU) August 30, 2022
❌ NO CONTROL: Corporate Interests/Miners
✅ CONTROL: Node Operators/Bitcoin Users
A soft fork is a safer version of a hard fork, where new changes are compatible with the older versions of the blockchain. Hence, even if a protocol is changed or upgraded to an extent where it changes the rules or adds a new feature to the chain, it would not reject the older version and remain compatible with it.
One of the biggest examples of soft forks would be the Segregated Witness (SegWit) fork after the BTC and BCH hard forks. The main goal was to solve the scalability issue of Bitcoin without having to create a hard fork.
Hence, the SegWit update changed the overall format of blocks and transactions in such a manner that old nodes can still validate new blocks and transactions. They do it by understanding the overall structure and have a relation to both the old and new blocks.
Hard Fork vs. Soft Fork
A hard fork is often looked at as a risky way of upgrading the system. On the other hand, a soft fork is a safe alternative that also supports both new and old blocks. This simply means that the nodes that are not upgraded to a new system will still work with the whole chain and will not miss anything.
A soft fork can easily add new features and upgrades without having to change the rules of a blockchain. This makes soft forks safer, and they’re often used to implement new upgrades, especially at a programming level.
Final Take
Hard forks ensure that all blockchain miners both new and old get a fair chance to mine. However, they consume a lot of power, require massive computational resources and are generally considered to be detrimental to the environment. Soft forks on the other hand allow for quick software upgrades on the chain without excessive use of resources. They also keep the blockchain community from splitting.
Overall, regardless of the type of fork, there still remains a lot to be done to ensure blockchain upgrades and updates happen smoothly.