Consensus: The Law of the Blockchain World

2020-06-12 16:38:07

During our first article Introduction: The What, Why, and How of Blockchain, we introduced the technical structure of a blockchain system, and the consensus mechanism is packaged in the consensus layer. If the blockchain is regarded as a big ledger involving the participation of us all, and if everyone were to adopt different bookkeeping standards, then the ledger would be extremely strange and full of mistakes. Therefore, a blockchain system needs a mechanism recognized by all participants to restrict user behaviors, and such a mechanism is called the “consensus mechanism”, which is the core component of blockchain technology.

 

Today, PoW and PoS are the most common consensus mechanisms. Apart from these two, other mainstream consensuses also include PoS variants such as DPoS, NPoS, HPoS, and PPoS, as well as highly-anticipated new mechanisms like PoC that are yet to prove themselves.

 

What is PoW?

 

As its name implies, PoW (Proof of Work) is the proof of the workload, and the essential principle of PoW is that whoever works more gets more.

 

PoW describes a system that requires participants to solve a difficult but easily verifiable problem to win the right to update blocks and reach a consensus.

 

For example, in the case of Bitcoin, SHA256 hashing is performed on the new string obtained via enumeration, and the goal is to identify the hash with the specified number of leading zeros. The more leading zeros there are, the more difficult the problem is. Once a node spots a random number that meets the requirements, it will be able to update the current block and win certain rewards.

 

This is the academic definition of how BTC’s PoW is implemented. Now, let’s try to explain it in layman’s terms.

 

Suppose there is a school where the students are asked to check class attendance by themselves because teachers are too busy, and the student who keeps the attendance record for a day is rewarded with more credits. Attracted by the credit incentive, all students would like to keep the record. As the school does not want all the students to keep the record, it decides to release a very difficult math problem every day, and only the student who has solved it first could keep the attendance record that day. In addition, the student who has won the record-keeping right could receive the credit reward as long as he properly keeps the record that day.

 

This model under which the system (school) releases problems and users (students) solve them to update the block (attendance record) is defined as a PoW mechanism. The harder a participant tries to solve the problem, the more updating rights and rewards he will get.

 

PoW is simple and easy to understand. Plus, with the fine coding examples of cryptos like Bitcoin, this consensus mechanism is easy to implement. However, to ensure close intervals between the time points at which the problems are solved, a blockchain system often adjusts the difficulty level according to the number of participants. In other words, the more participants there are, the more difficult the problem will be. As the problems become more difficult, people have started to adopt advanced equipment (mining rigs) and consume a large amount of electricity to solve the hash problem, which has also led to an enormous waste of resources.

 

What is PoS?

 

The rationale of PoS (Proof of Stake) is similar to the shareholding system in the real world. The more shares one holds, the greater a say he will have, and he will also be more likely to win the block updating right.

 

PoS is more intuitive than PoW. Let’s continue with our attendance example.

 

After running the previous system for a while, many credits have been rewarded to students. At this point, the teachers feels it too troublesome to release one question a day and then decides to determine the record-keeping right via a lottery system where the probability of winning the lottery depends on the number of credits held by the students. Suppose the school has offered 100 credits and Smith received one credit. Under this model, there is a 1% possibility that he would win the lottery. If Smith feels that 1% is too low, he could also buy more credits from his classmates in private to increase the likelihood of winning.

 

Although PoS does not require massive resources, it has created some other issues, the most prominent of which is the rich-poor gap. In a PoS model, the more cryptos a participant holds, the more likely he will update the block and win rewards. In the long run, the “rich-get-richer” mechanism will put all the resources of the entire system into the hands of a few participants, which ruins the principle of decentralization.

 

What is DPoS?

 

DPoS (Delegated Proof of Stake) is based on PoS. In DPoS, the nodes will first elect several (the specific number is determined by the system) validators, which resembles the board system adopted by modern companies, and all future proposals (blocks) will be processed by these selected nodes in turn.

 

The attendance example also applies to DPoS. After the lottery system was run for a period of time, Adam notices that he could never win the lottery because he only has a small number of credits, but he doesn’t want to buy any credit either. To get by, Adam decides to team up with a couple of other students with low credits and increase the winning probability by combining their credits. They also agree to share the credit reward equally if they win the record-keeping right.

 

When the school finds out about their coalition, it sets up a student council, and its members will keep the attendance record in turn. Moreover, all students will vote their credits to elect the members of the council. Though the member of the council who keeps the record could do whatever he wants with the daily credit reward, they would often share the reward with their “voters” after deducting a small fee to maintain their votes.

 

In the real world, we can see DPoS everywhere. From government departments to private companies, having “elected representatives” accounts for both democracy and efficiency. However, copying such a model from the real world runs counter to the original goals of blockchain. As such, DPoS is most criticized for its insufficient decentralization, which is inconsistent with the blockchain spirit.

 

What is PoC?

 

If you search for PoC, you will see many different results, including Proof of Credit, Proof of Contribution, Proof of Coin, etc. Today, we will focus on Proof of Capacity, which is the most famous PoC. Note: all references to PoC in the below paragraphs mean Proof of Capacity.

 

PoC uses a disk-based mining model, and it can be regarded as another version of PoW.

 

Our attendance example is not yet over. Here, let’s continue the story from the PoW part where the school releases a difficult math problem every day and grants the record-keeping right to the student who has solved it first.

 

Brian is never good at math, but he is very lucky to find a shortcut. To win the record-keeping right, Brian prepares plenty of answers before the problem is released and would verify each of the answers when the problem is announced to find the right answer.

 

We can think of Brian’s approach as buying scratch tickets. As long as he’s got enough tickets, he could eventually win the prize. Under such a model, users will need to have sufficient hard drive capacity to store more random numbers so that they could be more likely to “guess” the right answer. As such, this model is called PoC (Proof of Capacity).

 

Although the PoC advocates believe that compared with other consensus mechanisms, PoC is accessible to all, reduces the waste of resources, and resists ASIC and monopoly, it essentially relies on the accumulation of resources (PoW depends on hashrates, while PoC relies on hard drive capacity) to solve problems with “brute force”. Naturally, things look pretty when the number of participants stays low, but no one knows whether PoC would repeat the example of PoW when it reaches a certain scale.

 

Related Articles