Blockchains are often mentioned as one of the technologies with the greatest impact on our future lives. In fact, blockchain developers, are one of the most-demanded and highest-paid IT jobs, right now.
Blockchains can be thought of as a distributed database or network without a central authority that controls it. All the participants in the networks, the so-called nodes, make up the network. The method the nodes use to agree on the state of a blockchain is called consensus mechanism (also called consensus protocol or consensus algorithm). Through these mechanisms, the state of the blockchain can be verified. This in turn makes blockchains great in areas where trust is a prerequisite.
Proof of Work (PoW), the consensus mechanism used in Bitcoin, and Proof of Stake (PoS) are the two major consensus mechanisms that allow validation of transactions and the addition of new blocks to the blockchain.
Let’s dive a bit deeper into the topic…
First Things First - What’s a Consensus Mechanism?
Since a blockchain, or more generally speaking, a distributed network, lacks a central authority that decides on the state of the network, the nodes that make up the network need to reach an agreement on its state, meaning what transactions are valid. Reaching this agreement can be quite tricky. In this way, it also helps to democratize decision-making.
A consensus mechanism is the backbone of a blockchain and helps to coordinate the network and keep it secure. We’ve said that you can think of the blockchain as a distributed database. It’s important that every node that makes up the network has the same copy of the database. If this wasn’t the case, you’d quickly end up with conflicting information.
There are different types of consensus mechanisms, depending on the blockchain and its application. We’ll dive deeper into the two major consensus mechanisms, namely Proof of Work used in Bitcoin and formerly in Ethereum and Proof of Stake, which is currently used in Ethereum.
Proof of Work
When Satoshi Nakamoto invented Bitcoin, he needed to make sure that the blockchain was safe. He used a consensus protocol called proof of work to achieve this. Proof of work is one of the widest-spread consensus algorithms and has also been used in Ethereum (before it changed to Proof of Stake in Ethereum 2.0), Litecoin, or Dogecoin.
In Proof of work, the nodes of the networks (in this case also referred to as miners), compete against each other to be the fastest in solving a highly complex math problem. In solving the math problem first, the miner gets the “proof” for his “work” and earns the right to process the next block of transaction. The miner in turn is rewarded with a pre-determined amount of cryptocurrency.
Proof of work is computationally very expensive and therefore requires an enormous amount of energy. In fact, Bitcoin has often been criticized for having a major environmental impact. Oftentimes, also specialized hardware like GPUs and high-end machines are required, which may hinder access for individual miners.
Advantages of Proof of Work
- Since Proof of work has been around the longest, this also means that it is the one that’s widely used by many cryptocurrencies.
- It’s said to be extremely secure, since more than half of the network would need to be controlled by attackers to manipulate the network. This is also known as 51% attack.
- It attracts “miners”, the people (or nodes) that validate transactions, by rewarding them.
Disadvantages of Proof of Work
- Proof of work requires a lot of energy. The nodes in the network go through a computationally very expensive race of trial and error to find the nonce for a block. Therefore, proof of work is said to have a high environmental cost.
- To be able to compete with existing miners, often very expensive hardware is required, which in turn can make it difficult for individual miners to compete with so-called mining farms.
- The proof of work protocol is associated with a very slow transaction speed, which in turn makes it difficult to scale the network. This is one of the reasons Ethereum made the step to proof of stake.
Want to stay up-to-date?
Receive the latest insights for free.
Proof of Stake
Proof of stake is a consensus mechanism where the right to validate a transaction and adding new blocks to the network depends on how much a validator (called miner in proof of work) has staked, i.e., how much cryptocurrency the validator holds.
A computer algorithm chooses validators with a certain degree of randomness involved, but those that hold more of the network’s currency have a higher likelihood to get selected. It basically rewards those that have prolonged participation through higher staking of the network’s currency.
Proof of stake, unlike proof of work, does not rely on energy to select its validators. Therefore, its energy consumption and impact on the environment is much lower. It’s also designed to address the scalability and transaction speed issues related to the proof of work protocol.
Advantages of Proof of Stake
- Proof of stake is not designed around a competitive process of who’s the fastest in finding the right nonce to the block. Therefore, it requires relatively little energy to maintain, compared to proof of work.
- In contrast to the competitive proof of work, proof of stake reduces transaction times and can therefore increase transaction volume.
- Since proof of stake is more efficient than proof of work, transaction fees are lower, which also favors transaction volume.
Disadvantages of Proof of Stake
- In smaller networks, there’s an increased risk of a 51% attack, where someone controls 51% or more of a cryptocurrency and can therefore manipulate the blockchain.
Alternative Consensus Mechanisms
With an increasing number of cryptocurrencies, the ways these cryptocurrencies are governed have also diversified. This list is non-exhaustive and, surely, the number of consensus protocols will increase in the future.
Delegated Proof of Stake
This variation of proof of stake allows someone to vote on the number of delegates to create a new block. Cardano is a well-known example for delegated proof of stake.
Proof of Authority
The proof of authority consensus protocol uses a reputation-based model, where nodes need to be selected and approved by other network participants to validate new blocks. Whereas in proof of stake a validator needs to put in financial capital, in proof of authority a validator needs to put in social capital. VeChain is an example of a blockchain that uses proof of authority.
Proof of History
In proof of history, every validator has, figuratively speaking, a built-in clock that records the specific moment an action was performed on the blockchain. In Solana, for example, which uses proof of history, one lead validator at a time processes transactions and writes the network state, while other validators read the state and confirm them.
Proof of Space/Proof of Capacity
In proof of space, also known as proof of capacity, a validator stakes its available hard drive space to gain the right to process and validate the next transaction. On the hard drive, several cryptographic mining solutions are stored. This means the harder drive space you have available, the higher your stakes and the higher your likelihood to process the next transaction. Chia is a network that uses proof of space, even though it is tied to proof of time.
- Consensus mechanisms are a tool that allow decentralized networks to reach an agreement on the state of the network.
- Consensus mechanisms are the backbone of the blockchain and play a crucial role in the security of the blockchain.
- Proof of work, the first consensus mechanism, is said to be very secure but requires high amounts of energy and mining requires specialized hardware.
- Proof of stake uses the amount of the network’s cryptocurrency a validator has staked to determine the right to process and validate a block.
- Each consensus mechanism has its pros and cons and with time, we will see a greater variety of them. Some more recent consensus mechanisms include proof of history, proof of space, or proof of authority.