Some of the most popular consensus algorithms are Proof of Work and Proof of stack. Those algorithms have proven their efficiency and security over time after years of being implemented ...
The consensus mechanism is responsible for the security of the Blockchain data. Therefore, choosing the right mechanism during the building of the Blockchain is an inevitable action. However, this task is not always evident to do as it may impact the whole Blockchain future. Therefore, how do you choose a consensus mechanism?
Choosing a consensus algorithm depends on several factors. These factors are finality, performance, scalability, and energy consumption. However, the core safety and liveness properties of the consensus should always be respected by any chosen one.
In this blog post, we are going to explain in detail those factors to get a better idea about how they impact the Blockchain work. In addition, you are going to see the differences between some of the most popular mechanisms and where each one is used.
Knowing those details, may not have a big impact on the way the security auditor will perform his job. However, if you also do an architecture audit for a Blockchain, knowing this will give you a critical view of the system to better find its vulnerabilities. So if you are interested, just keep reading.
Choosing the right consensus for a new Blockchain is a case-dependent problem. However, finding the right consensus for your Blockchain means finding the balance between the four following factors:
When building a financial type Blockchain, I guess the first thing you may need to think of is the Finality aspect of the transaction. This factor simply means that once a transaction is submitted it cannot be rolled back. This means that the chosen consensus in the financial Blockchain should give a level of trust to the users, as their client’s transactions will never be rolled back once they get validated in a block.
This factor could be implemented in the consensus algorithms in two different ways, the probabilistic implementation or the deterministic one. In the probabilistic implementation, the transactions are validated but the probability of being rolled back gets reduced over time. The more time passed after the transaction was submitted the more the block containing this transaction get down in the Blockchain and become very difficult to be rolled back.
For example, the Proof of work consensus in the Bitcoin Blockchain is a probabilistic finality implementation. The submitted transactions are validated after 10min and the users should wait for at least 6 blocks validations before they become sure that the transaction will never be rolled back.
Unfortunately, this probabilistic aspect of the finality may not work in other cases. Therefore, a deterministic approach may be the best idea. In contrast to the probabilistic implementation, the deterministic one, give 100% confidence to the users, that their transmitted transaction will never be rolled back once they get validated in a block.
The performance of the consensus algorithm is one of the most important aspects that could impact the whole blockchain. If the transaction validation speed is crucial in the day-to-day operations, then choosing a time-consuming algorithm, like PoW may not be the best choice. However, the IBFT or even the PBFT algorithm might work perfectly in such cases. Both algorithms are known for their speed in executing the transactions. However, both of them are not suitable for public Blockchains where nodes join the Blockchain without access control.
Another factor that may impact the choice of the consensus algorithm is the scalability of the Blockchain. In the Blockchain industry, scalability refers to a computing process’s capacity to be utilized or created in a variety of ways. In simple words, it refers to the network’s capacity to handle a greater number of events.
Therefore, if the Blockchain is intended to get bigger over time, then choosing a consensus that does not scale very well may impact your Blockchain. You should also know that some consensus algorithms are more suitable for small Blockchain networks to give better performance and work correctly than others.
Knowing what type of Blockchain you are going to build is crucial to determine the scalability you are looking for and choosing the right consensus. If you need more details about the performance of each type of Blockchain I highly encourage you to take a look at the following blog post.
One of the newly added consensus choosing factors is energy consumption. This factor is rising now because it is the main problem that everyone is looking at in the Bitcoin Blockchain. With more nodes joining the Bitcoin network, more computations power needed to solve the digital puzzle to validate transactions is rising as the difficulty is getting even higher too.
Therefore, if the energy is something limited or important in the Blockchain you are developing then, using a PoW consensus might not be a good idea as it will consume so much energy. Even if the cost of the energy could be managed, its impact on the environment will never be.
Here is a summary of the key characteristics of the different consensus algorithms. You can use this table to choose which algorithm will better suit your Blockchain.
Many other consensus algorithms than the ones presented in this table exist and are already implemented in many popular blockchains. Like, Proof-of-Weight which is implemented in the Algorand cryptocurrency, or the Proof of Elapsed Time which is implemented in the HyperLedger Sawtooth and so many others.
However, those algorithms are either still under test and research or recently adopted. This means that they are still not well tested in the real life. Therefore, we decided to only put the most popular and widely used consensus in the community. I highly encourage you to take a look at the blog post that was made by vasa about the 29 consensuses they have collected with the different Blockchain that implement those consensuses.
Written by: Z. Oualid
I am a Cyber Security Expert, I have worked with many companies around the globe to secure their applications and their networks. I am certified OSCP and OSCE which are the most recognized and hard technical certifications in the industry of cybersecurity. I am also a Certifed Ethical hacker (CEH). I hope you enjoy my articles :).
In the intricate landscape of cybersecurity, understanding the concept of malware artifacts is paramount for safeguarding digital environments. All malwares has their own digitale signature that is represented by their [...]