Consensus mechanisms in Blockchains for the layperson

Brot KnoblauchHaus
The Dark Side
Published in
9 min readJan 4, 2021

--

Consensus, in the context of a distributed computing network, is a mechanism by which multiple physically separated participants can reach an agreement over something (e.g. to agree if a transaction is valid and which block to place the transaction in). Several Blockchains employ a variety of mechanisms to achieve consensus, and this article tries to break them down in as simple a language as possible.

Before we start, it is important to understand that there are basically two types of consensus mechanisms.

  1. Probabilistic (Which assumes that if enough nodes agree, it is POSSIBLE that a transaction could be reverted, but not PROBABLE). An example of this is Bitcoin
  2. Finalistic (Which CONFIRMS that the transaction is final and will NEVER be reverted). An example of this is Algorand.
    To visualize the different consensus mechanisms, let’s consider a simple transaction. Let’s assume the transaction is the statement “The sky is blue.” Let’s consider the Blockchain as a Book of truths, each page representing a block. The aim is for us to get “The sky is blue” written into the book of truths.

Proof of Work (PoW)

Bitcoin, Ethereum (For now), and several other mineable Blockchains prefer to use a mechanism called PoW to reach consensus. Let’s visualize how “The sky is blue” gets written into a PoW Book of truths.

Imagine that the Book of Truth is placed in the town square. People come from far and wide with their truths written on pieces of paper hoping to get them written into the book. Some officials surround the book and offer to write new truths into it. Anyone can volunteer to be such an official (Permissionless chain), but there’s a catch:

For each truth that is presented to them, the officials have to solve a complex mathematical puzzle before they can examine the pieces of paper with the truths. The official who solved the puzzle the fastest earns the right to examine the next piece of paper and also receives a gold coin as a reward (Mining reward).

So one day, you head off to the town square with “The sky is blue” written on a piece of paper. You reach the square to see 10 officials standing around the book. You raise your hand to indicate that you have a potential entry to the book. The officials immediately start solving a puzzle. One of them is successful and asks you to show him the piece of paper. He looks at it and consults the other officials who have also solved the puzzle if the sky is indeed blue. Three officials agree with him, so he considers that it’s IMPROBABLE that the remaining 6 will disagree, and writes your truth into the next available page of the book. You pay a fee to the officials who agreed. Congratulations, “The sky is blue” is now in the book of truths forever!

Or is it?

Unknown to you, there’s a malicious official in the remaining 6. He colludes and even bribes the other 5 to agree that the sky is, in fact, not blue!

Argument ensues, and since it’s 6 against 4, the decision is overturned, and the page (Block) with your truth (Transaction) is now ripped off the Book of truths. Your truth and all the other truths on that page are now gone forever.

This is the basis of a 51% attack on a chain.

It is easier to do this in a town square with 10 officials (Say, Ethereum classic) than one with 10 thousand officials (Say, Bitcoin). The cost of a malicious act gets progressively harder, the more officials the malicious officer has to get on his side.

There are further problems with this approach. Remember the gold coin the first official got as a reward? All the officials are competing rather than collaborating in order to receive it. One day, one official has a bright idea:

Why don’t I hire an assistant to help me with the mathematical puzzle?

This is basically a miner increasing his hash rate with a more powerful mining rig.

Pretty soon, the official with the assistant is solving almost every problem faster than the rest. Now some other officials hire their own assistants. A few cannot afford assistants, so they drop out.

Now all remaining officials have 1 assistant each, and the competitive advantage is gone. So the first official hires YET ANOTHER assistant to regain his advantage. Soon enough, it becomes an arms race of assistants, with more and more officials dropping out as they cannot afford to keep hiring assistants.

Eventually, only a handful of officials remain. This is what happens with PoW chains in general. Over time, the mining power gets concentrated amongst a few and is thus; centralized.

There are further problems with the PoW model.

Imagine if the truths were written to the book in English. One official out of 10 proposes that starting from the 500th page, the truths should be written in Latin. 4 support him, 5 oppose him. Unfortunately, they cannot seem to agree on a solution.

The two camps create clones of books and carry on. The first 499 pages are exactly the same, but on the 500th page, one copy is in English while the other is in Latin.

This is a hard fork.

Over time, people may choose to flock to one group, and the other disband due to a lack of adoption. In other cases, both groups see adoption and thrive. However, instead of 10 officials reaching consensus over a single book, now you have two groups of 5 reaching a consensus for each book. The two new books have half the integrity of the original.

These are the fundamental problems of PoW which makes it an unviable candidate for mission critical applications.

Proof of Stake (PoS)/ Distributed Proof of Stake (DPoS)

Both these consensus mechanisms operate on the “Put your money where your mouth is” concept. Instead of offering the possibility for anyone to become an official, the system stipulates that you put your own funds upfront as a pledge to receive the right to write new truths to the book.

In PoS, wealthy individuals put their own funds (Or pool funds from like-minded individuals) to receive the right to be an official. The officials receive a reward for each page they write into the book.

In DPoS, elected officials have the right to write new truth and ordinary people pledge their funds to these officials and receive a reward in return for every page written by their candidate.

Being wealthy is a prerequisite for the right to write new pages, so the chances of bribery are reduced. Furthermore, many of these chains have built-in penalty systems that could take the funds away from a dishonest or corrupt official. However, one basic problem remains: The one with the most money is more likely to earn the right to right the next page; which triggers an arms race of its own. The possibilities of 51% attacks and hard forks are reduced compared to PoW, but they still remain.

Some of the chains also implement finalistic consensus into PoS/ DpoS. This is done by repeatedly asking every official about the validity of the truths until it is clear beyond doubt that it will remain undisputed. This is great for mission-critical applications, but each round of questioning slows down the decision-making process.

All things considered, PoS and DPoS are improvements over the PoW consensus mechanisms, but still suffer from many of the same issues; but to a lesser degree.

No incentive Consensus

Chains (Or rather, Ledgers) such as the XRP ledger or the Stellar ledger operate on the no incentive concept. Imagine this as the Book of Truth being maintained by a non-profit organization, staffed by volunteers. Anyone who signs up to be an official has no incentives in mind and do so only to maintain the integrity of the book.

The advantages are easy to understand. The lack of incentives means that the officials work collaboratively rather than competitively. There is no arms race, and the threat of a hard fork is greatly reduced (Anyone threatening to fork will have to find their own volunteers).

However, the same advantages that make no incentive consensus better than PoW and PoS are also potential vulnerabilities. It suffers from the same problems a real-world, non-profit entity staffed by volunteers have:

No one wants to work voluntarily forever.

While many volunteers do maintain the integrity of these networks out of good intentions, their priorities can change if they are cash-starved. Furthermore, since these chains prioritize speed over absolute finality (Much like how a capacity starved charity trying to serve a large population), disagreements can temporarily halt the chain (As has happened with Stellar)

No incentive Consensus is vastly more efficient than PoW and PoS, but are not without their share of potential problems.

Proof Of Authority (PoA)

Finally, we come to the unique consensus mechanism adopted by VeChain. Imagine if the town searched far and wide to find 101 of the best possible candidates to serve as officials who can write to the Book of Truths. All candidates are thoroughly vetted to make sure that they have only the integrity of the book in mind as their primary motivator and are appointed as the officials. The officials do put forward some of their own funds as a pledge to show how serious they are and receive rewards for every page they write (Like PoS).

However, unlike PoS, the officials are not competing against each other for every truth that is to be written to the book. Every official gets an equal opportunity to write new truths to the book and the order in which they are given this chance is decided a day in advance by a process of mathematical random selection.

When you approach the town square with the piece of paper with “The sky is blue” written on it, a pre-authorized official receives it while a page is being written to the book. As the next page starts, he confers with his fellow officials and provided probabilistic consensus is achieved, he writes it to the book.

PoA blends the best of the examples above (The incentives of PoW and PoS, the funds at stake of PoS to reduce chances of getting bribed and the co-operative rather than competitive nature of no incentive consensus models) and avoids the pitfalls (No arms race as with PoW and PoS, serious candidates instead of volunteers to ensure maximum uptime, unlike no incentive consensus). But it is not fool proof. There is still a theoretical chance of collusion and/ or forks. The pre-appointed official can choose who he confers with, in order to collude and/ or cause a fork.

Enter PoA 2.0.

PoA 2.0 is an improvement of PoA that is currently being researched by Peter Zhou and Dr. Ren of VeChain. In PoA 2.0, a variety of measures are introduced to ensure the speed and efficiency of PoA 1.0, while reducing chances of collusion, forks, and also implementing finality.

In PoA 2.0, when you approach the pre-appointed official with your piece of paper, he is randomly given a committee of other officials to confer with (The size of this committee can vary depending on how deep the deliberations need to be). The committee is given 10 seconds to deliberate and agree on the validity of your truth. Once the committee agrees that your truth is valid, they write it to a page. Then, the next official and his randomly appointed committee are in charge of the next page.

This is where things get interesting. This official and his committee are not just I charge of the current page, they also review the previous few pages to ensure that the truths in them are valid and sign their approval. Just as their predecessors did.

So, the page before the current page has two committees signing off. The one before has 3 committees signing off. After a certain number of committees have signed off on a page, it is no longer just has probabilistic consensus, it has FINALISTIC consensus. It will never be disputed again.

Furthermore, given that no official can foresee the committee he is assigned for each page of the book he is responsible for, so to collude means that he has to bribe and convince the remaining 100 officials. This is financially unviable.

PoA 1.0 has the best of all other consensus mechanisms but is still open to some of the potential threats faced by them. PoA 2.0 mitigates these AND introduces finality, while not sacrificing speed. Thus, PoA 2.0 finds itself to be one of the strongest candidates for mission-critical applications which require the best of security, efficiency, integrity, and speed.

VET/ VTHO Tip Jar: 0x22e0820aC11F093e317446458f79C11CFaf58084

--

--

Brot KnoblauchHaus
The Dark Side

Ich bin kein Berliner, ich bin Knoblauchbrot. I like utility tokens. VET/ VTHO Tip Jar: 0x22e0820aC11F093e317446458f79C11CFaf58084