What is Soft Fork?
Soft Fork is a split due to a functional update or a new protocol on Blockchain but after the change, is still backward compatible with the old protocol and version, i.e. the states of Blockchain are still accepted during the session. new version. That means nodes that don't update can still process transactions and push new blocks into the Blockchain as long as they don't break the rules in the new protocol. Soft Fork does not require nodes on the network to be forced to upgrade in order to maintain consensus, because all blocks on the Soft Fork Blockchain follow the old consensus rules as well as the new consensus rules. However, blocks created by nodes that are subject to the old consensus rule set will violate the new consensus rule set and, therefore, may fail validation on nodes that have updated to the new version.
As an easy example, when you use MS Excel 2003 on your computer and you get an MS Excel 2015 workbook, you can still open it because MS Excel 2015 is backward compatible.
BUT, there are still some differences. You can use almost all features of old version on new version but there will be many functions in new version that cannot be used on old version. For example, with MS Excel, the 2015 version allows you to include GIFs in the spreadsheet, however, if you open the spreadsheet, you won't see the GIFs displayed in the 2005 version. text, you will see all the normal text, but with extended functionality you won't be able to use it. I believe this site can give you more knowledge: Bitcoin exchange
On Blockchain, let's say we want to reduce the block size from 3MB to 2MB. In this case, nodes using the old version can still process transactions and push new blocks of 2MB or less. But it won't be possible to process and push a block larger than 2MB into the network. Nodes using the new version will reject the block because it violates the new rules.
What is a Hard Fork?
A Hard Fork is a Blockchain split due to a protocol or function change in the new version but this new protocol and functionality is not compatible with previous versions. In other words, nodes that do not update to a new version will not be able to process transactions or push new blocks to the Blockchain. Hard ork can be used to change or improve an existing protocol or even to create a new, independent protocol and Blockchain.
Hard Fork can be considered as a software upgrade that is incompatible with its previous versions. For example, you cannot play PS3 games on PS4 and vice versa, you cannot play PS4 games on PS3.
When a Hard Fork occurs, all participants in the network are required to upgrade to the latest version of the software in order to continue to be able to verify and validate new blocks of transactions. Blocks generated by nodes in the old version will be invalid in the new version and vice versa.
Example: Contrary to the example in the case of a Soft Fork occurrence, instead of reducing the block size, we want to increase the Blockchain block size from 1MB to 3MB. Then the old nodes that do not update the new protocol can still process the transactions and push the new blocks up to exactly 1MB. However, if a node that has been updated to a new version tries to push a 2 MB block onto the Blockchain, then the older, not updated nodes will consider the block as invalid and will therefore reject it.
Implementing a Hard Fork is extremely difficult, because it causes a lot of inconsistencies in the network, many people will not want to update, while many people want to make a change. Those who want to participate will then voluntarily upgrade their software to the new rules, and remove the old version. While those who don't update will still mine on the old chain. This causes the split and forms two different independent blockchains. Both Blockchains will have their own community and developers will operate in ways they believe to be best. Hard Fork can happen in two cases:
Planned Hard Fork: A planned Hard Fork is simply an upgrade to the protocol that has been previously clarified by project developers. Usually in this case there was a high consensus between the project developer and the community before the Hard Fork happened. An example of a planned Hard Fork is the Monero Crypto Hard Fork event which occurred in January 2017. The Hard Fork happened to add a new security feature called Ring Secret Transaction (RingCT). .
Competitive Hard Fork: This Hard Fork case occurs when there is a serious disagreement between different stakeholders in a project, which can include: project developer, network user, and miner. Competitive Hard Fork takes place because one part of the community believes that major changes in protocol will create one Blockchain with superior functionality while another part will not. A famous example of this type of Hard Fork is Bitcoin's Hard Fork that generates Bitcoin Cash.