What and Why Do We Need Consensus Mechanism?
If you are reading this you probably knew that transactions are stored in blocks chained together in cryptocurrency.
Cryptocurrencies are known to be “Decentralized”, so this leads to a problem.
Unlike banks which are central authority to validate and store all transactions,
in cryptocurrency,
1) How do we trust the transactions recorded inside a block? That no one can modify this publicly available ledger?
2) How do we make sure that these blocks are synchronized in every node?
To solve this problem, we need to have “consensus” on blocks that are to be added to the blockchain.
Two Common Consensus Mechanism Today (2021)
There are a lot of consensus mechanism out there, all doing their own magic.
Some examples are Proof of Work, Proof of Stake, Delegated Proof of Stake, Proof of Capacity, Proof of Activity and etc.
I am just cover two of the most popular mechanisms here, which is
1) Proof of Work
2) Proof of Stake
Proof of Work
- Uses computational power to mine block rewards
- In the case of Bitcoin, computational power are used to find hash that is below target. Usually takes a lot of time and power, which proofs that a lof of work had been put inside a block and we can trust it.
- Need hardware to mine (CPU, GPU, ASIC)
- Need to own 51% of total computational power on network to launch an attack on integrity of blocks, which is impractical
- Network only accepts block that had the most effort/work put into it
- Used by Bitcoin
Proof of Stake
- Uses “stake” to validate blocks, paid transaction fees as reward
- Uses less energy compared to Proof of Work
- Need to invest in some amount to earn transaction fees by validating blocks
- Need to own 51% of circulating supply to launch an attack, which is impractical and will adversely impact the value of that cryptocurrency too.
- Used by Ethereum