Proof of Work and Proof of Stake

Vivek Singh
5 min readDec 17, 2021

--

https://www.c-sharpcorner.com/article/proof-of-work-vs-proof-of-stake/

Proof of Work and Proof of Stake are the two major consensus mechanisms/algorithms used to verify the transactions in blockchain networks like Bitcoin, Ethereum, Cardano, Polkadot.

There are new Blockchain networks like Solana using Proof of History. Ac to official docs — Solana can do 50k transactions/second. I will discuss Proof of Work and Proof of Stake in this blog.
Hopeful of covering Proof of History on the next one(just can’t seem to get my head around the concept, and Solana doc is confusing) .

Proof of Work

Proof of work is similar to a race. Whoever wins the race is the winner and gets the cash prize. The only exception is that there are no runner ups and no participation prize.

In a blockchain network, the participants in the race are called miners. Miners are actually computers(also termed nodes) who solve a mathematical puzzle to win the competition. After winning the competition, they get to validate the transactions. The winner gets to update the blockchain with the latest verified transactions and is rewarded by the network with a predetermined amount of crypto. To validate a transaction, the transaction owners pay gas fees to the miners. So miners can earn money if they can solve the mathematical problem, and get to validate a transaction.
Remember, this is a two step process — To validate a transaction you will have to first solve the mathematical problem.

We don’t know which miner/node will produce the next block. Two nodes could produce two valid blocks at the same time. When a block is propagated to the network, it is added to the list of blocks. In this edge case, where two blocks are propagated at the same time, a fork is created meaning some of the nodes accept the 1st block and the other nodes accept the 2nd block. This continues and a chain of nodes are created. However one of those chains of nodes will be discarded based on the length of the chain of nodes. The chain of nodes with more length is considered to be the correct one, the shorter one is discarded. Eventually the correct nodes selected are propagated to the nodes which had made wrong selection earlier.

If you have a powerful computer, there is a higher chance of solving the mathematical equation first and hence you can earn more. Miners come together, and form a group so that the hardware power can increase, in turn increasing computing power and generating more hashes. Eventually the chance to solve mathematical problems increases.

The drawback of this approach is that it is not scalable and consumes electric power which can be equal to the power needed by countries like New Zealand. Scalability is an issue because solving this mathematical problem consumes time and hence 5–10 transactions per second is roughly the limit while Visa processes around 1700 transactions per second. Block time is 10 minutes; which means every 10 minutes a block is added to an Ethereum 1.0 network.

Block is a group of transactions

Bitcoin consumes 152 TWh per year, which is 0.65% of the entire world’s electricity consumption. For instance, Google uses 13 TWh per year. That’s right; the same Google that provides Google Search, Google Maps, Gmail, Google Workspace, Google Pay, and many other valuable services. Not to mention, they run an entire cloud infrastructure service that every giant company uses. They process billions of operations per second while using less than 10% of Bitcoin’s energy. A single Bitcoin transaction as simple as sending someone $10 of value could power a US household for 62.5 days. A single Bitcoin transaction is estimated to emit an average of 300kg of carbon dioxide (CO2).

Source : https://medium.com/gochain/the-truth-about-bitcoin-and-ethereum-energy-consumption-20a325f39b52

Ethereum 2.0 is moving from Proof of Work consensus to Proof of Stake consensus. Bitcoins still use Proof of work. I found an astonishing graph depicting the power consumption :

Source : https://blog.ethereum.org/2021/05/18/country-power-no-more/

The point is we need something else. Something which replaces Proof of Work and is efficient.

Proof of Stake

Developers understood from the beginning that Proof of Work will have challenges because of the scalability issues and the consumption of electricity. Blockchain networks like Cardano, Tezos, Atmos are already using this consensus algorithm and with Ethereum 2.0 there is a plan to move completely to Proof of Stake by 2022.

In Proof of Stake consensus, we call miners as validators. This employs a network of validators who contribute or stake their own crypto in exchange for a chance of getting to validate a new transaction, update the blockchain network , and earn a reward as gas fees.

There are multiple implementation models of proof of stake. For instance, you could factor in different criteria's when selecting a validator : it could be random, it could be the validator with maximum stake of crypto, it could be the validator who has been with the network the longest i.e. the length of time.

Generally, the size of stake is dependent on your becoming a validator. Take a simple example- If Alex has 1000$ and Brad has 100$ as stake amount. In this case the probability of Alex being chosen as the validator is 10x more as Alex has more amount at stake.

You might ask if there could be fraud in Proof of Stake as there’s no mathematical problem to solve here like in Proof of Work?

The answer is no. The reason is the amount at stake will always be higher than your total transaction cost in a block. So to be a validator you will have to stake an amount which is more than what you can receive after validating transactions. If you are a legit and trustworthy validator, then you can earn. However if your validation of the transaction is found to be wrong or fraudulent, then you will lose part of your stake. So as long as the stake is higher than total transaction fees, we can trust the validator to do the job right. If not they will lose more money, then they can gain. To check if the validation is right, there’s a term called fact check which is implemented by blockchain networks. Fact check is a validation done by a different validator to check if the validation done by the primary validator is correct .

This consensus algorithm costs less, and consumes less electric power. It is easy to scale, since the number of transactions validated could be 50,000 per second.

Flaws in proof of stake -

Buy majority stake and do frauds. Stake will prioritize rich people obviously. Hence this will increase the price of coins.

References
https://www.coinbase.com/learn/crypto-basics/what-is-proof-of-work-or-proof-of-stake
https://www.youtube.com/watch?v=M3EFi_POhps
https://www.youtube.com/watch?v=x83EVUZ_EWo
https://www.geeksforgeeks.org/difference-between-proof-of-work-pow-and-proof-of-stake-pos-in-blockchain/

Conclusion
Feel free to reach out LinkedIn and drop any comments if you have thoughts on this.

--

--

Vivek Singh
Vivek Singh

Written by Vivek Singh

Software Developer. I write about Full Stack, NLP and Blockchain. Buy me a coffee - buymeacoffee.com/viveksinless

No responses yet