Overview of consensus algorithms (Part 1)

Tram Ho

We all know that the heart of blockchain is the consensus algorithm. Consensus algorithms are simply mechanisms used in distributed computer systems to reach agreement on a data value or a unique state of network between machines in the system. But there are tons of great consensus ideas to try and learn about these algorithms. This article will briefly introduce those consensus.

1.Proof of Work

Advantages

  • Has been running since 2009 and still works fine up to now

Defect

  • Slow
  • It takes a lot of energy

Used

  • Bitcoin, Ethereum, Litecoin, Dogecoin etc.

Type: Competitive consensus.

Explain

This is the first consensus algorithm introduced into a blockchain by Satoshi Nakamoto to create a decentralized consensus algorithm to solve the double-spend problem. PoW is not a new idea but Satoshi combines it with new concepts such as cryptographic signatures, merkle chains, and P2P networks into a distributed system with Bitcoin application.

The way it works is that blockchain participants (called miners) must solve complex math problems to be able to add a block to the blockchain. The purpose of this is that users must use their resources (electricity, hardware investments) to be able to validate data on the blockchain, also known as mine blocks. That’s why trying to cheat will lead to resources used so that mines will be wasted thus harming yourself.

Moreover, the difficulty of the problem for miners also changes over time to ensure the time to create a block is always about 10 minutes. Sometimes there will be more than one miner mine producing blocks. In that case, one of the longest chains will be chosen as the main series. In short, the winning miner is the one who solves the problem the fastest and maintains the longest so that is the most reliable. So Bitcoin is safe as long as there are more than 50% honest miners in the network.

Document: Proof of work

2. Proof of Stake

Advantages

  • Energy saving
  • It costs more to attack

Defect

  • nothing-at-stake problem

Used

  • Ethereum 2.0, Peercoin, Nxt.

Type: Competitive consensus.

Explain

Proof of Stake was created as a solution to Proof of Work’s problems like saving more energy. Here instead of racing in the race using powerful hardware to calculate and close the block, here the probability of being closed based on the number of shares that person holds. For example, if you hold 10% of the coin, then the probability of getting the next mine block is 10%.

For Bitcoin mining requires a lot of computational power to run various encryption algorithms. At the same time, there are many miners running that calculation program so it needs a huge amount of electricity for a block to be generated. A 2015 statistics show that a Bitcoin transaction needs the amount of electricity needed to power 1.57 households every day. Therefore, the electricity problem is a big problem for PoW that PoS can solve.

In terms of safety, if you try to attack, you will lose the money you stake. Here losing money means that the value of this blockchain’s token will be devalued because people do not believe in it anymore, which means that the value you stake is also zero. Unlike POW, you only need electricity and electricity. then you still have. Another problem is that nothing at stake is a security hole that occurs when a fork occurs on the chain. Because mining does not cost as much as PoW, the strategy will be to mining at both branches when the fork occurs and spend on one branch then mining the other branch with such a double spend happens. There are many ways to solve this problem that are mentioned in the reading section. For example, one of the solutions is to punish miners for committing such fraud.

Document: Proof of stake

3. Delegated Proof-of-Stake

Advantages

  • Energy saving
  • Fast

Defect

  • Concentrate.
  • Many stakeholders can vote on their own to become a validator.

Used

  • BitShares, Steemit, EOS, Lisk, Ark

Type: Collaborative consensus.

Explain

In the stake holders DPOs will elect ng certification (Witnesses) to replace them mining block. This process will be slightly faster than PoS. For example, in EOS, the system will consist of 21 people who will be chosen to be witnesses and will always keep that number so if one person tries to cheat or has a problem, it will be set up for someone else to replace immediately. . These witnesses will also be paid a fee (depending on the stake holders decided) in creating the block.

Usually witnesses will create one block at a time and follow a round robin strategy. If one witnesses cannot create a block during their turn, the stake holders will vote for another witnesses to work more effectively.

DPoS, miners do not have to compete like PoW or PoS, so the speed will be much faster. For example, EOS only takes 0.5s for a block!

Document: Delegated Proof of Stake

4. Proof-of-Authority

Advantages

  • Energy saving
  • Fast

Defect

  • Do not disperse. Can be used in public blockchain but often used in private and permissioned blockchains.

Used

  • POA.Network, Ethereum Kovan testnet, VeChain

Type: Collaborative consensus.

Explain

In networks using transactional PoAs, the block will be authenticated by approved accounts called validators . Validators run software that helps them push block cell transactions, the process is completely automated.

There will be 3 main conditions to become a validator:

  • The identity must be verified on-chain, with the ability to cross-check that information on publicly available domain.
  • Conditions to become validators must be difficult to achieve. (for example, if the node wants to be a validator, it must be licensed)
  • There must be complete agreement in checking and establishing a authority

With validators it is necessary to have a motivation to keep the position they have achieved. By assigning reputation to identity, validators are encouraged to maintain the transaction process, because they don’t want to lose reputation, so losing the role of validators is hard to earn.

Proof of Authority document

5. Proof-of-Weight

Advantages

  • Energy saving
  • Customizable and highly scalable.

Defect

  • It is difficult to set up profits for system participants

Used

  • Algorand

Type: Competitive consensus.

Explain

Proof of Weight is a base consensus algorithm based on Algorand consensus algorithm. The idea is similar to that of PoS, which is also based on the number of tokens holding data in the network will be equivalent to the percentage of probability of creating a block following the calculation mechanism of the PoWeight system along with a few other values ​​used. . Other implementations are Proof of Reputation and Proof of Space.

Document: Proof of weight

6. Proof of Reputation

Advantages

  • Good for private, permissoned networks

Defect

  • Only available in private, permissoned networks

Used

  • GoChain

Type: Collaborative consensus.

Explain

Quite similar to the Proof of Authority

The idea of ​​proof of Reputation (PoR) is to rely on the credibility of the parties involved to keep the network safe. A party participating in block validation must be reputable enough so that if they deliberately cheat, their reputation will be affected. This is a relatively abstract concept because most companies involved in the system if fraud will be affected reputation but large companies will suffer more.

When a company proves its reputation and passes the verification step, it will now be selected to sign and validate the block like the Proof of Authority.

Document: Proof of Reputation

7. Proof of Elapsed Time

Advantages

  • Fairness: low cost of participation. So many people can join easily, so it’s decentralized.
  • Authenticity: It is easy to check the legally elected leader for all participants.
  • Investment calculator: The controlling cost of the leader election process is proportional to the value gained from it.

Defect

  • Not suitable for public blockchain

Used

  • HyperLedger Sawtooth

Type: Competitive consensus.

Explain

PoET is a consensus algorithm commonly used in permissioned blockchain networks to decide mining rights or winners in mining blocks. permissioned blockchain networks are networks that require any participant to register identify before they are allowed to participate. Based on the random principle in which every node is equally likely to be the winner, the PoET mechanism is based on spreading the chance of victory fairly on the largest number of nodes participating in the network.

The operation of the PoET algorithm is as follows. Each validator in the network is required to wait for a period of time randomly selected from a function called (trusted function) and the first node to complete the specified waiting time will be selected as the leader. Each node in the blockchain network generates a random timeout and goes to sleep mode during that specified period. The first one wakes up – that is, the one who has the shortest waiting time – gets up and commits a new block to the blockchain, broadcasing the necessary information to the entire network. The same process repeats to create the next block.

The PoET network consensus mechanism needs to ensure two important factors. First, that the participating nodes really have to choose a really random time. The two are the real winners who have completed waiting time.

The PoET concept was invented in early 2016 by Intel, the famous chip giant. They provide a high tech tool to solve the computing problem of “random leader election”.

This mechanism allows applications to execute trusted code in a protected environment and this ensures that both requests are randomly selected for the waiting time for all participating nodes to complete the waiting time correctly. of the participant.

The mechanism of executing trusted code in a secure environment also ensures the other essential needs of the network. It ensures that trusted code actually runs in a secure environment and is not altered by any external participants. It also ensures that the results are verifiable by participants and external entities, thus enhancing the transparency of network consensus.

PoET controls the cost of this consensus process and maintains a fast pace so that costs remain proportional to the value obtained from the process, a key requirement for cryptocurrency economy to continue to grow.

Document: Proof of Elapsed Time

Reference

ConsensusPedia: An Encyclopedia of 30+ Consensus Algorithms

Share the news now

Source : Viblo