One of the main advantages of blockchain technology is that it is decentralised, meaning there is no third party to make decisions, validate transactions and add new blocks to the blockchain. This is done via a peer-to-peer system. But how are these transactions actually validated? The answer – consensus models.
What are consensus models?
Consensus models are how we come to some sort of an agreement about the state of the network, in a decentralised way, by verifying and validating the information being added to the ledger. So, a consensus algorithm is the process of decision making within a group. These consensus mechanisms (or algorithms) ensure the blockchain remains secure by only allowing genuine transactions and validators.
As you can see in the image, there are many different types of consensus models, however the two that we will look at in this article are:
● Proof of work (PoW)
● Proof of stake (PoS)
What is the difference between Proof of Work and Proof of Stake
The main difference between these two consensus models is how they decide who can add transactions to the chain. In proof of work, it is done by solving complex mathematical equations using computing power, whilst in proof of stake, miners stake their coins in order to validate transactions and add blocks to the blockchain.
What is Proof of Work (PoW)
Proof of work refers to a system where computers (often referred to as ‘miners’) compete against each other to solve complex puzzles, which in turn verify transactions on the blockchain. When a block of transactions is verified, the block is added to the blockchain.
Miners show their proof of work by entering their block into the blockchain – showing proof that their work has solved the equation. It’s like unlocking the lock to a vault – the unlocking of the vault shows proof of work. The first miner to solve the puzzle is rewarded with a block reward in the form of the cryptocurrency they are mining.
Although the concept has been around for the best part of 30 years, this was one of Satoshi Nakamoto’s biggest ideas applied in their 2008 whitepaper as it allows ‘trustless and distributed consensus’ (a peer to peer payment system). It was thus built into the design of Bitcoin
Why is it called ‘mining’ you ask? The energy and resources required to solve these equations is considered to be the digital equivalent to mining precious metals from the earth.
Advantages and Disadvantages of Proof of Work (PoW)
The main advantage of the PoW model is that it is very secure. Proof of work helps minimise attacks/hacks on the blockchain, as an unwanted party would require significant amounts of computer power. Even if they did manage to solve the problem the quickest, the network’s nodes would then prove this to an invalid transaction.
The healthy competition between miners also ensures this model remains as decentralised as possible, which as we know, is one of the most important components of blockchain technology.
However, this significant amount of resource is also a general limitation, with miners needing powerful computers to solve the puzzles at a competitive speed. Purchasing the appropriate mining equipment comes at a price, not only increasing the barrier for entry but also leading to more mining pools (miners working together), which can reduce decentralisation and increase the likelihood of 51% attacks. This occurs when a single node or group of nodes obtain 51% of the hashing power, giving them majority control of the blockchain.
Proof of Stake (PoS)
Proof of Stake was founded on a forum in 2011 by a poster named ‘Quantum Mechanic’, who was suggesting an alternative consensus model than proof of work. Rather than rely on computers/miners to race against one another to generate the right hash and validate transactions, validators stake their tokens in order to validate transactions and add blocks to the blockchain. The more tokens a validator stakes, the greater their chances of being selected to validate a block. If a validator attempts to attack or manipulate the network, they will lose their stake.
Unlike PoW, there is no competition in the PoS model as the block creator is chosen by an algorithm based on the user’s stake. If you are chosen, you need to approve the validity of all transactions in the block so it can be added to the blockchain. There is no reward for making a block, so the block creator takes a transaction fee. Whilst Ethereum currently operates on proof of work, the developers are working on Ethereum 2.0 that will run on proof of stake.
Advantages and Disadvantages of Proof of Stake
Proof of stake is more energy efficient as it doesn’t require mining equipment or superior computer processing power to verify transactions. Energy consumption is becoming more and more a topic of conversation in crypto mining, and PoS is a much greener alternative to PoW.
Second, PoS is more secure than PoW since it’s less susceptible to 51% attacks. Third, PoS allows for a more decentralised blockchain network since anyone with a stake in the network can validate transactions and earn rewards, regardless of their computing power.
Fourth, and perhaps most importantly, PoS blockchains tend to be much faster and more scalable than PoW blockchains. This is because validating transactions on a PoS blockchain only requires checking that the user has a valid stake in the network, which is a relatively simple process. In contrast, validating transactions on a PoW blockchain requires solving complex mathematical problems, which can take a significant amount of time and computing power. As a result, PoS blockchains are generally much better equipped to handle large numbers of transactions than PoW blockchains.
However, some people don’t like PoS as there is less physical backing behind it, especially compared to PoW which uses electricity and mining equipment in the process.
PoS is also less decentralised than PoW as it requires users to have a large amount of tokens to participate in the network. This also can lead to 51% attacks, however it is less likely compared to PoW.
Ethereum 2.0 and Proof of Stake
Since its inception, the Ethereum blockchain has been built on proof of work. However, with the long-awaited launch of Ethereum 2.0, the infrastructure will move to a proof of stake model.
This means that instead of miners solving complex mathematical problems to validate transactions, Ether holders will be able to stake their coins to help secure the network. In return for staking their coins, holders will earn rewards in the form of newly minted Ether.
The switch to proof of stake is a major change for Ethereum, and it is hoped that it will help address some of the issues that have plagued the blockchain in recent years, such as scalability and energy efficiency. With more people staking their coins, it is expected that transaction times will decrease and the blockchain will become more efficient overall.
On the PoW model, Ethereum only processes 30 transactions per second. However, this is expected to increase to as much as 100,000 transactions per second once it’s fully transitioned to PoS.
Both consensus models help verify transactions on the blockchain, however each have a different approach to getting there. PoW is more decentralised and secure, whilst PoS is more environmentally friendly and efficient.
Both have their pros and cons, as we’ve discussed in this article, and we don’t have a view on which one is better than the other. As we touched on at the top, there are so many more consensus models out there, and there will be many more to come in the future.