In my previous article, I discussed how the cryptocurrency Bitcoin, use a consensus algorithm known as Proof of Work to secure their network & process transactions. The concept of Proof of Work uses enormous amounts of energy, but why is that? What are some alternative solutions?
Proof of Stake Overview
The Proof of Stake method was created as a competitor to Proof of Work. It helps solve some of the issues opened up by PoW. The goal of all consensus algorithms is the same; to decentralize power, to limit censorship of the inclusion of transactions into blocks, and to make sure that everyone agrees on the correct order of transactions.
Once you can agree on the order of events, and prohibit censorship on the network, it is just a matter of applying the algorithm to the validating nodes to arrive at the consensus state. The idea of Byzantine Fault Tolerance is essentially everyone being certain that everyone is certain that everyone is in agreement. In the case that you had a disagreement or conflicting ideas that would be described as a Byzantine Failure. Think of this as a situation where half the Generals attack and half do not attack, the battle would be lost.
What does it mean to be Byzantine Fault Tolerant? In a state of Byzantine Failure, cryptographic evidence can prove who the “at fault” Generals (nodes) are. When you have a system that can produce this cryptographic evidence of failure, you can use that to penalize whoever is at fault. Punishments in the blockchain world include a variety of things. Losing your stake in the network, being excluded from the network, etc.
Issues with PoW
Mining new coins consume a lot of computing power because of the proof of work algorithm. The idea first introduced in 1993 as a method to combat spam emails. It was formally called Proof of Work in 1997, the technique went largely unused until Satoshi Nakamoto created Bitcoin in 2009. After studying Proof of Work he came to the conclusion that the technique could be used to achieve consensus among many nodes on a network, using it is a way to secure the Bitcoin blockchain.
The PoW algorithm works by having all nodes work to solve a cryptographic puzzle, the “puzzle” is solved by miners, the first miner to find the solution to the puzzle gets the miner reward. The computing power needed has become so intense, that people are building enormous Bitcoin mining farms, which are 100’s of computers working together to solve these ‘puzzles’.
At the time of writing this article, it is estimated that Bitcoin miners alone use 54 TWh (TeraWatt Hours) of electricity per year. For a comparison, this would be enough to power 4.5 million US homes. To take it further, it also equates to the same amount of power used by the entire country of New Zealand.
Proof of work
gives more rewards to people with more and better equipment, miners that produce the highest hash rate (which is done by supplying large amounts of computing power) has the highest chance of finding the next block and earning the block reward. To increase their chances even further, miners will merge resources together, creating what is known as a ‘mining pool’. Mining pools will combine the hashing power of all nodes in the pool, and the rewards will be distributed evenly based on the hash power given to the pool. The majority of Bitcoin mining is done by mining pools, with the Top 3 controlling about 52% of the mining. To sum this up, PoW uses an extraordinary amount of electricity to solve the algorithm. Because of the hash power needed, solo mining is just not feasible. This has led to mining farms which essentially make Bitcoin more centralized (since 3 mining pools control more than 51%). Because of these weaknesses associated with Proof of Work, cryptographers needed a new consensus algorithm.
History of Proof of Stake
In 2011, a Bitcoin talk forum user named Quantum Mechanic proposed a new technique that he called Proof of Stake. The basic idea is that letting everyone compete against each other in the mining process is very wasteful of resources. Instead, Proof of Stake uses an election process, where one node is selected to ‘validate’ the next block. Proof of Stake also does away with the terminology of miners, instead, they have the concept of Validators.
A Validator does not mine new blocks (remember mining is costly), a validator will Mint or Forge a new block. Anyone can become a validator. You must deposit a certain amount of coin into the network as ‘Stake’ (similar to how a security deposit works). The size of the stake determines the chances of a validator to be chosen to Mint the next block. The correlation for this process is linear. If Validator A deposits $200 and Validator B deposits $2,000, then Validator B has 10X greater chance of being selected of Validator A.
For fans of Robin Hood (the Movie not the Crypto Exchange), this might not seem like a completely fair concept. As it would seem that it is a system to favor the rich and cripple the poor. In reality, it is actually a more fair process than Proof of Work, with PoW rich people can use the power of economies at scale. The prices they pay for extra mining equipment and electricity does not go up in a linear fashion, it actually works the other, the more they buy of each the better pricing they will get on the whole package.
How Does PoS Work?
In the proof of stake method, when a node is chosen to validate the next block, it will check and make sure that all the transactions within that block are valid. If everything is as it should be the node will Validate the block, and add it to the chain. The node then receives the fees that are associated with the block. How can we be sure we can trust all the validators on the network? This is where the Stake comes into play. Validators will lose all or part of their stake if they approve fraudulent transactions. As long as the stake that is deposited is higher than the reward they receive from validating, we can safely trust these nodes to do their job. No one will take actions to lose money in a situation. If a node wants to discontinue their role as a validator, their stake and unpaid transaction fees are released. This process usually happens over a period of time. With small parts of the stake being released over a period of weeks. The reason that the stake is not given all at once is that transactions are not done in real time. The network still needs a way to punish for bad transactions after they have signed off the network.
I think it is clear there are many differences between PoW and PoS. Proof of Stake lessens the number of validators of their system by enforcing the Stake component. Fewer validators equate to less energy being used and less money being spent to maintain the system. PoS is also more decentralized than PoW. This has to do with the concept of PoW mining pools that control the majority of Bitcoin mining. If you had a situation where the top 3 mining pools merged together. They would control more than 51% of the mining and technically could start approving fraudulent transactions. Another differentiator is that setting up a node for a PoW based blockchain is much more expensive. With Proof of Stake, you don’t need expensive mining equipment. This encourages more people to set up a node which makes the network more decentralized and more secure.
Proof of Stake vs Delegated Proof of Stake (DPOS)
What is the difference between Proof of Stake and Delegated Proof of Stake? I will get granular into more of the specifics between PoS and DPoS in future articles where I’ll discuss Longest Chain and Last Irreversible Block. The main difference between the 2 mechanisms is that Delegated PoS introduces the concept of elected validators. This gives a finite number of validators to the network, which increases transaction speed. DPOS blockchains have different methods for establishing how validators are elected and how many validators there will be. Generally speaking, the validators are elected by coin holders, similar to an election where the members of the community elect the Officials.
I hope you have enjoyed this overview into Proof of Stake and how it compares to Proof of Work and Delegated Proof of Stake. In future articles, we will jump into more specifics on Delegated Proof of Stake and how it actually works.