Table of contents
Lesson 5
What are consensus mechanisms?
What are consensus mechanisms?

10 min reading time

Updated

What are consensus mechanisms?

A consensus mechanism is a system used by cryptocurrencies to reach agreement (consensus) about the data and status of the network. A consensus mechanism is needed in a decentralized system, since in such a system no single person or institute is accountable. In this way, a consensus mechanism ensures the security and accuracy of the blockchain. A consensus mechanism guarantees that all validated transactions are recorded on the blockchain, and that each copy of the blockchain contains all validated transactions.

The word consensus means agreement. In the context of the blockchain, reaching consensus means that at least 51% of the nodes on the network have to agree on the network’s next status.

Why is a consensus mechanism necessary?

In every centralized system, such as a bank or a country’s database with important information about identity, a central manager has the authority to maintain and update the database. The responsibility to update the database by adding, removing or updating information is performed by a single, central authority, that is also the sole accountable authority. This is the definition of a central system.

Public blockchains however work as a decentralized, self-regulating system. A blockchain is available worldwide to everyone and works without any authority. The system is based on the contributions of an enormous number of people who are working on the verification and authentication of the executed transactions that take place on the blockchain. In other words, no single person is responsible for updating and securing the blockchain, but rather this responsibility lies with everyone connected to the network.

A blockchain’s publicly shared ledgers need a secure, efficient, functional and reliable mechanism to ensure that all transactions taking place on the network are genuine. The consensus mechanism is responsible for this important task. The consensus mechanism uses a series of rules to determine the legitimacy of the contributions made to the network by the various blockchain participants.

Blockchain consensus mechanisms

There are various consensus mechanisms, each with its own pros and cons. This is because not every blockchain uses the same type of consensus mechanism. A blockchain can serve a range of purposes and applications, which can make it desirable to apply a different type of consensus mechanism. Organizations and developers wanting to design a blockchain must therefore carefully consider which type of consensus mechanism best suits their objectives and application.

The type of consensus mechanism matters not just to organizations and blockchain developers, but also to users. Before investing in a certain cryptocurrency, it’s important to know which type of consensus mechanism is used, and how it works.

Proof of Work

With the Proof of Work consensus mechanism, miners compete with each other to validate the next transaction block. If the miner is the first to validate the next transaction block, the miner will be rewarded. The Proof of Work consensus mechanism is a very energy-intensive mechanism, but is also very reliable. The Proof of Work consensus mechanism is a commonly used mechanism, used inter alia by popular cryptocurrencies like Bitcoin. The downside of the Proof of Work consensus mechanism is that it is slow, which is why Ethereum is hoping to switch to the faster Proof of Stake consensus mechanism.

Proof of Stake

The Proof of Stake consensus mechanism was created as an alternative to Proof of Work, with lower costs and requiring less energy. The Proof of Stake consensus mechanism is a new mechanism whereby those with the largest stake in the network’s currency are allowed to validate new blocks. The mechanism is based on an arbitrary process that determines who is given the right to validate and produce the next block.

Users can lock their tokens (coins) for a certain time in order to qualify as a validator. This process is called staking. Generally, the user with the most coins or who has held his coins for the longest period of time will have a greater chance of validating and creating new blocks.

The Proof of Stake mechanism therefore rewards those with the largest stake in the network for their ongoing participation in the validation of transactions. The downside is that this consensus mechanism encourages the hoarding (holding) of certain cryptocurrencies, thus affecting issuance of certain cryptocurrencies. In order to mitigate this disadvantage, a new system is considered whereby not just those with the largest stake are able to validate, but consideration is also given to how long this owner is holding the coins, as well as a number of other factors. This to prevent centralization of the network.

Proof of Authority

The Proof of Authority consensus mechanism is less common. The mechanism, however, has a unique form. The mechanism is an adapted version of the Proof of Stake mechanism whereby the validators’ identity on the network is at stake. The identity is the correspondence between the validators’ personal identification and their official documentation used to verify their identity. This mechanism operates based on reputation and authority, rather than on public consensus as used by other mechanisms. Validators whose identity is at stake are motivated to make and keep the blockchain network secure. The number of validators is usually quite small (25 or fewer).

The mechanism is primarily used by private companies or by organizations that use blocks made by screened and approved sources with special permission to use the network.

Delegated Proof of Stake

The delegated Proof of Stake consensus mechanism is a variation of the Proof of Stake mechanism whereby users using their crypto coins are able to vote on the number of validators allowed to create new blocks. The weight of a certain user’s vote is linked to his wager. Those with the most coins consequently hold the most votes. The validator who receives the most votes is given the right to validate and create new blocks.

The Delegated Proof of Stake consensus mechanism is one of the fastest blockchain consensus mechanisms. The mechanism is able to handle larger numbers of transactions simultaneously when compared with the Proof of Work consensus mechanism. Because the system is based on a weighted voting system, the Delegated Proof of Stake mechanism is often regarded as a digital democracy.

Nominated Proof of Stake 

The nominated Proof of Stake consensus mechanism is another variation to the Proof of Stake mechanism. With this mechanism, the nominators support the chosen validator with their own stake as a token of trust in the validator’s good behavior. Nominated Proof of Stake differs from delegated Proof of Stake in that nominators lose their stake if they choose a bad validator. The nominated Proof of Stake consensus mechanism is used inter alia by Polkadot.

Proof of Capacity

The Proof of Capacity consensus mechanism depends on the available storage space on a computer’s hard drive. The available storage space is needed for the centralized process of block verification and generation. The more storage space is available, the more rights a certain miner will acquire to validate transactions and record them in a new block.

Proof of Activity

The Proof of Activity consensus mechanism is a combination of the Proof of Stake mechanism and the Proof of Work mechanism. With this consensus mechanism, a miner tries to use the best of both mechanisms. A random group of validators is selected to validate and create the next block. Validators with larger stakes have a better chance of being selected.

Proof of Elapsed Time

The Proof of Elapsed Time consensus mechanism uses a random timer that works independently on each network node in order to randomly allocate the verification of a block to a miner.

Proof of Burn

The Proof of Burn consensus mechanism is based on the action whereby miners periodically burn coins. Burning coins means that these coins are permanently removed or eliminated, and taken out of circulation. The mechanism validates new transactions and is meant to prevent inflation. Burning coins happens by sending them to inaccessible wallets that cannot be touched by anyone.

Proof of Identity

The Proof of Identity consensus mechanism compares a user’s private key with an authorized identity. The consensus mechanism is a piece of cryptographic evidence for a user’s private key, which is cryptographically linked to a specific transaction. Each identified user of a certain blockchain network can create a data block that can be presented to anyone in the network. The Proof of Identity consensus mechanism ensures the integrity and authenticity of the created data.

What is a 51% attack?

In the crypto world, a consensus mechanism also helps prevent certain types of economic attacks (hacks). In theory, a hacker can jeopardize the consensus if he controls 51% of the network. In this way, a hacker can disrupt the process of recording new blocks in the blockchain. He can stop other miners from completing new blocks, as a result of which the hacker in theory can monopolize the creation of new blocks and collect all rewards himself. Moreover, the hacker can revert executed transactions and thus double issue coins.

Consensus mechanisms are designed in a way to ensure that such 51% attacks are practically impossible. With the Proof of Work consensus mechanism, a hacker would need to control 51% of the network’s calculation power in order to circumvent the consensus mechanism and carry out fraudulent transactions. With the Proof of Stake mechanism, a hacker would need to hold 51% of the total amount of coins in order to manipulate the blockchain.

Sybil resistance and chain selection 

The Proof of Work and Proof of Stake consensus mechanisms are not in fact genuine consensus mechanisms. Nevertheless, they are often referred to as such. To really get into detail: technically speaking they are Sybil resistance mechanisms and block author selectors. In order words, they represent a way to decide who can be the author of the latest new block. A real consensus mechanism comprises a combination of this Sybil resistance mechanism and a chain selection rule.

Sybil resistance mechanism

Sybil resistance evaluations how a protocol performs against a Sybil attack. A Sybil attack occurs when a user (or a group of users) presents itself as many users by creating a large number of pseudonyms and uses these to exert a disproportionate amount of influence on the network. A Sybil attack may be used, for example, to carry out a 51% attack.

Resistance against these types of attack is crucial in a decentralized network, and enables miners and validators to be rewarded equally on the basis of the resources deployed. Proof of Work and Proof of Stake consensus mechanisms protect against this by allowing users to use a lot of energy (Proof of Work) or to place a large deposit (Proof of Stake). These safety measures serve as economic deterrents against Sybil attacks.

Chain selection rule

A chain selection rule is used to decide which chain is the “right” chain. This can be done in various ways. Bitcoin currently uses the role of the longest chain. This means that the longest blockchain is the right one. This blockchain is accepted as valid by the other notes, and it will continue with this blockchain. For blockchains with the Proof of Work consensus mechanism, the longest chain is determined by the total cumulative Proof of Work complexity of the chain.

The combination of the Proof of Work consensus mechanism and the longest chain rule is referred to as the Nakamoto Consensus.

Summary

A consensus mechanism is a protocol, algorithm or other computer system that uses cryptocurrencies to reach agreement (consensus) about the network’s data and status. They are mechanisms of agreement that determine the validity of transactions and the management of a blockchain. A consensus mechanism guarantees integrity and security of decentralized networks such as a blockchain.

There are various types of consensus mechanisms, each with their pros and cons. The Proof of Work and Proof of Stake consensus mechanism are the most commonly used blockchain consensus mechanisms. The Bitcoin blockchain uses the Proof of Work consensus mechanism. The Proof of Work consensus mechanism, however, is very energy-intensive, which has spurred the creation of newer and more efficient mechanisms. Still, thought is also increasingly given to how clean energy can be supplied to Proof of Work blockchains. For example, El Salvador is working to generate energy from the heat of volcanoes, with that energy subsequently used to mine Bitcoin.

A consensus mechanism moreover helps to prevent certain kinds of economic attacks. A consensus mechanism is based on the majority of something, so when a hacker controls the majority of the network, he could theoretically manipulate the network. This is called a 51% attack. However, consensus mechanisms are designed in such a way that these 51% attacks are practically impossible due to the large energetic or monetary input required to obtain 51% of the network. The greater the market cap, and the more money circulates in the blockchain, the less likely a 51% attack becomes.