Introduction

When you're asked to update your bank's app on your smartphone, you probably don't think long before doing so. Your phone may even automatically take care of updates without you being aware of it. After all, this is a normal process: if you do not install the latest version of a software, you may be unable to use its services.

In the open-source world of cryptocurrencies, things are different. While you don't need to read every line of Bitcoin's code to use it, it's still important to be able to do so. In this new world, there are no hierarchies that can simply impose updates and change things as they please. This is why implementing new features on blockchain networks can be a real challenge.

In this article, we will see how cryptocurrency networks can be maintained, despite the lack of a central authority. These networks use two different mechanisms: hard forks and soft forks.


Who makes decisions on a blockchain network?

To understand how forks work, it is essential to first fully understand the participants involved in the decision-making process (governance) of the network.

For Bitcoin, one could generally distinguish between three subsets of participants: developers, miners, and users running a full node. These parts contribute to the network. Light nodes (example: phone wallets, computers) are widely used but are not really “participants” in the network.


Developers

Developers are responsible for creating the code, but also for updating it. Everyone can contribute to the development of a cryptocurrency. The code is publicly available, allowing anyone to submit changes for review by other developers.


Minors

Miners are in charge of securing the network. They execute the code of a cryptocurrency and allocate their resources to add new blocks to the blockchain. For the Bitcoin network, we speak of Proof of Work. As a reward for their efforts, they obtain block rewards.


Full node users

Full nodes are the backbone of a cryptocurrency's network. They validate, send and receive blocks and transactions and maintain a copy of the blockchain.


You will often find overlap in these categories. A person can for example be a developer and the user of a full node or, be a miner and the user of a full node. You can be all three, or none. In fact, many of those we consider cryptocurrency users do not take on any of these roles. They instead use centralized services or lightweight nodes.

Looking at the descriptions above, you could make solid proposals for developers and miners to make the decisions for the network. Developers create the code: without them, there would be no software to run and no one could fix bugs or add new features. Miners secure the network: without healthy mining competition, the chain can be hijacked or shut down.

If these two categories tried to force the rest of the network to follow their will, it would end very badly. For many, the real power is in the full nodes. This is largely because the network is opt-in, meaning users can choose the software they use.

Developers will not come to your house with a gun to force you to download Bitcoin Core. If miners adopt a "this or nothing" attitude to force an unwanted change on users, users will opt for their own method.

These actors are not all-powerful lords: they are service providers. If individuals decide not to use the network, the currency will lose value. The loss of value will directly impact miners (their rewards are worth less when denominated in dollars). Regarding developers, these can simply be ignored by users.

As you see, this is not proprietary software. You can make whatever changes you want, others can run this new version of software, and in the end everyone can agree. By making these changes, you have just forked the software and created a new network.


What is a fork?

Forking software occurs when it is copied and modified. The original project continues to exist, but is now distinct from the new one which has taken a different direction. Let's say members of the content team at your favorite cryptocurrency's website have a major disagreement about how to proceed. Part of the team may duplicate the site using a different domain name. They will then post different content.

The projects are based on a common basis and share the same history. However, just like a single road splitting into two, a divergence now exists between the two sites.

Note that this kind of thing often happens in open-source projects and has been happening since long before the appearance of Bitcoin or Ethereum networks. However, the distinction between a hard fork and soft fork is almost exclusive to the blockchain universe. Let's see it together.


➟ Do you want to get started with cryptocurrencies? Buy Bitcoins on Binance!


Comparison of Hard forks and Soft forks

Although having similar names and serving the same purpose, hard forks and soft forks are significantly different. Let's look at these differences.


What is a hard fork?

Hard forks are software updates that are not backwards compatible. These typically occur when nodes add new rules that conflict with rules from old nodes. New nodes can only communicate with other individuals using this version. This results in a division of the blockchain and consequently the creation of two distinct networks: one using the old rules, the other using new ones.

Les nƓuds deviennent bleus une fois à jour. Les anciennes noeuds, ici en jaune, refusent la mise à jour pendant que les bleus se connectent entre eux.

The nodes turn blue when updated. The old nodes, here in yellow, refuse the update while the blue ones connect to each other.


There are now two networks running in parallel. They will both continue to broadcast blocks and transactions, but are no longer working on the same blockchain. All nodes had an identical blockchain until the time of the fork (and this history is preserved), but they will have different blocks and transactions afterward.

blockchain forkant au bloc 600 000.


Because of this shared history, if you owned coins with the fork you will end up with coins on both networks. Suppose you owned 5 BTC at the time of the fork at block 600,000. You can now spend these 5 BTC on block 600,001 of the old blockchain, but these will not be spent on block 600,001 of the new blockchain . Assuming the cryptography hasn't changed, your private keys still allow you to hold five coins on the new network.

A well-known hard fork was that of Bitcoin in 2017. Following this, Bitcoin split into two chains: Bitcoin (BTC), the original chain, and Bitcoin Cash (BCH). This fork happened after much debate on how to improve scalability. Bitcoin Cash advocates wanted to increase the block size, while Bitcoin advocates opposed the change.

An increase in block size requires a change in the rules. This happened before the SegWit soft fork (more information will be provided soon on this subject), so the nodes did not accept blocks less than 1 MB. If you create a valid 2 MB block, the others nodes will still reject it.

Only nodes that had modified their software to allow blocks larger than 1 MB could accept these blocks. Of course, this made them incompatible with the previous version, so only nodes with the same protocol changes could communicate.


What is a Soft fork

A Soft fork is a backwards compatible update, updated nodes can still communicate with non-updated nodes. What generally happens in a Soft fork is the addition of a new rule that does not conflict with the old ones.

For example, reducing block size can be implemented with a Soft fork. Let's take the example of Bitcoin once again to illustrate this point: if there is a limit on the maximum size of a block, there is conversely no limit on its minimum size. If you want to only accept blocks smaller than a certain size, you simply reject larger blocks.

However, this does not automatically disconnect you from the network. You will still communicate with nodes that do not apply these rules, but you will filter some of the information they send to you.

A concrete example of a soft fork is the aforementioned Segregated Witness (SegWit) fork, which occurred shortly after the Bitcoin/Bitcoin Cash split. SegWit was an ingenious update changing the format of blocks and transactions. Old nodes could still validate blocks and transactions (the formatting didn't violate the old rules), but they just wouldn't understand them. Some fields are also only readable when nodes upgrade to the latest software, allowing them to analyze additional data.

MĂȘme deux ans aprĂšs l'activation de SegWit, tous les nƓuds n'ont pas Ă©tĂ© mis Ă  niveau. Il y a des avantages Ă  le faire, mais il n'y a pas vraiment d'urgence, puisqu'il ne s'agit pas d'un changement ayant un impact sur le rĂ©seau.


Even two years after SegWit was enabled, not all nodes have been upgraded. There are benefits to doing this, but there is no real urgency, since it is not a network impacting change.


Comparison of Hard forks and Soft forks, which is better?

Basically, these types of forks serve different purposes. Controversial hard forks can divide a community. Conversely, planned hard forks give everyone the freedom to modify the software with the agreement of all members.

Soft forks are a gentler option. In general, you are more limited in what you can do, because your new changes cannot conflict with the old rules. That said, if your update can be designed to remain compatible, you don't have to worry about network fragmentation.


To conclude

Hard forks and soft forks are essential to the long-term success of blockchain networks. They allow us to make changes and upgrades in decentralized systems, despite the absence of a central authority.

Forks allow blockchains and cryptocurrencies to integrate new features as they develop. Without these mechanisms, we would need a centralized system with top-down control. Otherwise, we would be stuck with the same rules for the entire lifespan of a protocol.