Blockchain Consensus Algorithms Explained: Everything You Need to Know
Blockchain is best known as the technology that underpins cryptocurrencies like Bitcoin. The system works as a secure digital ledger that acts as the go-between by authenticating transactions and making it difficult for hackers to spend a token more than once, modify a record, or falsify entries.
The blockchain protocol runs on a Peer-to-Peer network of computers that all power the system and hold an identical copy of the ledger of transactions, enabling peer-to-peer value transactions to occur without an intermediary through machine consensus.
Consensus algorithms are the mechanisms used by network participants (nodes) to achieve agreement on a single data value before it is recorded on the ledger.
Since all network operators each possess a copy of the blockchain and we cannot be sure of the trustworthiness of the information being received, it becomes necessary for all participants of the blockchain to authenticate data before it is permanently added to the database. Thus, consensus algorithms enable nodes to evaluate and agree on all addenda in a distributed and trustless manner.
That said, here are the things you need to know about some of the most popular consensus algorithms:
1. Proof of Work (PoW)
Bitcoin’s Proof-of-Work algorithm was the first distributed and trustless consensus algorithm to be implemented. The technology requires miners to solve difficult mathematical problems before they can add a block to the blockchain. Miners are rewarded with units or fractions of the digital currency which runs on the blockchain in exchange for solving the puzzles.
Other than bitcoin, cryptocurrency projects that uses the PoW technology include Litecoin, Ethereum, Bitcoin Cash, Monero, Litecoin, Dash, Dogecoin, etc. So in the case of bitcoin mining, the first participant to correctly solve a puzzle is rewarded with units of bitcoins, after which all miners will begin to work on the next block.
Each block added to the PoW blockchain must follow set consensus rules. In the case of bitcoin, these rules require transactions and blocks to be in the correct format and forbid double spend. In addition, only a certain amount of block reward is offered in exchange for solving the complicated math puzzle.
Blocks that fail to adhere to these rules are rejected by network participants. The combination of these rules and the PoW consensus algorithm is what enables network nodes to achieve agreement on the contents of the blockchain.
One of the major drawbacks of the Proof of Work algorithm is that its electricity usage is enormous. This is due to the fact that the computer does millions of hashes (calculations) per second. The more hashes a computer make, the higher its chances of successfully mining a block.
To take control of the system, a hacker will need to possess a 51 percent stake/access to the network, which is an impossible feat to achieve given the massive number of participants on this blockchain.
2. Proof of Stake (PoS) Algorithm
The Proof of Stake Algorithm takes a different approach to PoW with regard to block generation. Unlike PoW, PoS does not require network participants (validators) to find the correct hash in order to generate a new block. Instead, validators are chosen at random to generate a new block.
An operator’s chances of being picked increases the more stakes (i.e. the cryptocurrency a participant owns and pledges) they own. Beyond just the amount of coins a validator holds, their chances of being picked also depends on the length of time the operator has held the tokens in their wallet. This means that validators who own a large volume of coins over a long period are more likely to be selected to create a new block.
With PoS, a block is generated when a validator sends a special type of transaction that locks up their economic stake. The stake serves as collateral for the block creation process. The PoS algorithm encourages honesty. As such, network operators who try to game the system and validate fraudulent transactions usually have their stake slashed. Conversely, participants who correctly validate blocks get back their deposit and are paid a transaction fee for the validation process.
The PoS algorithm consumes less electricity than the PoW one. The PoS algorithm has been implemented by major cryptocurrency projects like PeerCoin, NEO, Dogecoin, Pivx, Ethereum (soon), etc.
3. The Delegated Proof-of-Stake (DPoS) Algorithm
DPoS is a truly decentralized algorithm that combines a real-time voting system with a social system to achieve consensus. The system is similar to the PoS algorithm in that users are required to put up a certain cryptocurrency amount to vote. However, the aim of voting here is to elect super representatives who would be charged with the responsibility of protecting the network.
Representatives who are elected to protect the network are called “delegates.” The number of delegates on the network ranges from 21 to 100. The DPoS algorithm conserves energy better than the PoS one. This is mainly because of the limited time participants have to add another block to the network.
Digital currencies powered by the DPoS system include Steem, BitShares, Nano, Lisk, Cardano, EOS, etc.
4. Directed Acyclic Graphs (DAGs) Algorithm
The DAGs consensus algorithm offers something different from other systems, as it does not run on the blockchain. The program runs different transactions on different chains concurrently. As a result, it offers several advantages such as high-speed transactions.
Also, it is important to note that mining isn’t carried out on the DAGs network. For that reason, network participants depend on previously confirmed transactions to validate new ones. Cryptocurrency projects that implemented the DAGs algorithm include IOTA, NXT, Radix, Oyster PRL, etc.
5. Proof of Authority (PoA)Unlike other blockchain consensus algorithms, the PoA system is highly centralized. As such, transactions and block generation are authenticated by admins whose accounts have been approved on the network.
PoA users are required to disclose their identity when staking on the network. Doing so gives them the right to validate blocks on the system. Another way PoA differs from other popular blockchain algorithms like PoW is that no mining is conducted on the network. This makes the system less energy intensive when compared to other algorithms.