powered by Coinlib

Sunday, February 10, 2019

Cryptocurrency Forks



What is a cryptocurrency fork? When people use the word fork they can mean two different, but related things: a fork of a codebase; a fork of a live blockchain (a chainsplit). The difference is whether you’re creating an entirely new ledger, which is achieved by forking a codebase (the code behind the node software), or creating a new coin that has a shared history with an existing coin by forking a blockchain.

A fork of a codebase in general is where you copy the code of a particular program so you can contribute to it or adapt it. This is encouraged in open source software, where code is deliberately shared for anyone to tinker with.

In cryptocurrency, this means that you copy the code behind a popular cryptocurrency node software (e.g., Bitcoin Core), maybe tweak it and change a few parameters, and then run the code to create an entirely new blockchain starting from a blank ledger. You’d say you forked Bitcoin’s code to create a new coin. This is how many alt-coins (alternative coins) were created in 2013-14. Litecoin for example was created using a copy of Bitcoin’s code with some parameters changed, including the speed of block generation and the kind of calculations that the miners had to in the proof-of-work challenge.

The key here is that, when you run the new code, you create a new ‘empty’ blockchain ledger from scratch - with an entirely new Genesis block. In the popular open source code-sharing platform GitHub, you can easily fork (copy) a project’s code with a few clicks of a mouse. You then have your very own copy which you can edit. These codebase forks are common and encouraged in open source technology development, as they lead to innovation.A fork of a live blockchain, better described as a chainsplit, is more interesting. Chainsplits can happen by accident or on purpose.

An accidental chainsplit is when there is an uncontentious upgrade to the blockchain software and some proportion of the network omits or forgets to upgrade their software, leading to a number of blocks being produced by them that are incompatible with the rest of the network. According to BitMEX research, this has happened a few times in Bitcoin’s history, with three identified chainsplits lasting approximately 51, 24, and 6 blocks, in 2010, 2013, and 2015, respectively. So forks can occur even when there is no contention over rule changes, creating some temporary confusion as to the ‘real’ state of the blockchain during the period where there is more than one candidate blockchain. Accidental chainsplits tend to be resolved quickly with the small proportion of participants upgrading their software and discarding the incompatible blocks.

A deliberate chainsplit occurs when a group of participants of a live network thinks that things should be done a different way from the rest of the participants, and runs some new software with changes to the protocol rules to create a new coin that has a shared history with the old coin. This deliberately splits the chain at a specific block according to a well communicated plan. Deliberate chainsplits can be successful, with both assets continuing to live and develop, or fail, where there is not enough participatory interest and the value of the token drops to zero, and stops being mined.

To execute a successful deliberate chainsplit, you need to publicly rally and persuade a group of miners, bookkeepers, exchanges, and wallets that your new rules are better than the existing rules. They will need to agree to support your new coin, creating a community supporting a new coin that people can buy and sell, store and use. When the chain splits, you have created a new coin with different protocol rules but which has a shared history with the original coin. Anyone with a balance on the blockchain before the split now has a balance in two different coins after the split.
So the determination of whether something is a protocol upgrade, a failed fork, or a successful fork is really about who chooses to adopt the new rules. If new protocol rules are adopted by the vast majority of the community, then it is called a protocol upgrade, and those who don’t upgrade have a choice to maintain the old rules as an attempted fork or to join the majority. If new protocol rules are adopted by very few participants, you have an unviable fork which may ultimately fail. If new protocol rules are adopted by enough participants to maintain a community and interest then it is a successful cryptocurrency fork.

Sometimes the terms hard and soft fork are used. These terms refer to changes in the rules about what constitutes a valid transaction and block. A soft fork is a change in the rules that is backwards compatible, meaning that blocks created under the new changed rules will still be considered valid by participants who didn’t upgrade. A hard fork is a change in the rules that is not backwards compatible, so that if some participants fail to upgrade, there will be a chainsplit. In practice, if changes to protocol rules are tightened or more constrained, this results in a soft fork, whereas if consensus rules are loosened, then this is a hard fork.

Forks are trendy. It is easier to take something that is proven to already work than to build something from scratch. And, as cryptocurrencies tend to be open source, it is legal to copy the code, tweak it, and run it. Community building with a forked chain is easier than building a new blockchain too. Anyone who had a balance on the original chain will also have a balance on the new chain, so they are more likely to support a fork where they have a balance, rather than support a new blank blockchain. People saw that Bitcoin Cash successfully forked and retained some currency value, so this spurred many copycats to try the same. However, there is only so much energy in the cryptocurrency space, and there seems to be some ‘fork fatigue’. Some commentators predict that many future forks will fail.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.