Avalanche Consensus: Clearing the Cloud of Misconceptions about Blockchain Consensus

in HODL4 years ago


This week has been great as usual for Avalanche. It has been filled with memorable events. I advise that you check Weavax to keep yourself updated. Straight to the point- October 14th Emin Gun Sirer CEO at Avalabs made a tweet revelation and cleared the clouds over a particular misconception about blockchain consensus. Check below:

Personally, after reading the thread, I was confused and felt I didn't know anything after reading a long list of crypto white papers for three years. I began rereading, unlearning, and relearning how many consensuses there is. I love breaking things down so people will learn, it means I have to hold a certain level of understanding before I can do so. I agree that I might still be a zygote in what Blockchain and Cryptocurrency are all about but I try my best to read and understand things. 

These are my take:

  1. From the surface look at what consensus means, it is all about a group of people coming to agree over a matter. Agreeing in this sense means there are Disagreements and some certain part of an organization is in a dispute over a matter. You do not need consensus when dealing with obedience to the law that has been laid. In this case, you simply obey and follow it. Laws are measures that everyone must follow to keep the sanity, that doesn't need consensus. 
  2. Proof of Work is laid out rules on how blocks are formed and rewards to any node or miner that finds a block. It is a Sybil prevention mechanism. Anti Sybil mechanisms are put in place to subvert and put an end to nodes that appear with fake or multiple identities (Even the article linked above erroneously called PoS, and PoW a Consensus, but you got my point about Anti Sybil Mechanisms right? Let's go). Sybil attacks are meant to take over the network when unfaithful nodes try to cause a 51% attack by creating fake identities. For example, a node that appears to be 500 nodes. Proof of Stake (PoS) and other versions of PoS are anti-Sybil Mechanisms. But as Emin Stated,  PoW, and PoS cannot reach a consensus on their own. They have to be added to algorithms like PBFT, Nakamoto, etc. to reach consensus. 

Take for example Pizza isn't complete with flour alone. You'd have to add other things. 

  1. Consensus comes into play when there are conflicting transactions like double spending and reorganization. Reorganization for example a scenario when a node or group of nodes goes offline for a while, after they come online, they begin to submit transactions or data that are out of sync with the rest of the nodes which have been online. An example is the reorganization attack on Ethereum Classic. In this case, nodes need to decide on their own, through communications with other nodes, which of the conflicting transactions are genuine.

As I began to consider these things in my mind and reading materials online, I concluded. There are, of a truth, three major consensuses: Classical, Nakamoto, and Avalanche.

Classical Consensus

The classical consensus is built on the fact that every node in a network needs to hear from every other node before an agreement or decision is made. According to research and findings, it is scalable but its major weakness is that it doesn't work well or scale when participating nodes are greater than 100. Plus, it can withstand attack if unfaithful nodes are below 33% of the network. 

Illustration 1

Don't mind me, I am an Agricultural Engineer

Grain silos are used to store grains. But it is all about garbage in garbage out. It means you don't expect to get good quality grains when you store bad quality ones. Grains have to be of certain characteristics and composition if it will store for long. One big determinant is moisture content and the presence of insect pests. The sad news is that if there are too much moisture and insect population in the grain to be stored, it will not only affect the grain but other grains to be stored together in the silo. This is why quality checks are done before consignments are received. 

Take for example you wish to store 100 maize grain in a silo. It is easy to check each grain for quality, moisture,  and insect pests before they are accepted for storage. The process will be, considerably, fast. A larger consignment, say a bag of maize, needs another approach and assumption to ascertain quality. 

Nakamoto Consensus

Nakamoto consensus alow networks to achieve robustness by applying a probabilistic approach. The trade-off is a small value of error which becomes smaller and smaller when the sample size becomes larger. It assumes that 51% of the network must be faithful. But the weakness is that it is very slow and its Proof of Work consumes a lot of energy. 

Illustration 2

If you decide to check a bag of maize and ascertain that it is ok for storing, you can't check individual maize grain- that will be unreasonable and time-consuming considering that there are many other maize bags to check per day. You'd have to assume that all the maize grain in the back come from the same farm, and were subjected to the same treatment or condition such as drying. With these assumptions, you can pick random samples from different parts of the bag and test. The gist is that the result you get from the sample will help to make generalizations and conclusions about whether to accept the bag or not. Research has shown that the larger the number of samples you selected, the greater your confidence interval, and the smaller the probability that you will run into an error in your conclusion. 

In case of reorganization for example, due to some nodes going offline and submitting ‘out-of-sync’ transactions, faithful nodes consider the longest chain or history of transactions to mark as genuine. This is reasonable because much ‘work’ capital or power has been invested to create the longest chain- it cannot be wrong. A successful reorganization will occur if attacking nodes can create a false chain of transactions from the Genesis block to the present. You see that the probability of the network running into an error becomes smaller and smaller as the transaction blocks and chains become longer and longer.

Avalanche consesus vs nakamoto vs classical
Source

Avalanche Consensus 

Avalanche consensus is a family of consensus that combines the best of characteristics of Classical and Nakamoto consensus and eliminates their weaknesses. 

In Avalanche consensus, nodes use random subsampling to build confidence and determine the faithful nodes and virtuous transactions. 

Illustration 3

Building on the foundation already laid. You will get a better result to represent the quality of a maize bag if you choose multiple sample groups, analyze them independently, and check if the overall result satisfies the quality control standard. 

Avalanche’s consensus is somewhat close to the illustration above but quite different. Nodes only need to agree or reach consensus if there are conflicting transactions (double spending) or reorganization threats. If there is no challenge, nodes only listen for a new transaction,s and no work is done. 

How avalanche consensus works
Source

When a node receives a list of conflicting transactions to decide on. It takes the ones without challenges and approves them first before dealing with conflicting ones. Each node randomly selects a list of nodes (say k in number), it checks for their preferred decision on a particular conflicting transaction. If the percentage of nodes that decided ‘ACCEPT’ for example is greater than 51% of the sample size k, it decides ‘ACCEPT’ as its decision for that round of sampling. It conducts r sampling rounds. For each sampling round, it only changes the state of its decision when the number of ACCEPTs on the previous sampling rounds is lower than the number of REJECTs. Thus each round of sampling builds the confidence of a node on which decision to make. At the end of the day, the final decision of a node is dependent on the highest number of decisions and conclusions for each sampling round. 

Note: Selected nodes are not considered for new random sampling and each node makes its sampling independently. 

From research conclusions, this method is way efficient and the consensus is reached easily and faster. The error probability in this process is even smaller than that of the Nakamoto (Bitcoin) Consensus. This is a brief and hopefully simple explanation of Snowball. Avalanche consensus uses a modified version of Snowball. 

Avalanche platform is just like a kitchen where you can conjure different varieties of Pizza. The platform can be used to create subnets where nodes can come together to reach consensus and create blockchains. Each subnet can combine any form of consensus with any Anti-Sybil Mechanism.

I'd advise that you read two articles here and here, and the Avalanche Consensus Whitepaper here after reading this article to have a complete understanding. There are still a whole lot of things I left out in this article.

Avalanche Links

Website | Whitepapers | Twitter | Discord | GitHub | Documentation | Explorer | Telegram | Facebook | LinkedIn | Reddit | YouTube



Posted from my blog with SteemPress : https://cryptostocksreviews.org/avalanche-consensus-clearing-the-cloud-of-misconceptions-about-blockchain-consensus/news/
Sort:  

Nice explanation...