Hey there, I am Samrat Gupta aka Sm4rty, a Security Researcher and a Bug Bounty Hunter. This is the second blog in Ethereum basics Series. In this blog we will learning concepts of Consensus and also some common types of consensus like Proof-Of-Work and Proof-of-Stake and Proof-of-Authority. Lets get started:
Overview:
1. What is Consensus?
2. What is Proof-Of-Work?
3. What is Proof-Of-Stake?
4. PoW vs PoS:
5. The Merge (ETH moves to POS):
6. What is Proof-Of-Authority?
Consensus Mechanism:
In general term, Consensus can be defined as a “general agreement among a group of people.”
As we know blockchain is decentralized, there is not any single authority to take decision. However, since decisions about future development and maintenance of the project still have to be made, a consensus algorithm allows network participants to arrive at a common decision.
Consensus algorithms are vital in large-scale, fault-tolerant systems because they enable a set of distributed/replicated machines or servers to work as a coherent group and agree on system state, even in the presence of failures or outages. There are many types of Consensus Mechanism like Proof-of-work, Proof-of-stake. Few of them are explained below.
Further Reads:
https://ethereum.org/en/developers/docs/consensus-mechanisms/
https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
What is Proof-Of-Work ?
Proof-of-work is the mechanism that allows the decentralized Ethereum network to come to consensus, or agree on things like account balances and the order of transactions. Proof of work is the first and currently most popular consensus algorithm for blockchain applications. Satoshi Nakamoto devised proof of work as a series of cryptographic puzzles for a computer to solve in order to create a new block. These puzzles are known as cryptographic hash functions, and they’re only solvable using guess-and-check, even for computers. The computers that solve the function are called miners.
The computer that finds the answer receives a reward, but the thousands of other computers working on the problem just wasted their time and energy. This is the reason why proof-of-stake is getting more attraction. Ethereum 2.0 is coming with major changes i.e. moving towards Proof-of-stake from Proof-of-work consensus.
Further Reads:
https://www.geeksforgeeks.org/proof-of-work-pow-consensus/
https://www.investopedia.com/terms/p/proof-work.asp
What is Proof-Of-Stake ?
Proof-of-stake is a type of consensus mechanism used by blockchains to achieve distributed consensus. In proof-of-work, miners prove they have capital at risk by expending energy. In proof-of-stake, validators explicitly stake capital in the form of ether into a smart contract on Ethereum. This staked ether then acts as collateral that can be destroyed if the validator behaves dishonestly or lazily.
Proof-of-stake reduces the amount of computational work needed to verify blocks and transactions that keep the blockchain, and thus a cryptocurrency, secure. Proof-of-stake changes the way blocks are verified using the machines of coin owners. The owners offer their coins as collateral for the chance to validate blocks. Coin owners with staked coins become “validators.”
Validators are then selected randomly to “mine,” or validate the block. This system randomizes who gets to “mine” rather than using a competition-based mechanism like proof-of-work.
Proof-of-stake is designed to reduce the scalability and environmental sustainability concerns surrounding the proof-of-work (PoW) protocol. Proof-of-work is a competitive approach to verifying transactions, which naturally encourages people to look for ways to gain an advantage, especially since monetary value is involved.
Further Reads:
https://www.investopedia.com/terms/p/proof-stake-pos.asp
https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/
Proof-of-Work VS Proof-of-Stake:
Further Reads:
https://www.geeksforgeeks.org/difference-between-proof-of-work-pow-and-proof-of-stake-pos-in-blockchain/
Ethereum Merge:
Proof-of-stake (PoS) is the consensus mechanism that Ethereum will use after The Merge. Ethereum is moving off of proof-of-work (PoW) to proof-of-stake because it is more secure, less energy-intensive, and better for implementing new scaling solutions. While it has always been the plan to transition to proof-of-stake, it is also more complex than proof-of-work, and refining the mechanism has taken years of research and development. The challenge now is to implement proof-of-stake on Ethereum Mainnet. This process is called “The Merge”
Some Key Points:
1. Ethereum Mainnet will merge with the Beacon Chain proof-of-stake system.
2.This will mark the end of proof-of-work for Ethereum, and the full transition to proof-of-stake.
3. The Merge will reduce Ethereum’s energy consumption by ~99.95%.
Further Reads:
https://ethereum.org/en/upgrades/merge/
https://medium.com/@Beosin_com/ethereum-upgrade-the-merge-63116b8162fa
What is Proof-of-Authority?
Proof-of-Authority consensus algorithm is the same as PoS, provides a system of trusted nodes. But in order to become one of the validators of the presence of a certain amount on the balance and, the ability to run a full node will not be enough, the main condition is an impeccable reputation.
Each new candidate goes through a full identity verification and approved by the central authority. And, therefore, there is no smell of decentralization here. But this model is perfect for many businesses and companies. In the Proof of Authority system, validators, referred to here as network moderators, must:
1. Place a bet.
2. Reveal all personal.
3. Go through a rigorous selection process.
Further Reads:
https://www.geeksforgeeks.org/proof-of-authority-consensus/
https://medium.com/poa-network/proof-of-authority-consensus-model-with-identity-at-stake-d5bd15463256