Leggi questo articolo in Italiano Italiano

7 min read

What is a consensus algorithm?

By Gabriele Brambilla

The consensus algorithm is a fundamental mechanism for the proper functioning of a blockchain: let's find out what it is

What is a consensus algorithm?

Blockchain and consensus algorithm

The consensus algorithm is a basic element of each network.

The blockchain is a particular cryptographic database that is decentralized and distributed over several nodes. The name recalls the division into blocks that, joined together, create a real chain. The latter is bound to get longer because new pieces are being added all the time.

Each block contains information. Specifically, it is all the transactions that occurred on the network in a given time frame.

From what has just been said, a fundamental point can be made: every transaction must be correct and in accordance with what happened in the past. For example, it is not acceptable for a person to spend the same amount in cryptocurrency twice.

Moreover, being distributed, this special database “lives” on a variety of computers and computing devices.  Therefore, it becomes equally important that each part of the network possesses the same information. My copy will not be able to support something different than another person’s copy.

Therefore, we need a system that manages the addition of new blocks, verifying and ensuring harmony among the various distributed copies. Therefore, we welcome this mechanism: the consensus crypto algorithm.

What is a blockchain consensus algorithm?

As the name suggests, the consensus algorithm is precisely a set of instructions that aims to solve a problem.
In our case, the goal is to ensure an error-free environment (the blockchain) where all copies of the database agree on the information contained. Conflicts and discordant data are not tolerable and would render the chain nearly useless.

Several consensus algorithms exist. The progenitor is Proof-of-Work, proposed by Bitcoin creator Satoshi Nakamoto back in 2008. The idea was to be able to coordinate the parts of an innovative decentralized network.

To add new blocks to the chain, the PoW algorithm requires proof of work accomplished in this regard. Specifically, those performing this task are required to solve a complex probabilistic calculation, taking advantage of special machines called ASICs. This was not always the case: in the past, the difficulty of the problems was lower and home computers could safely close them.

The first person who can solve the calculation can produce the lock. As a reward, a certain amount of freshly created cryptocurrency is received. From here, the process is called mining, because you actually “mine” new coin specimens.

Of course, the data from the block is distributed to other participants, who are charged with making the appropriate comparisons.

By investing so much power, a miner has no interest in trying to manipulate transactions: unless he can have 51 percent of the computational power of the entire blockchain, his misdeed would not be approved by the network. We are talking about a huge number that is virtually impossible to reach, an aspect that puts Proof-of-Work realities on the safe side.

Other consensus algorithms instead involve blocking a certain amount of cryptocurrency. Or again, it is one’s reputation that is at stake.
The “putting at stake” is the central element of a consensus algorithm: regardless of the type, something is “bet” (stake). The stakeholder must then behave well, or else there will be a loss, whether economic, reputational, combined or otherwise.

So, to recap: the consensus algorithm provides a set of instructions to ensure that the blocks in a chain are all correct.
Those who actively contribute to the addition and creation of new blocks put themselves on the line and cannot make any missteps. The ultimate goal is to win as much work as possible and obtain the expected rewards.

What is an example of a consensus algorithm? We’ll provide some examples shortly.

Byzantine generals and blockchain: namely?

Let’s deviate from our usual talk and engage in some logic. Specifically, let’s talk about the dilemma of Byzantine generals.

First, let us imagine a battlefield. Let us assume that there are a number of generals on the same side. They must decide whether to attack the enemy or retreat. Each can reason about how to move. After that, the idea will not be changed.

To be successful, everyone should agree on the action to be taken, initiating it at the exact same time.

At this point, communication problems take over. In fact, the generals can interact with each other only through messengers. These may be killed, wounded, or captured. Or, there may simply be a delay in delivery.

In addition, one or more generals could double-cross and spread false information, confusing others.

In short, there are critical issues that seriously jeopardize success.

This dilemma is applied to so many areas, including blockchain. Since it is a decentralized environment, there could be malicious generals (nodes) trying to manipulate data and spread false information.

In this context, if the bad nodes manage to control 51 percent of the network, the blockchain is compromised.

These observations give rise to the definition of Byzantine Fault Tolerance, or the resilience of a chain in the presence of malicious nodes.

While there are a variety of consensus algorithms, they all aim to ensure that the network functions properly even under these conditions.

Main consensus algorithms

Let us quickly explore some of the most popular blockchain consensus algorithms. We refer to the dedicated insights to learn more.

What is the most popular consensus algorithm? Proof of Work

The consensus algorithm by definition, devised by Satoshi Nakamoto in 2008. It is based on solving very complex calculations that require purpose-built computers. The creation of new coins is called mining.

Blockchains: Bitcoin, Litecoin, Dogecoin.

Pros: security and reliability.

Cons: inefficient and penalizing in terms of scalability.

Proof-of-Stake

A widespread modern solution, Proof-of-Stake requires a certain amount of blocked coins to be a chain validator. After that, proportional to how much you deposit, you have a certain probability of validating a blockchain.

Blockchain: Ethereum, Solana and Avalanche.

Pros: scalability, efficiency and adaptability.

Cons: less safe than PoW, need for a coin to enable operation.

Delegated Proof-of-Stake.

A declination of PoS, this blockchain algorithm introduces some caveats that improve its efficiency and community participation. There is a voting mechanism that elects the producers of each block.

Blockchain: EOS, Cardano.

Pros: more efficient and democratic than Proof-of-Stake.

Cons: identical to classic PoS, with the addition that a 51% attack might be easier to organize.

Proof-of-Authority

This consensus algorithm leverages the reputation of validators. No sum in stake is involved: it is the identity of the insiders that is at stake.

Blockchain: POA (merged into Gnosis Chain).

Pros: energy efficiency, good security standards, speed.

Cons: centralization, not ideal for public blockchain.

"Different algorithms for different needs: each project adopts the solution best suited to its characteristics."

Final thoughts on the consensus algorithm

In this in-depth study, we got a better understanding of what a consensus algorithm is.

Although they are very different from each other, all members of this category have the same goal: to ensure the fairness of transactions.

In the crypto community, some users prefer the good old Proof-of-Work, despite some limitations.

Others prefer Proof-of-Stake-based projects, confident that it is the future of the entire industry.

Finally, several investors turn their attention to chains that adopt other solutions, perhaps taking a little more risk.

Whatever one’s point of view, when analyzing a network we must always consider the consensus algorithm as well. Only then can we invest in full knowledge.

See you soon!


X

Vuoi essere sempre sul pezzo?

Iscriviti alla newsletter per ricevere approfondimenti esclusivi e analisi ogni settimana.

Se ti iscrivi c’è un regalo per te!

Black Friday!

Sconto del 30% su workshop avanzati e formazioni 1-1 + una FOMOcuffia in regalo! Non perdere l’occasione! 🚀

Approfitta degli sconti
*valido dal 25/11 al 8/12
X
bitcoin
Bitcoin (BTC) $ 95,962.71
ethereum
Ethereum (ETH) $ 3,667.88
xrp
XRP (XRP) $ 2.55
tether
Tether (USDT) $ 1.00
solana
Solana (SOL) $ 238.18
bnb
BNB (BNB) $ 750.15
dogecoin
Dogecoin (DOGE) $ 0.414662
cardano
Cardano (ADA) $ 1.21
usd-coin
USDC (USDC) $ 1.00
staked-ether
Lido Staked Ether (STETH) $ 3,670.40
tron
TRON (TRX) $ 0.375708
avalanche-2
Avalanche (AVAX) $ 52.05
shiba-inu
Shiba Inu (SHIB) $ 0.000030
the-open-network
Toncoin (TON) $ 6.86
wrapped-steth
Wrapped stETH (WSTETH) $ 4,338.56
stellar
Stellar (XLM) $ 0.509643
polkadot
Polkadot (DOT) $ 9.86
chainlink
Chainlink (LINK) $ 23.91
wrapped-bitcoin
Wrapped Bitcoin (WBTC) $ 95,847.68
hedera-hashgraph
Hedera (HBAR) $ 0.327951
bitcoin-cash
Bitcoin Cash (BCH) $ 569.33
sui
Sui (SUI) $ 3.63
weth
WETH (WETH) $ 3,667.56
litecoin
Litecoin (LTC) $ 129.82
uniswap
Uniswap (UNI) $ 14.95
near
NEAR Protocol (NEAR) $ 7.27
leo-token
LEO Token (LEO) $ 9.42
pepe
Pepe (PEPE) $ 0.000021
aptos
Aptos (APT) $ 14.25
wrapped-eeth
Wrapped eETH (WEETH) $ 3,864.30
internet-computer
Internet Computer (ICP) $ 14.40
polygon-ecosystem-token
POL (ex-MATIC) (POL) $ 0.715727
vechain
VeChain (VET) $ 0.071918
usds
USDS (USDS) $ 1.00
crypto-com-chain
Cronos (CRO) $ 0.198232
ethereum-classic
Ethereum Classic (ETC) $ 35.70
fetch-ai
Artificial Superintelligence Alliance (FET) $ 1.92
ethena-usde
Ethena USDe (USDE) $ 1.00
bittensor
Bittensor (TAO) $ 627.10
filecoin
Filecoin (FIL) $ 7.59
render-token
Render (RENDER) $ 8.81
arbitrum
Arbitrum (ARB) $ 1.08
algorand
Algorand (ALGO) $ 0.528093
kaspa
Kaspa (KAS) $ 0.162824
hyperliquid
Hyperliquid (HYPE) $ 11.70
blockstack
Stacks (STX) $ 2.59
cosmos
Cosmos Hub (ATOM) $ 9.58
okb
OKB (OKB) $ 61.43
aave
Aave (AAVE) $ 241.95
mantra-dao
MANTRA (OM) $ 3.86