What is the difference between Proof of work and Proof of Stake?
In this article we want to answer what is Proof of Work, and why do blockchains such as Bitcoin need Proof of Work? How is Proof of Stake different to Proof of Work? Is Proof of Work really using so much electricity while Proof of Stake doesn’t?
Proof of Work is a consensus mechanism
Each blockchain is an (more or less) immutable ledger. Any person can write data onto that ledger. In the case of Bitcoin this data is bitcoin transactions between real people.
While blockchains vary a lot, each and every one of them tries to solve at least 3 basic problems:
Keeping the ledger consistent, i.e. making sure that everybody participating sees exactly the same blocks,
Keeping the ledger immutable, i.e. making sure that no single person can change a transaction of the past,
Verifying that all transactions follow basic rules
Now, the rules defined within the software make sure that blockchains meet these goals. Participants run the software and therefore follow the rules.
Consensus algorithms are one category of rules. They aim to achieve agreement between all participants on what that current blockchain actually looks like. To be specific, consensus algorithms define how exactly new blocks are added to the blockchain. Proof of Work is one group of consensus algorithms that we want to take a closer look at below.
Starting from here, we are assuming you read the basics on blockchains. If you are a little uncomfortable with words such as blocks, miner or hashes, feel free to first read an introduction of blockchain here.
A consensus mechanism is a part of each blockchain
If you are familiar with the basics of blockchains, you have heard about consensus mechanisms, such as Proof of Work. Consensus mechanisms basically tackle two specific problems.
First, as a blockchain user (e.g. bitcoin holder) you don’t want somebody to rewrite history. That is, you don’t want someone to delete the bitcoin transfer of Alice sending you 1 BTC 10 minutes ago and sending it (i.e. the exact same 1 BTC) to somebody else again. Instead you want to be sure that the BTC (or any other crypto token) on your account balance is really owned by you.
To ensure that nobody takes back a transaction, you want to make it very expensive to override old blocks. Or: You want to incentivize miners to always build on top of the latest block, adding a certainty with each new confirmed block. As the latest blocks always fight for being continued on top, the idea of building on the truly latest block is also called: Building on the longest chain.
Second, you want to make sure that miners are incentivized to continue creating new blocks. The party of confirming transactions shouldn’t stop. For bitcoin, at least in the short term, the block rewards are a big enough incentive for miners to continue mining.
Note that consensus algorithms are often claimed to serve the purpose of creating new currency. However creating new currency really happens for the purpose of creating value for miners. Bitcoin for example will stop creating new bitcoin at some point around the year 2140 after 21 million Bitcoins have been mined.
How does Proof of Work actually work?
PoW is actually older than Bitcoin itself. In fact, the original idea was published by Cynthia Dwork and Moni Naor in 1993. The term “Proof of Work” itself was coined by Markus Jakobsson and Ari Juels later in 1999.
In general a Proof of Work computation is proving that work happened. Smart isn’t it?
In blockchains miners are proving that they spend some money on electricity (and mining hardware), which assures the solution of the two problems mentioned above.
How does it solve the problems? Well, Proof of Work lets us know for sure that it’s very expensive for a miner to rewrite an old block. In fact, the older a block, the more expensive it gets for a miner to not build on top of the latest but instead of the older block.
Why? Because as a miner you are in a constant race against other miners for the latest block reward. In fact you would need roughly 51% of all block production power for a good chance to win against all other miners. That is often called a ‘51% attack’ of a blockchain, and is used as a measurement of security in terms of how much money a hacker would have to spend to re-write history and ‘double spend’ money (what we called rewriting history in the example above).
Technically speaking, doing Proof of Work as a miner means solving a hard mathematical problem with an easy proof. This might sound hard to comprehend, however is straight-forward: A miner basically calculates the hash of the current block including a random number. Starting with 0 as the random number he then uses a different number so long until the hash meets a certain criteria such as starting with 00000000. The first miner who calculates a hash that randomly satisfies this rule, wins and publishes the block to all the other miners, who then verify very easily that in fact the hash is correct and then move on to produce the next block.
Why hasn’t the energy problem of Proof of Work been solved?
You might have heard that Proof of Work uses a lot of energy and that is correct. The consumed electricity for mining bitcoins compares to something like the energy consumption of a smaller nation state.
However as we saw in our explanation above, consuming the electricity is in itself purpose of the Proof of Work consensus algorithm.
Now, how does Proof of Stake comes into play?
You might have heard about Proof of Stake as a solution to the energy problem. In fact, Proof of Stake is solving the exact same problems that Proof of Work was designed to solve. It does, however, solve them in different ways, and that is what we take a look at below.
What is Proof of Stake? How is Proof of Stake different?
A blockchain using Proof of Work as a consensus algorithm is secured by the fact that miners risk losing money. Again, a miner who doesn’t follow the rules of adding new blocks to the longest chain might lose money as does a miner how deliberately tries to spend one BTC two times (i.e. double spend attack).
While a miner of a Proof of Work blockchain loses money in form of electricity and hardware costs, a miner of a Proof of Stake blockchain simply loses money. Why? Because in Proof of Stake, validators (as the miners of a Proof of Stake chain are called) stake money - mostly the native currency of the blockchain - on the promise to follow the rules.
Proof of Stake validators receive block rewards in proportion to their stakes, while Proof of Work miners receive them roughly in proportion to their hashing power.
Proof of Stake validators lock money on the blockchain, while Proof of Work miners buy computers and spend electricity to be committed to following the rules.
This makes Proof of Stake largely virtual. While some computers still validate other rules a blockchain needs to follow, the computing power needed is way smaller than the computing power for Proof of Work mining. Therefore, Proof of Stake indeed solves the energy problem that comes with Proof of Work.
However, having staked native currency of the blockchain on top of that blockchain itself brings completely new challenges with it. And that’s the reason why a lot of today’s blockchain research aims to find ways to optimize Proof of Stake consensus algorithms.
Read more on challenges of Proof of Stake with the example of Ethereum: https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ
In summary, Proof of Work vs. Proof of Stake comes down to energy consumption and difference in difficulty
In the end, Proof of Stake comes with two major benefits.
First the energy savings. The energy consumption that are the basis of any Proof of Work blockchain, simply doesn’t exist in Proof of Stake blockchains.
Second, Proof of Stake consensus algorithm, however not completely solved yet, brings more opportunity in defining how the consensus works: Attacks can be made more expensive while block confirmations can be made faster while preserving the same promises of securing your coins.
As of December 2019, there are a couple of blockchains researching Proof of Stake. Ethereum, the most used smart contract blockchain, is in the process of merging Proof of Stake into their currently existing Proof of Work blockchain. If you are interested in the very latest developments of that Proof of Stake development, we suggest to check out the latest Ethereum Proof of Stake updates at the Ethereum Foundation blog.2020-01-08