Consensus Mechanism
A Complete Beginner’s Guide To Consensus Mechanism:
📷Image source: google.com/url?sa=i&url=https%3A%2F%2Fw..
What Are Consensus Mechanism?
A consensus mechanism is a fault-tolerant mechanism that is used in computer and blockchain systems to achieve the necessary agreement on a single data value or a single state of the network among distributed processes or multi-agent systems, such as with cryptocurrencies. It is useful in record-keeping, among other things. In other words - Consensus Mechanism refers to the entire stack of protocols, incentives and ideas that allow a network of nodes to agree on the stake of a blockchain.
Why Do We Need Consensus Mechanism?
Consensus Mechanism is the backbone of all cryptocurrency blockchain and that what make them secure and safe. The goal of a consensus mechanism in the world of crypto is to prevent bad actors from deliberately cheating. The classic example of cheating in the world of crypto is “double-spending.”
Suppose Anthony, the bad guy in this scenario, tries to cheat by transferring 10 tokens to Bethany and then trying to transfer the exact same 10 tokens to Chris. The challenge is to make sure everyone can always know and agree on who owns which tokens. With that agreement, or consensus, Chris would already know that Anthony no longer owns the tokens he is proposing to send.
To “double-spend,” a bad actor would need to get the nodes to adopt a false history of the transactions, a narrative where the bad actor has not spent the tokens and given them to Bethany.
Consensus mechanisms solve the double-spending problem by making it expensive and difficult to propose a new block of validated transactions, discouraging bad actors from trying.
Simultaneously, the mechanisms incentivize the "good" nodes to propose blocks they genuinely believe will be accepted in order to receive valuable rewards. As long as there are more good actors than bad actors, Anthony will not be able to change the records on the blockchain to falsify his transaction with Bethany.
Types of Consensus Mechanisms
📷Image source: content-hub-static.crypto.com/static/4437c0..
Two major Mechanisms are PoW and PoS .
Proof of Work (PoW)
Used by Bitcoin and many other public blockchains, proof of work (PoW) was the very first consensus mechanism created. It is generally regarded to be the most reliable and secure of all the consensus mechanisms, though concerns over scalability are rife. While the term ‘proof of work’ was first coined in the early 1990s, it was Bitcoin founder Satoshi Nakamoto that first applied the technology in the context of digital currencies.
In PoW, miners essentially compete against one another to solve extremely complex computational puzzles using high-powered computers. The first to come up with the 64-digit hexadecimal number (‘hash’) earns the right to form the new block and confirm the transactions. The successful miner is also rewarded with a predetermined amount of crypto, known as a ‘block reward’.
As it requires large amounts of computational resources and energy in order to generate new blocks, the operating costs behind PoW are notoriously high. This acts as a barrier of entry for new miners, leading to concerns about centralisation and scalability limitations.
And it’s not just the costs that are high. The most common criticism of PoW is the impact the electrical consumption has on the environment. This has led many to seek more sustainable, energy-efficient consensus protocols, such as proof of stake (PoS).
Proof of Stake (PoS)
As the name suggests, this popular method of consensus revolves around a process known as staking. In a proof of stake (PoS) system, miners are required to pledge a ‘stake’ of digital currency for a chance to be randomly chosen as a validator. The process is not unlike a lottery whereby the more coins you stake, the better your odds.
Unlike in PoW where miners are incentivised by block rewards (newly generated coins), those who contribute to the PoS system simply earn a transaction fee.
PoS is seen as a more sustainable and environmentally-friendly alternative to PoW, and one that’s more secure against 51% attack. However, as the system favours entities with a higher number of tokens, PoS has drawn criticism for its potential to lead to centralisation. Prominent PoS platforms include Ethereum (ETH), Cardano (ADA), Solana (SOL), and Polygon(MATIC).