What is Consensus Mechanism
If we know about blockchain then we know the central idea on which the technology and its applications work. The idea is Decentralization which is the absence of a central authority in the transactions taking place over a particular blockchain. Then without a central authority, how does sophisticated stuff like transactions take place?? Who validates a transaction??
Well, blockchain validators or miners are the people who validate a transaction. As soon as a transaction takes place on a chain, the network of nodes is notified. After this, the miners take a bunch of transactions, validate them and put them in a particular block. But this process does not end here. All miners are building their blocks with valid transactions but the problem comes when we have to include a particular block on a chain. We cannot just go on and put all the blocks on the chain coz that's gonna cause a lot of ruckus.
So we need to agree on one particular block and add it to the chain subsequently. That's where the Consensus Mechanism comes into play.
What is Proof of Work
So if two miners want to add their particular blocks to the chain, how can we determine which block to add? Going by the Proof of Work mechanism, a cryptographic puzzle requiring high computational power to be solved will be given to the miners. The miner whose machine can solve the puzzle first gets to add the block on the chain. Computational power is the key factor here. A reward is given to the miner for solving the cryptographic puzzle. Herein, if someone is trying to add a malicious node, they will need to own 51% of the computational power which comes with a very heavy cost so the chances of someone adding a malicious node go down.
What is Proof of Stake
Proof of stake is another consensus algorithm for validating and adding the block to the chain. The difference here is that there are no cryptographic puzzles involved here. The factor which determines which block should be validated and added is how large of a stake a miner holds. The miner having the highest stake gets to add the block to the chain. The validator does not receive any rewards instead gets a network fee. Here the hacker or the person trying to add a malicious node needs to own 51% of all cryptocurrency on the network so again chances of adding a malicious node go down.
What is Ethereum Merge
Ethereum merge is the term used for Ethereum's transition from Proof of Work to Proof of Stake. Now you might think that what was the need to do so??
So the simple answer is that in Proof of Work as already mentioned the computational power is the key factor and this type of consensus mechanism is energy intensive which ultimately is responsible for environmental degradation coz it took a large amount of energy to mine one ether. But Proof of Stake on the other hand consumes 99% less energy than Proof of Work.
Transitioning from PoW to PoS replaced the crypto miners who had to compete with each other to solve a complex computational puzzle, with the stakers who lock up ETH for the right to validate the transactions.
And yeah, this was it. Thank you for reading the article folks. If you loved it, please do drop a heart coz it will motivate me to keep writing technical blogs.