Proof-of-Work vs Proof-of-Stake
Updated: Jan 12, 2022
Image Source- POW vs POS
What is a consensus mechanism?
Consensus mechanism is a process to arrive at the truth in a decentralized network.
What does “arriving at the truth” mean?
Let’s say that you transfer some money from your HSBC Account to your friend’s HSBC Account. You’re relying on HSBC to record the truth of the transaction.
Over the last 150+ years, HSBC has proved itself reliable in recording such truths. HSBC is a centralized organization i.e. decisions are taken centrally. HSBC management decides on policy, strategy, and execution. But centralization has issues. What if the government orders HSBC to freeze your account? Or HSBC facing liquidity issues disallows all withdrawals or applies a haircut to your bank balance?
=> Such things might sound improbable in Hong Kong where I live and where HSBC is the leading retail bank, but such things have happened in other parts of the world with other banks.
The solution is to have a decentralized platform. How does that help? There is no centralized entity that can be ordered by a government to freeze any account or influential CEO who can be threatened with jail time for non-compliance. Drastic decisions like haircuts will be taken by the community keeping their interests in mind. If you have an account with HSBC, you’re unlikely to vote for freezing of withdrawals or reducing account balances.
But decentralization is not easy to achieve. How does a decentralized community take decisions? How do you enforce order? How do you stop it from becoming the Wild West? Going back to our example, when you transfer some money to your friend, how do you get a group of people who do not know each other and who are not subject to any laws and hence cannot be punished for malicious behavior, to record the truth of your money transfer correctly?
The answer is through an effective Consensus Mechanism that is enforced by code.
The two most popular consensus mechanisms are Proof-of-Work and Proof-of-Stake.
What is Proof-of-Work (POW)?
POW is a math competition. Competitors (called miners) compete to solve a math problem. The first to solve it gets the privilege of creating the next block. Creating the next block means deciding which transactions make it to block, i.e. which transactions will be considered as having occurred. If your transfer to your friend does not make it to a block then it hasn’t happened.
And why does any miner want the opportunity to create a block? Miners who successfully add a block are awarded coins of the said blockchain. So if you’re a bitcoin miner and you create a block then you get awarded 12.5 BTC + transaction fees.
A combination of cryptography and game theory ensures that miners don’t act maliciously i.e. they don’t add transactions that never happened, pay BTC to their own wallets, etc.
How does cryptography help? One has to have access to the private keys of the payer wallet (that are protected by cryptography) to be able to transfer funds out of it. Only the owner of the wallet has the private keys.
How does game theory help? The math problem that has to be solved requires specialized hardware and lots of electricity. If you’ve built the knowledge to solve the math problems, invested good money on buying specialized hardware, and set it all up in a location with affordable electricity, then you’re unlikely to take action that undermines the network. If you do then the BTC you have earned and the equipment you’ve bought all become useless.
What is Proof-of-Stake (POS)?
In POS, the right to create the next block is allocated based on the number of tokens staked. Here the role of miners is assumed by minters. Minters stake tokens. The higher the tokens staked, the higher their chances of being selected to create and validate blocks. The reason you want to create blocks is similar to POW i.e. you are allocated tokens and get to earn transaction fees.
There’s cryptography and game theory at play here as well. Cryptography is similar to POW i.e transfers out of a wallet require access to the wallet's private keys.
How does game theory apply? If a minter does something malicious then they risk losing their stake. Small mistakes like being offline attract small penalties, while bigger blunders like validating incorrect transactions invite bigger penalties like having your entire stake slashed. Therefore, the human aversion to losing money is at the heart of getting minters to behave.
So which one is better between POW and POS?
Environment - POW has a higher environmental footprint as mining involves the use of energy-guzzling equipment. POS is far more energy-efficient. Having said that, bitcoin mining is moving from fossil fuels to cleaner energy sources.
Decentralization - POW mining has higher barriers to entry than POS staking. A high level of capital and skill is required to set up a profitable mining operation which means that fewer entities are qualified to take on the task. POW networks, therefore, run the risk of having the consensus mechanism become more centralized. POS staking can be undertaken by anyone who owns the network token. Yes, there is a certain level of skill required in validating transactions and ensuring that the node is always running but most POS networks allow delegation i.e. you can delegate your tokens to a professional staking pool. Since the population of stakers is higher than the population of miners, POS networks are likely to be more decentralized.
Scaling - Scaling through sharding is more practical in POS than in POW.
What is sharding? Sharding is when a network has multiple parallel chains instead of just a single one. The advantage is that transactions don’t need to be executed one after the other but can be executed in parallel and hence the capacity of the blockchain is increased. To put it simply, if the capacity of a chain is 10tps (transactions per second) and there are 100 chains then the network capacity increases to 1000tps (10*100).
Why does POS support sharding but not POW? It's not that POW cannot support Sharding. It's just that the network will become far less secure in a sharded POW network. A single ASIC miner can be used for securing only 1 shard and hence miners will get divided between the 100 shards making each shard 1/100th as secure as before. This risk does not apply to POS as the same stake can secure multiple shards
The above arguments kind of indicate that POS is superior to POW. Then how is it that the two most secure and decentralized networks, Bitcoin and Ethereum are POW networks?
Bitcoin and Ethereum have a huge first-mover advantage.
When Bitcoin started, even Satoshi Nakamoto probably couldn’t have imagined the scale to which Bitcoin would develop. Bitcoin was initially mined by the Cryptopunk community as a hobby. It slowly spread to less technically sound participants but not many people seriously considered it as a form of money. Events like buying a pizza with 10,000BTC and references to bitcoin in shows like The Good Wife gradually increased public curiosity about it but it wasn’t till the 2017 run-up that people started talking about it as an investment. The net result of this was that BTC was not captured by powerful investors with buckets of cash during its infancy. Coin ownership, node ownership, and mining equipment ownership are all decentralized.
BTC is especially decentralized because it had a fair launch i.e. tokens were not allocated to founders but earned through mining. Bitcoin’s founder (allegedly) owns a million coins (under 5% of total supply) and he/she/they have not moved it which means they haven’t enriched themselves despite the price rise.
Technically, creating a copy of Bitcoin (like Doge) is very easy. The code of bitcoin is open source and therefore can easily be replicated. However, these copies are doomed to fail because now that public blockchains are considered a legitimate infrastructure and there are stories galore of people having made life-changing money in it, the possibility of wealth will attract wealthy investors who will capture the token for themselves and not allow it to be distributed widely.
Moving to POS, if one looks up the token allocation of most POS tokens, one would notice that the bulk of tokens are allocated to founders/ team/ marketing/ foundation and the public sale is often in the single percentage digits. To my mind, such tokens are decentralized in name only. Ownership is concentrated in a few hands and those hands can change network rules in a way that benefits themselves. Even when the token distribution is not so concentrated, there are POS networks where a single person or group can influence decisions and coordinate execution. This might be efficient but cannot be called decentralized.
When a new token is launched today, founders keep large quantities for themselves, venture capitalists get large allocations at preferential prices, and some are sold to the public. The same persons earn more tokens by staking and hence there’s limited redistribution. This is not to say that POS protocols cannot become decentralized over time but the founders have to be committed to decentralization from Day 1.
The larger point I’m trying to make is that Bitcoin and Ethereum are decentralized because when they were created, they were not expected to become the phenomenon that they have become today and hence the rich and powerful did not corner them. Further, the volatility in prices has meant that the tokens are continuously redistributed i.e. when prices go up, hodlers take profits by selling part of their holdings, and hence the population of token holders expands.
Disclaimer- The article is a reflection of the author's personal views