If you’ve heard the phrases “Proof of Work” and “Proof of Stake” but don’t know what they mean, then now’s the time to find out.
Proof of Work and Proof of Stake are both consensus algorithms. They allow all blockchain nodes to agree and prevent double spending—an attack which attempts to spend the same coins more than once.
Here’s the breakdown. However, if you haven’t already, we recommend first reading our introductory guide to blockchain.
What Is Proof of Work?
Proof of Work (PoW) is the “traditional” blockchain model and works almost exactly as it sounds. The basic premise is that a specific amount of processing has to happen before a computer is “allowed” to do something else. For Bitcoin, miners must perform difficult calculations, and in return, they may discover a block and get a BTC reward for doing so.
Note: Proof of Work isn’t unique to cryptocurrency! Computer scientists Cynthia Dwork and Moni Naor invented it in their 1993 paper “Pricing via Processing, Or, Combatting Junk Mail, Advances in Cryptology” (although it didn’t gain its name until much later).
The PoW algorithm aims to prevent the misuse of computer systems such as email spam or cyber attacks. If a computer has to perform complex calculations before sending an email (which costs time and money), then spammers and other malicious entities are far less likely to abuse the system. For this reason, Proof of Work is almost a perfect choice for Bitcoin and other cryptocurrencies.
One of the most fundamental aspects of PoW is that it takes a long time to calculate, but is very easy to verify. If a node spends an hour doing calculations, then all the other nodes need to verify this far quicker. If every other node all took the same amount of time, then the blockchain would be useless, as it would be far too slow to use. Verification must happen almost immediately.
Miners perform these calculations. They take a long time to perform, so miners are competing against each other to calculate them first. They don’t serve any other purpose than to limit the supply of new coins onto the market. This ensures miners stay around long enough to verify transactions, and thus power the network.
The PoW algorithm used in Bitcoin is called “Hashcash”. This is a complex cryptographic process, but as it’s a calculation, it gets faster to compute as processor power increases over time. To combat this, Bitcoin (and other blockchains) often adjust the difficulty, to ensure a roughly constant supply of new coins to the market.
As you may have guessed, the biggest downside to PoW is electricity usage. PoW calculations use a huge amount of processor power. This isn’t free, so as processor power goes up, so does the electricity consumption. This leads to higher bills, and if enough people started mining with powerful mining rigs, then you may have a big problem.
For this reason, many countries have banned cryptocurrency mining, especially countries with government supplemented electricity costs. If the January 2018 boom in cryptocurrency returns, then there will be a significant increase in worldwide energy usage. Cryptocurrencies like Ethereum are looking into alternatives such as Proof of Stake.
Another possible problem with PoW is the “51% attack”. Nodes providing 51% or more of the network power can out-vote every other node. This means a single person or organization could “control” Bitcoin or any other PoW blockchains. In reality, this is of little concern. The computer power required to do so is massive and is not something even governments have access to. While a theoretical problem, a 51% attack is unlikely to happen on any large network.
What Is Proof of Stake?
Proof of Stake (PoS) works in a different way to PoW. With PoS, there are no huge electricity bills, and operators are almost betting with their coins. Node operators “stake” their coins. Those with more coins have a higher chance of being rewarding upon discovery of a block, but it’s not the only factor. If the person staking the most coins was always rewarded with the block reward, this would allow anyone to “buy” the network.
Instead, a more random approach happens. This varies depending on the blockchain, but a common method is aging coins. To be eligible to discover new blocks, coins must stake for a period of time—often 30 days. Staked coins cannot do anything else. After this time, staked coins may gain a block reward. Once again, to prevent those with the most coins gaining an advantage, staked coins expire after a set amount of time, forcing nodes to restart the process, and wait the 30-day duration again.
You may be wondering who verifies transactions with PoS. By staking your coins, your wallet needs to be online. Your computer is verifying transactions, and as there are no complex calculations like in PoW, almost any computer can do this! Different cryptocurrencies have different ways of choosing miners, but generally, accounts get assigned roughly every minute. If an account assigned to process transactions does not respond, the whole network agrees to reassign the task.
PoS works very well and solves the PoW problem of massive energy usage. As owning a large number of coins increases your chance of a reward, miners are more likely to have an interest in the project, rather than only caring about the profit. A PoW miner doesn’t have to own any cryptocurrency.
Finally, PoS mining doesn’t “cost” anything. If you don’t get chosen to discover a new block, you won’t lose your coins. For this reason, PoS networks may be susceptible to the “nothing at stake” vulnerability. As miners don’t lose their stake, what’s stopping them validating everything, even the bad transactions?
If a hard fork happens, miners may choose to verify both the old and the new chain, almost guaranteeing profits no matter what happens. This can make it difficult to perform software upgrades, as the network may not switch over to the new fork. If someone tries some dodgy stuff with the ledger and then performs a fork, they may get away with it because miners will continue to verify transactions on both chains.
Solutions to the nothing at stake problem are being considered by many networks. One common approach is to delay the payout of a block discovery reward. If a fork happens, miners will have to choose a side, because they won’t get their reward if the old fork “dies”. One reason why this attack has never materialized is simple. Despite being able to profit from both forks, Miners often want to see the network succeed, so will choose a side sooner or later.
Other Blockchain Consensus Algorithms
There are several other consensus algorithms. Some experimental, some brand new, but most are far less common than PoS and PoW.
- Proof of Activity: This combines PoW and PoS, with both stakers and miners getting a share of the rewards.
- Delegated Proof of Stake: Users stake their tokens to elect a representative to verify transactions. Very fast and people can collaborate to make new blocks, or vote out bad nodes.
- Proof of Burn: Destroying coins increases your reputation to make decisions. More destroyed coins = greater network control.
- Proof of Weight: Rather than staking, node operators change based on another metric (varies by blockchain). This can be anything, such as hard drive capacity, or Internet speed.
- Proof of Elapsed Time: Like PoW, but less work and more of a lottery. Developed by Intel, and still experimental.
As you’d expect from a cryptocurrency, consensus algorithms are complex stuff. You don’t need a computer science degree to use them, but understanding how they work can help you when purchasing coins or running a node. Let us know what you think in the comments below.