Built into every blockchain is a set of rules that defines who gets to add transactions to the distributed ledger, what they have to do to earn that right and how to prevent them from abusing that power.
The two most popular approaches are called Proof of Work and Proof of Stake. But what are they and is one better than the other? Our guide to Proof of Work Vs. Proof of Stake will help to demystify the internal workings of the blockchain.
Consensus Algorithms in Blockchains
Stripping away all the technology, a blockchain is a ledger — a log of all the transactions people have made since the blockchain was created. In that respect, it is no different from the ledgers used in the fiat world.
Before we can understand the differences between Proof of Work (PoW) and Proof of Stake (PoS), we need to understand how blockchain ledgers are different from those fiat ledgers.
Imposing trust on fiat ledgers
Let’s start with a simple example, an old-school passbook savings account. Your bank records your deposits, withdrawals and balances line by line on a paper “passbook” that you keep for your records. You can trust the balance because you made those transactions and can check the bank’s math.
But what happens if the bank gets robbed or there’s a run on the bank? In the United States, the government guarantees you’re protected through the FDIC insurance program.
Businesses have more complicated ledgers, but these systems record credits and debits just like that simple passbook. Trust, however, becomes more complicated since so many people have the power to embezzle or commit fraud.
That’s where Generally Accepted Accounting Principles (GAAP), outside auditors and other systems come in. They provide the assurances that businesses, investors and creditors need to trust the business’ own accounts.
Scale up to the entire global financial system and you get even more complex systems. Central banks, regulators and other organizations are tied together by treaties and agreements developed over centuries. All of this serves to imbue trust in the global financial order.
Blockchain: trustless ledgers
When Satoshi Nakamoto first proposed the bitcoin blockchain, fewer people associated the word “trust” with the global financial order. The economic collapse triggered by America’s mortgage crisis led many to ask if there was a better way. Nakamoto’s solution was to create a currency system that did not need trust.
All blockchains share essentially the same structure Nakamoto created for bitcoin. A blockchain contains the entire history of transactions going back to the “genesis block” as the first transaction is called. When new transactions are made, somebody packages them into a “block” and uses cryptography to add that block to the blockchain.
The main difference between blockchains lies in what computer scientists call the “consensus algorithms.” These are the rules that determine who gets to add new blocks to the blockchain, what they must do to earn that power, and how they are prevented from abusing that power. Where the fiat world relies on outside structures to enforce trust, blockchains rely on the consensus algorithms built into the system itself.
PoW and PoS are two kinds of consensus algorithms that drive most of the world’s various blockchain systems.
Proof of Work
Satoshi Nakamoto chose to use PoW as the consensus algorithm for his Bitcoin blockchain system. Even though his use of PoW was
Origins of PoW
Back in the early 1990s, a computer science researcher returned from vacation to find an email inbox flooded with 241 emails. (I know, right?) The proposed fix “Pricing via Processing or Combatting Junk Mail” was published by Cynthia Dwork and Moni Naor in an academic journal.
They proposed a way to prevent the “frivolous use” of shared systems like email by forcing a user to make a difficult, but not impossible, computation before getting access.
Five years later, British cryptographer Adam Back extended Dwork and Naor’s concept to create Hashcash, a system for deterring spam. Anyone sending a Hashcash email would have to perform a difficult computation, a 160-bit hash, based on the email’s unique header. Back coined the term “proof-of-work” to describe the calculated hash. The recipient’s computer could verify the hash in a fraction of a second.
PoW on the Bitcoin blockchain
Nakamoto adapted the hash-based technique and used it to create bitcoin’s PoW.
A hash is a function that converts input data into a fixed-length output. Whether the input is the word “hello” or the complete works of William Shakespeare, the hash function’s output is two sets of data of the same length.
The Bitcoin blockchain’s hash function takes inputs in the form of the proposed new block and a number called a nonce. The trick is finding the right combination of block and nonce that meets the blockchain’s criteria.
The people who process transactions on the blockchain, the miners, run Bitcoin software over and over again to test different nonces. This is the “work” in “proof-of-work”. Whoever finds the right nonce first gets the right to add their block to the blockchain, earning some bitcoin in the process.
Since a block contains new transactions and the previous block’s hash, everyone else’s blocks are now useless. The miners start from scratch, rebuilding their blocks and looking for new nonces.
Bitcoin PoW disadvantages
The 51% threat
Let’s say a hacker wants to change a particular transaction. That would change the content of the block, which would change the block’s hash and require a new nonce. Since the next block on the chain is based on the old hash, you have to change that block’s nonce to generate a new hash.
That type of attack would be doable, except the blockchain’s miners are adding more blocks to the blockchain. The only way to catch up to and make your version of the blockchain the “official” version is to have more computing power than all of the other miners combined. This is what’s called a 51% attack and ought to be very difficult, nearly impossible, to carry out.
Unfortunately, there was an unintended consequence of the hash function Nakamoto chose. The fastest way to calculate the hashes is by running software on custom-designed computer chips called ASICs. ASICs are expensive. That favors well-financed mining pools who fill warehouses with ASIC-powered systems. This chart from Blockchain.com shows the share of new blocks each of the large mining pools adds to the blockchain:
The five largest bitcoin mining pools record just under two-thirds of the blocks recorded to the blockchain. This creates a risk that they could start working together to charge higher fees or even decide whose transactions actually get recorded to the blockchain.
Another disadvantage of Nakamoto’s hashing function is the very intense computations that the PoW requires. The racks of ASIC-powered computers running these calculations consume enormous amounts of electricity. Indeed, the most popular places for these companies to set up shop are near hydroelectric dams, geothermal power plants and other cheap sources of electricity.
A study published in the academic journal Joule estimated that the Bitcoin blockchain consumes at least 2.5 Gigawatts and could approach 7.7 Gigawatts by the end of 2018. By comparison, Ireland consumes 3.1 Gigawatts.
Nakamoto’s design of the Bitcoin blockchain capped how quickly transactions could be recorded to the blockchain. The system automatically adjusts to separate each new block by ten minutes. Confirming that transactions made it onto the blockchain take even longer.
A study of blockchain transaction times reported by The Motley Fool found that bitcoin transactions in May took an average of 78 minutes to be confirmed.
This makes the Bitcoin blockchain a poor choice for certain distributed applications and even makes it difficult for high-volume exchanges.
Other PoW blockchains
The debate over what to do about the weaknesses in the bitcoin blockchain led to hard forks as bitcoin cash. Other coding groups also tried to make a “better” bitcoin by tweaking its PoW system. Still more groups decided that switching to an entirely different PoW system was the better approach.
Ethereum uses a hash-based PoW algorithm, ethash, that is less computationally intensive and does not run well on ASIC-based systems. As a result, the Ethereum blockchain consumes much less power than its main competitor. All the same, Ethereum is just as vulnerable to an internal 51% take-over. According to Etherchain, the five largest Ethereum mining pools account for a full 80% of blocks mined in one 24-hour period.
Litecoin was one of the earliest efforts to create an alternative blockchain to Bitcoin. It uses a different PoW algorithm that runs cost-effectively on the graphics processors typically bought by gamers. Litecoin also aims for a faster transaction rate by recording blocks every 2.5 minutes.
Proof of Stake
Regardless of the algorithm a PoW system uses, critics say, they can never avoid the centralization of processing power and the excessive energy consumption. PoS is an alternative that does away with the computational requirements by awarding block-adding powers to people with a stake in the blockchain’s success.
Evolution of PoS
One of the earliest blockchains to use PoS was peercoin. It allocates blocks based on how much of the blockchain’s currency, the PPC, people own. The more you own, the greater the chance you’ll be able to record a new block to the peercoin blockchain. It also means you have a greater chance to get awarded, or “mint”, PPC in the process.
The process of recording blocks to a PoS-based blockchain is much less energy-intensive. It also avoids the possibility that mining pools will collect more than 51% of the processing power and gain control of the blockchain. To get control of a PoS blockchain, you would have to buy 51% of the blockchain’s coins, an expensive proposition.
However, peercoin’s creators ran into a Catch-22 situation at the cryptocurrency’s launch: how do you allocate blocks based on PPC ownership when nobody owns PPC? Peercoin had to launch with a PoS/PoW hybrid system. A traditional PoW system let people mine for PPC but would be phased out once enough people owned PPC to make the PoS system work.
While the PoS consensus algorithm addresses the weaknesses of computation-based PoW systems, it has drawbacks of its own. In particular, there is what’s called the nothing-at-stake problem.
When an accidental fork appears in a PoW-based blockchain, the miners must choose to process transactions on one or the other blockchain. The financial incentives drive the miners towards a consensus choice, making the blockchain more resilient to errors.
In the case of PoS-based blockchains, the minters don’t have any incentive to choose one fork over the other. This situation could make forks more common.
Other PoS blockchains
Despite its first-mover advantage, peercoin never became popular. It currently ranks in the low 70s on CoinMarketCap’s ranking of cryptocurrencies. That lack of success, however, did not deter others from developing PoS blockchains.
BitShares was, until recently, the most popular PoS blockchain project. It uses a modified form called “delegated proof of stake” or DPoS. The owners of the BitShares cryptocurrency, the BTS, don’t get to control block creation directly. Instead, they delegate that right to people who have put a little extra skin in the game.
These “witnesses” post a small amount of BTS as a bond obligating them to process blocks honestly and quickly. If they fail to do so, the witnesses would lose their coins and BTS-holders would vote them out.
One of the advantages to the BitShares delegated approach is transaction speeds. A few months ago, the BitShares blockchain hit a new high of more than 17 transactions per second.
The newest PoS blockchain, EOS.IO, also has the highest CoinMarketCap ranking of all the PoS blockchains. Although the crypto media hasn’t been able to confirm it, reports are that EOS.IO hit as high as 5,000 transactions per second.
The advantages that PoS offers even has Ethereum’s developers working on a PoS algorithm. Vitalik Buterin, one of the blockchain’s creators, observed that maintaining a PoW cryptocurrency with the market cap of gold would cost society “about the same as the cost of maintaining the Russian military.”
As with everything else in crypto land, you will hear advocates for PoW or PoS claim that their favorite consensus algorithm is the best. PoS, especially in its delegated form, certainly has issues with centralization but compensates for that with transaction speeds and low environmental impact. PoW, for all of its weaknesses, is the only way to have a truly decentralized cryptocurrency.
It isn’t a choice of Proof of Work Vs. Proof of Stake. Both consensus algorithms have their place in our crypto future. It’s just a question of choosing the approach that’s best for the task at hand.