A Consensus Algorithm is a process in computer science used to achieve agreement on a single data value among distributed processes or systems. Consensus algorithms are designed to achieve reliability in a network involving multiple unreliable nodes. Solving that issue – known as the consensus problem is important in distributed computing and multi-agent systems.
From another angle,a consensus algorithm 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.
Consensus algorithm has an important place in computer science. It is used by computers to reach agreement on a single point of the data value. It is only used in distributed systems or processes.
How It Works
For a distributed network, It is not common for all the system nodes to be online every time a consensus is required. Also, there are chances that some information is lost during transmission. Consensus algorithm solves the biggest problem that a distributed or multi-agent system goes through.
It ensures that consensus is achieved with minimal resources, keeping integrity and transparency in the decisions it takes. To ensure that the whole system is fault-tolerant, consensus algorithm only require a reply from 51% of the resources at a time.
Illustrating it using an example of PoW consensus algorithm (we would get there later). A person sends 0.2 BTC from his wallet to another wallet. To ensure that the transaction goes through, the miner mines the block that the transaction needs to be in. Now, the miners start mining the block. After a while, it will get validated when the system does the minimum required for validations.
How Consensus Algorithm is Applied
There are numerous ways to apply consensus algorithm. Even though it is mainly used for the decentralized system, it is also useful in a centralized system. For better comprehension, these are the use cases of Consensus Algorithm
- The most basic application of the algorithm is to decide whether a transaction in a distributed environment needs to be implemented or not. Most of the blockchain networks use it.
- Consensus algorithm is also very useful in assigning a node a leader status.
- Lastly, they are also used to synchronize data across the decentralized network and ensure that consistency is achieved
Although our chief focus is on the Consensus Algorithm deployed on the Ethereum Blockchain, we are going to briefly examine the different types of Consensus Algorithm.
Types Of Consensus Algorithm
- Proof of Work (PoW): Proof of Work is the most popular consensus algorithm out there. Bitcoin, Ethereum and Litecoin use it. It was first devised by Satoshi Nakamoto when he used in his Bitcoin implementation. However, it is also the most inefficient way to achieve consensus in a blockchain as it requires a considerable amount of computational power. It works by asking miners to solve complex mathematical problems. Once the hash is solved, the block is mined and the transaction is validated at the same time. By solving, they create blocks which are later added to the blockchain. For this to work, 50% of the work always have to be honest. However, this whole mining mechanism of bitcoin needs high energy consumption and a longer processing time.
- Proof of Stake (PoS): This is the second most popular Consensus Algorithm. It works by staking coins in a wallet. The nodes that have staked their coins will have their say when a consensus needs to be achieved. The good thing about PoS is that it is not computational power hungry. The spending resource, in this case, is the tokens itself. If a staking node fails to vote for the correct transaction, they will lose their stake. If it succeeds, it will hold better chances to stake when a next transaction takes place. Examples of current industry-leading PoS blockchains include Polkadot, EOSIO, and Cardano. Ethereum, which was originally designed as a PoW blockchain, is in the process of transitioning to a PoS blockchain called Ethereum 2.0.
- Delegated Proof of Stake(DPoS): Delegated Proof of Stake may sound similar to PoS but is different in its approach. The first thing that differentiates them is that DPoS is not entirely decentralized. In this system, the stakers doesn’t validate the blocks, but they choose delegate. These delegates then validate each transaction. Generally, any decentralized system has 20-21 delegates that verify the transactions. This makes DPoS exceptionally efficient and is used by EOS, Steemit, and others.
- Proof-of-Authority(PoA): It is used for the entirely centralized system. This means that approved accounts (chosen by the system administrators) do the validations across the network. It is mainly used in private networks due to its centralized nature.
While PoW and PoS are by far the most predominant in the blockchain space, there are other minor consensus algorithms like Proof of Capacity (PoC) which allow sharing of memory space of the contributing nodes on the blockchain network. The more memory or hard disk space a node has, the more rights it is granted for maintaining the public ledger.
Proof of Activity (PoA), used on the Decred blockchain, is a hybrid that makes use of aspects of both PoW and PoS.
Proof of Burn (PoB) is another that requires transactors to send small amounts of cryptocurrency to inaccessible wallet addresses, in effect “burning” them out of existence.
Another, called Proof of History (PoH), developed by the Solana Project and similar to Proof of Elapsed Time (PoET), encodes the passage of time itself cryptographically to achieve consensus without expending many resources.
In the next chapter, we are going to dive deeply into Proof of Work(PoW), the Consensus Algorithm used on the Ethereum Blockchain.
What do you think about this article? Let’s hear from you in the comments section!