Understanding Crypto World: Forks, Airdrops & Swap's

in #crypto6 years ago

What are forks?

Blockchains start at a defined ‘Genesis block’. When new blocks are mined they point to a parent block. The “blockchain” is defined as the longest possible chain of blocks leading to the Genesis block.
Sometimes, multiple miners will mine blocks at the same time, pointing to the same parent block, resulting in a block with multiple children blocks, or a fork. This is 100% normal and expected in the operation of a blockchain. The network typically chooses one side of the fork and other side becomes 'Orphaned'.

Pasted image.png

What is consensus?

Consensus is a strict set of rules that all nodes on the network follow to determine if a new block is valid.

For example:

A block must point to a previous valid block (valid due to these rules).
A block must only contain valid transactions.
Transactions must spend coins which previously exist.
Coins must only be spent once.
Transactions must be cryptographically signed by the correct address of the coins.
A block is allowed to contain one transaction that creates coins out of thin air (the so called miner reward).
This transaction must have a correct miner reward value for that block height.
It may be sent to any address.
The block (and all the transactions in it) must be less than 1MB.
Nodes check each block (and the transactions inside) as they receive them against these consensus rules and reject any blocks which don’t match as invalid.

Deliberate forks

Sometimes developers need to change these consensus rules in order to implement new features.

These updated consensus rules are supplied in software updates, and are normally implemented so they only apply after a certain block height or date.

There are 2 types of forks: Soft and Hard forks.

What are soft and hard forks?

The difference between a soft and hard fork lies with how they change consensus. Soft forks restrict the current set of rules. New created blocks will abide by more limits.

A soft fork is backwards-compatible, and the miners are the players that decide whether it is used. The users and merchants can keep using the old rules (old software), but it is recommended that they do the upgrade.

To borrow an explanation from a video from Andreas M. Antonopoulos, a soft fork is like a vegetarian restaurant deciding to go vegan. All the customers (vegetarians) can eat the new (vegan) meals without problem.

A hard fork occurs when a new feature or set of new features are developed and they drastically modify block acceptance rules. After being pushed to a cryptocurrency project, everybody (miners, users, merchants, etc.) has to upgrade.

Consensus rules are relaxed or outright changed in such a way that old software sees the newly mined blocks as invalid.

Hard forks are not backwards-compatible. People using the old rules/nodes will end up on a different fork of the blockchain that does not include any correct blocks.

To borrow from the same video as before, a hard fork is like a vegetarian restaurant deciding to now include meat with their meals. All the customers (vegetarians) cannot eat the new meals unless they decide to change to meat-eaters.

Some communities go out of their way to only utilise soft forks as a way to preserve backward compatibility. Many communities, like Ethereum and Monero not only embrace hard forks, but schedule them on a regular basis as the primary method of updating.

90% of coins usually go through a hard fork or use hard forks to update consensus.
95% of the time, the original fork of the chain dies off and is forgotten and coins on that fork become worthless.

Pasted image.png

What happens when both sides of the fork survive?

While hard forks and soft forks are common, as coins go through their normal update procedures, normally only one side of the fork is supported and active.

However, sometimes competing communities make an effort to keep both sides of the fork alive. For example, Bitcoin and Bitcoin Cash; Ethereum and Ethereum Classic; Monero, Monero Classic and Monero V.

In this case, anyone that has held the original currency (in their personal wallet) at the time of fork will have both currencies after the fork.

Going back to our diagram, both sides of the fork survive, both blockchains share a common history and both chains are ‘worth something’.

Pasted image.png

What are airdrops?

Airdrops occur when cryptocurrency users are given free coins/tokens automatically due to their holdings of other currencies (or in return for performing certain actions).They are largely used to promote and incentivize use of a cryptocurrency, which is especially valuable in the early stages after a launch.

In their most basic forms, airdrops achieve the same effect as forks where both sides of the chain are supported, anyone who held the original currency at the time of the airdrop will have both the airdropped and original currencies. However, airdrops use a completely different mechanism where they snapshot the balances of every single address on the original blockchain, and send the appropriate amount of the airdropped currency to each address on the new blockchain.

The original and new blockchains are 100% different, except for the copying of balances.

Pasted image-1.png

What are coin swaps?

A coin swap is used by developers of a cryptocurrency project when they want to move users from one blockchain, to another.

Coin swaps are usually done when the developers behind a project want to port their token to a newer version of the same blockchain. There may be problems with the initial blockchain, or the developers simply want to make a significant change to the software and protocols behind the project.

A swap is opt-in by the user. Typically, the user will initiate the swap by sending their old coins to an address, which are then burned (destroyed forever) in exchange for coins from the new blockchain – at a consistent, predetermined rate. Swapping is a permanent process. Once a coin is swapped and burned, it can’t be redeemed back on the original blockchain.

Pasted image.png

Coin swaps are essentially the same thing as airdrops, except the old blockchain is no longer supported, and the new blockchain is declared to be “the same currency”.

Unfortunately, coinswaps interfere with Cryptopia’s internal systems, as they expect the full transaction history of all deposits to be untouched during upgrades.

We recommend currencies avoid unnecessary coinswaps, and modify the consensus rules of the new codebase until it accepts the old blockchain. Then we can apply this as a simple update for free.

Conclusion

Soft fork: a restriction of the block acceptance rules – backwards compatible – everyone using the current coin version are advised to upgrade as soon as possible.

Hard fork: a modification of the block acceptance rules – not backwards compatible – everyone using the current coin version has to upgrade before after the fork. Everyone has to upgrade.

Airdrop: when cryptocurrency users are given free coins/tokens automatically due to their holdings of other currencies (or in return for performing certain actions).

Coin swap: a coinswap is an airdrop in exchange for some proof of coins on the other chain (usually a proof of burn). Usually initiated by developers of a cryptocurrency. Source: Support.cryptopia.co.nz