Source: https://cdn2.hubspot.net
Currently, there is a lot of talk in the cryptocurrency scene going on about hardforks and softforks. There is a chance Bitcoin might soon experience either a hardfork or a softfork, Etherium experienced a hardfork last year and a planned Steemit hardfork recently failed due to the fact that the witnesses didn't reach consensus. Now, I don't expect you to know or understand these things (yet). For this article you don't have to know about Bitcoin, Ethereum or the witness system of Steemit. All I want to do with this article is to shed some light on hardforks, softforks and their differences.
First things first: A bit of history
Source: http://www.instructables.com
The word fork has been used for a longer time in the (FLOSS) software development scene. If a project is FLOSS, people can, at any given time, copy the current codebase (i.e. the whole source code making up a program, app or website) to their own infrastructure (i.e. their own server) and start working on this codebase. If a program is truly free, people wanting to fork a certain software don't need the agreement of the initial developers to do that.
The reasons for such a fork might include disagreement over the direction of a project, disagreement over a technological feature, disagreement over some legal issues or the inactivity of the current developer(s). There are countless examples of more or less successful forks. Here I would like to list just a few:
- LibreOffice is a fork of OpenOffice
- LibreSSL is a fork of OpenSSL
- Litecoin is a fork of Bitcoin
- ...
Hardforks vs. softforks
Terminology
Now that we know where the word fork comes from, we can start to dig a bit deeper and talk about hardforks and softforks. But let's first define some important words before we go on with our explanations.
Blockchain
You might already know that most cryptocurrencies rely on some sort of blockchain which stores everything happening on the corresponding network. For example, the Bitcoin network stores transactions and the Steemit network stores the content written by its users on its blockchain. You can think of a blockchain as a large container storing all important events for future records.
Nodes
This blockchain has to be stored somewhere. The Bitcoin network uses so called nodes that are being used to fully validate transactions. In Steemit, there are witnesses to create and sign blocks of transactions on their nodes. This being written, we now know that in the world of cryptocurrencies nodes are simply servers containing the current state of the blockchain.
Miners and Witnesses
In order to explain mining in Bitcoin, let me just rely on this definition taken from here: "With Bitcoin, miners use special software to solve math problems and are issued a certain number of bitcoins in exchange. This provides a smart way to issue the currency and also creates an incentive for more people to mine." In Steemit, the miners are not called miners but witnesses. We already learned about their tasks above.
Now, that we know about some basic definitions we can finally continue with our initial goal of defining hardforks and softforks. Let's start with the latter:
Softforks
If a cryptocurrency network experiences a softwork, a new set of rules is implemented in the most recent release. All nodes of miners (or witnesses) running the latest version add one or more "words" (i.e. rules) to their "alphabet" (i.e. the current set of rules). Softforks have the following properties:
- They are forwards-compatible. That means that nodes running an older version of the software will accept blocks created by new nodes.
- After a softfork, only miners have to update their software. Normal users can keep running older nodes, which will accept the newer blocks. However, users wanting to use new rules which haven't been implemented before would still have to shift to the new version.
In order for a softfork to be successful at least 51% of the mining power has to shift to the new version. Once that happens, transactions from older clients incompatible with the new set of rules will simply be ignored by the network and become invalid.
Hardforks
If a cryptocurrency network experiences a hardfork, a new set of rules is implemented in the most recent release. All nodes of miners (or witnesses) running the latest version add one or more "words" (i.e. rules) to their "alphabet" (i.e. the current set of rules). Hardforks have the following properties:
- They are not forwards-compatible. That means that nodes running an older version of the software will not accept blocks created by new nodes.
- After a hardfork, every single user (normal users and miners alike) has to use the new software version. If someone decides not to do that, he or she will be excluded from the network.
My head hurts. Can you give me a SIMPLE(!) example?
Don't worry, I will. Ladies and gentlemen, let me introduce to you: Hagbardcoins (currently version 0.1) as an example.
Hagbardcoins is the new cryptocurrency star solving all problems of all current cryptocurrencies. Unfortunately, it's not so well known yet and there are only 100 miners so far.
With Hagbardcoins sending positive amounts is totally possible because for every amount sent, the main developer decided to implement an algorithm taking the absolute value of the amount first. For example, Alice can send +123 Hagbardcoins to Bob without any problems. If she decides to send -123 Hagbardcoins, the absolute value is simply taken first and thus Bob receives +123 Hagbardcoins.
However, one fateful day the main developer of Hagbardcoins had a brilliant idea: Why shouldn't we allow sending negative amounts as well? Wouldn't it be great if Alice could send -123 Hagbardcoins to Bob and actually deduct money from Bob's wallet by doing so? The main developer was so excited about this idea that he immediately started to implement this new feature (i.e. rule) and released the new version 0.2 of Hagbardcoins. 80 out of 100 miners simply loved the idea. The others were just too stupid to acknowledge its benefits. Thus, the network ended up with the following situation:
- Alice (running version 0.1) can send +123 Hagbardcoins to Bob (running version 0.2)
- Alice (running version 0.1) can not send -123 Hagbardcoins to Bob (running version 0.2) [because this new feature simply isn't implement in version 0.1. Instead, Bob would receive +123 Hagbardcoins from Alice]
- Bob (running version 0.2) can send +123 Hagbardcoins to Alice (running version 0.1)
- Bob (running version 0.2) can not send -123 Hagbardcoins to Alice (running version 0.1) [because this new feature simply isn't implement in version 0.1. Instead, Alice would receive +123 Hagbardcoins from Bob]
- Bob (running version 0.2) can send -123 Hagbardcoins to Claire (running version 0.2) [because both clients understand this new feature]
Gradually, more and more users wanted to switch to the new version because deducting money from other people's wallets sounded like fun to them. However, a small minority of 20 miners simply didn't get the concept (They said things like "Deducting money from other people's wallets? That's theft! An outrage!"). Thus, they refused to switch to the new version of Hagbardcoin and forced a hardfork as they simple stayed on their blockchain. The result was that soon there was "Hagbardcoin" and "Hagbardcoin Classic" existing parallel to each other. On the Hagbardcoin blockchain people could send positive and negative amounts to each other, while on the Hagbardcoin Classic blockchain only positive amounts were accepted.(By the way: A similar thing happened to Ethereum which is the reason why we now have "Ethereum" and "Ethereum Classic").
Summary
Thank you for reading. Please let me know if there are still some questions left. For those of you who couldn't make it to the end of this article, here is the short version:
TL;DNR:
Softforks are forwards-compatible. That means that nodes running an older version of the software will accept blocks created by new nodes. After a softfork, only miners have to update their software. Normal users can keep running older nodes, which will accept the newer blocks. However, users wanting to use new rules which haven't been implemented before would still have to shift to the new version.
Hardforks are not forwards-compatible. That means that nodes running an older version of the software will *not accept blocks created by new nodes. After a hardfork, everybody who wants to keep using the current state of a cryptocurrency has to update their client.
EXCELLENT EXPLANATION THANKS. I would like to know the disagreements between SegWit and Bitcoin core. Any recommendations?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you very much for your reply. That's not an easy topic you are asking about and probably it would deserve its own article. However, I will do my best to summarize the current situation: SegWit (short for: Segregated Witness) is a proposed soft-fork of the Bitcoin Core development team. SegWit allows for 70 % more transactions in comparison to the what is possible these days. As SegWit is a proposal by the Bitcoin Core team, there is no disagreement between SegWit and Bitcoin Core. What you are probably referring to is the disagreement between Bitcoin Core and Bitcoin Unlimited. The Bitcoin Unlimited project proposes to change the blocksize for each block to 2 or more megabytes. This would require a hard-fork as this blocksize is incompatible with the current 1 MB blocksize of Bitcoin.
Thus, the real question the Bitcoin community is facing these days is: Soft-fork (SegWit) or hard-fork (larger blocksize)? Personally, I'm a huge SegWit fan, btw...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you! for your explaination about hardfork and softwork. Nice! :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you. You're welcome.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Very nice and creative example to explain the consequences of a hardfork! :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you very much @jaki01.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Very clear! Thanks for sharing!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for reading. :-)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for your post. If anyone here uses a Ledger hardware wallet, like the Ledger Nano S you might find this helpful https://steemit.com/bitcoin/@digicrypt/what-would-happen-for-ledger-hardware-wallet-users-in-case-of-a-bitcoin-fork
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for pointing this out, @digicrypt.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
No problem :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit