Consensus Algorithms in Blockchain Systems
Tags: blockchain, computerscience, datascience
Published: 2020-08-09 15:34:49

*From “Proof of Work” to “Delegated Proof of Stake”: what mode of governance to build trust in a shared ledger through a decentralized network?*


*A behind-the-scenes look at the Blockchain: zoom in on the concept of consensus in order to fully understand this key process operating at the heart of the governance mode of a distributed ledger .In this article we will explain the consensus of the different algorithms by answering a few questions*.

##### *Project realized as part of the Cybersecurity sector of Higher Institute of Informatics Mahdia, the first Tunisian computer science school*

#What is a consensus algorithms ?

*By definition, a consensus algorithm is a computer process used to reach agreement on a single data value among distributed processes or systems. Consensus algorithms are designed to ensure reliability in a network involving multiple unreliable nodes.
What are the Main implementations of consensus algorithms ?
There are several implementations of consensus algorithms, each one has its advantages and its trade-offs Among the most used*
<ul>
<li>
####Proof Of Work (POW): </li>
*Proof of Work, is the first decentralized Blockchain consensus algorithm that has emerged, it is used in several types of “Altcoins” cryptocurrency such as Bitcoin, Ethereum, LiteCoin, etc. This algorithm is data that can only be obtained by performing a task that consumes a lot of computing power and that once it has been obtained, it is easy to verify that it is indeed the result of this task . Software installed on miners’ computers and servers accesses their processing capacity to solve transaction-related algorithms. A block is therefore an encrypted proof of work created in a computationally intensive process. Although any party can submit a succession of blocks to the Blockchain, the amount of computing resources required for a dishonest party to create a false consensus is too large for it is worth it.*

<br>

![proof of work](https://miro.medium.com/max/700/1*QauTrRUaCGoWtfKgxgcupA.jpeg)
<figcaption>Fig. 1. Flow of PoW</figcaption>

*However, PoW certainly has its drawbacks, it takes high power consumption and low transaction throughput compared to other algorithms.*
<li>
####Proof Of Stake (POS):</li>
*Proof of Stake is another type of consensus algorithms. This is a new concept used for the Peercoinen 2012 cryptocurrency. Other protocols have followed such as ShadowCash, BlackCoin, Nav Coin50 and Nxt. PoS selects the creator of a new block in a deterministic process, based on the number of coins they already own, also known as the wager. This is because there is no reward in this type of consensus algorithm, although minors, in this case called counterfeiters, only pay transaction fees. Among the significant advantages of this algorithm, we distinguish security, reduction of the risk of centralization and finally energy efficiency.*


![proof of work](https://miro.medium.com/max/591/1*M1gQLabRakPWg2ZainSnXQ.jpeg)
<figcaption>Fig. 2. Flow of PoS</figcaption>
<li>
####proof Of Authority (POA): </li>
*Proof of Authority is a consensus mechanism inspired by the Proof Of Work consensus algorithm. transactions and blocks are validated by approved accounts, called validators, which is based on the process of using the identities of network users to choose the best validator to verify and validate transactions.
Among its advantages, a reduced demand for computing power of the nodes, a transaction time significantly faster than that of networks based on PoW and PoS, and finally, the algorithm of the proof of authority offers a significant scalability and flexibility for the development and maintenance of decentralized applications.*



![proof of work](https://miro.medium.com/max/700/1*bdNvm6i_5Y9Ad-27bVASoQ.png)
<figcaption>Fig. 3. Flow of PoA</figcaption>


#What are the Difference Beetwen this consensus protocols ?
*In the table below is presented a synthetic comparison of the consensus mechanisms discussed throughout this article. This comparison was made on the basis of all the issues related to the said mechanisms that we have gradually dealt with: Security, incentive, equipment, energy consumption, node identity , scalability, etc.*

![proof of work](https://miro.medium.com/max/560/1*G72_ojlZYXF5OuQJI2HsFQ.png)


#Conclusion :
*In conclusion, when considering deploying a blockchain-type solution with a view to solving a concrete problem (business application, specific use case), it is imperative to take into account certain considerations, both functional and non-functional, before being able to ensure the relevance of a particular consensus mechanism:
<ul>
<li>__Public__ (permissionless) or __private__ (permissioned) nature of the desired platform.</li>
<li>__Performance objectives__ (transaction flow in particular)
<li>__Energy consumption__ limit.</li>
<li>Node network __scalability__ and __size requirements__ (miners, miners, replica nodes).</li>
<li>Desired relationships between __the different actors__: users, validation nodes and developers.</li>
<li>Level of __decentralization__ and “__philosophy__” demanded by the sponsor or the user community.</li>
<li>__Security level__ and __fault tolerance__.</li>
<li>etc.*</li>