Back to Blog

What are Concensus Protocols?

A brief introduction to Concensus Protocols

Posted by

consensus

A consensus protocol is the mechanism by which participants in a decentralized network agree on the validity of transactions and maintain a single, unified blockchain ledger without relying on a central authority. Since cryptocurrencies operate in a trustless environment (an evironment that does not require trust in the parties involved), they need a robust method to ensure that all nodes (computers in the network) agree on the state of the blockchain.

Different consensus mechanisms have been developed to optimize security, scalability, and decentralization. Below are some of the most widely used ones in cryptocurrencies.

Proof of Work (PoW)

The concept of Proof of Work was proposed by Hal Finney in a paper called "Reusable Proofs of Work".

Proof of work is a blockchain architecture in which a computer (the so called a miner), works to solve a cryptographic problem. Miners compete with each other and the first to solve the cryptographic puzzle gets the reward, tipically a unit of cryptocurrency, after the solution is valitated by the network. The more often a miner solves the puzzles, the more rewards it receives.

After the work (mining) is concluded a large network of computers are needed to verify it. As a consequence the PoW consensus mechanism requires high energy consumption and long processing times.

Proof of Stake (PoS)

Proof of stake (POS) was created as an alternative to proof of work to reduce the computational work needed to verify blocks and transactions.

While PoW mechanisms require miners to solve cryptographic puzzles, PoS mechanisms require validators to hold and stake tokens for to get a chance to validate transactions, earn newly minted crypto and transaction fees. The main idea is that validators have put something of value into the network that can be destroyed if they act dishonestly.

In Ethereum's PoS, validators explicitly stake capital in the form of ETH into a smart contract on the platform. The validator is then responsible for checking that new blocks propagated over the network are valid and occasionally creating and propagating new blocks themselves.

To participate as a validator, a user must deposit 32 ETH into the deposit contract and run three separate pieces of software: an execution client, a consensus client, and a validator client (see "Ethereum Proof-of-stake").

Blocks are validated by multiple validators, and when a specific number of validators confirm that the block is accurate, it is finalized and closed. A transaction has "finality" when it is part of a block that can't change without a large amount of ETH getting burned.

Proof of History (PoH)

Pionered by Solana, the concept behind PoH is that the order of events is just as important as the events themselves as the ability to prove their chronologic order is essential for maintaining the integrity of a blockchain.

In a process not to dissimilar to someone taking a selfie with a news paper, proving that the photo could not be taken before its publication, time stamps are created in Proof of History to prove that a block was created at a specific time. As the technology’s creator puts it, proof of history creates “a historical record that proves that an event has occurred at a specific moment in time.”

PoH works as follows (taken from "What Is Proof of History and How Does It Work?")

  • Cryptographic Timestamping: At the heart of PoH is cryptographic timestamping, which uses a sequential, pre-image resistant hash function. This function takes an input (the current state of the blockchain and a random seed) and produces a unique, irreversible output, known as a hash. This hash serves as a verifiable timestamp​​.
  • Generating a Hash Chain: Solana creates a hash chain by applying the hash function iteratively to the output of the previous hash. Each step represents a tick, with the number of hash operations indicating the time elapsed. This results in a continuous, verifiable record of time used to sequence transactions​​.
  • Recording Transactions: When a transaction is made, it’s sent with the most recent hash observed. Validators confirm its validity and timing by ensuring it references a hash within the current PoH sequence. This proves the transaction happened at a specific moment​​.
  • Consensus: Transactions timestamped with PoH are then processed using a PoS-based consensus algorithm. In Solana case, validators stake SOL to participate, earning rewards for securing the network and validating transactions. Tower Byzantine fault tolerance (BFT) (Solana's' custom implementation of a BFT), together with the help of PoH’s timekeeping, quickly achieves consensus, allowing Solana to handle thousands of transactions per second​​.

While PoH consensus mechanism significantly increases network scalability and speed they need a PoH generator to create time sequences. Given that the network can only rely on a single PoH generator at a time, this not only centralizes the process as it creates a single point of failure.

Final remarks

Consensus mechanisms play a crucial role in securing and maintaining cryptocurrency networks. The choice of a consensus protocol depends on trade-offs between security, scalability, and decentralization.

  • PoW is the most secure but inefficient in terms of energy and speed.
  • PoS improve efficiency and scalability but introduce centralization risks.
  • PoH cater to specific needs but may reduce decentralization.