May 21, 2018
How Blockchains Achieve Consensus: Proof of Work vs. Proof of Stake
Posted by Jeremy Nau
The use cases for blockchain are now being recognized as a truly viable option for future technologies. This stems from its inherent characteristics of immutability, security, traceability, anonymity and trust. Blockchain maintains these characteristics by achieving “consensus,” meaning agreement between all users or nodes within the network.
How does a blockchain achieve this critical consensus? There are multiple methods, but in this post we will dive into the two most explored and popular mechanisms currently in use: Proof of Work (PoW) and Proof of Stake (PoS). Here are the pros and cons of each.
- Proof of Work
PoW was the first consensus mechanism applied to cryptocurrencies. It is the governing mechanism for Bitcoin, the largest (in terms of market capitalization) and oldest cryptocurrency, created by the mysterious “Satoshi Nakamoto.” Other examples of coins or tokens using PoW include Ethereum (it is moving to PoS in the future), Monero, Litecoin and Dogecoin.
Within a PoW model, all participants maintain network security by “mining” (solving and verifying mathematical puzzles for) the next block of transactions initiated or left unverified from the previous block created. Whoever finds the answer to the puzzle first gets to connect the next block to the blockchain, and thus receives the reward for doing so (currently 12.5 Bitcoins plus transaction fees).
The answer is a nonce/solution hash pair―basically, using the inputs to find a number that starts with many zeros. Think of it as a very hard algebra problem, and you’re solving for x. The puzzle is structured so that it is very hard to solve initially, but is very easy for other users in the network to verify. A new block is created and validated by the network every 10 minutes, adding to the previous block before it. The “lower” (older) the block is in the blockchain (known as “block height”), the “safer” (more unchangeable) it becomes.
- Immutability: The chain can’t be changed once it’s created. (Forking, in which a blockchain splits in two, is outside the scope of this article.)
- Security: PoW utilizes private and public keys for verification of message/transaction initiators, essentially guaranteeing the original message was sent from the accurate party.
- Effectiveness: PoW has been proven effective over the longest time horizon (blockchain is still relatively young).
- Fairness: It gives everyone a fair (in theory) chance to mine, in accordance with their ratio of total hashing power vs. the network total.
- Extremely inefficient energy use: Computers use large amounts of energy to find an answer (nonce) but test millions of incorrect solutions in the process.
- Vulnerable to a “51% attack” (like most other mechanisms): This means that if more than 51% of hashing power is controlled by “dishonest” participants, they could fork their own version of their compromised blockchain and validate their bunk or dishonest transactions in the process. It would be very difficult and expensive to obtain 51% of the hash rate on the network, and there also would be minimal incentives to compromise the network you had so much invested in, but it is possible.
- Decentralized “centralization”: Mining pools combine or “pool” their hash power together to mine more coins in total. Six main pools control over 75% of Bitcoin’s network and could theoretically compromise it.
- Higher barrier to entry: The computer equipment required to mine can be very expensive.
- Proof of Stake
PoS is likely the most well-known and utilized consensus model after PoW. Coin/token examples include NEO, PIVX and the future state of Ethereum. PoS eliminates much of the energy inefficiency of a PoW model. There is no mining or validating of blocks via random mathematical hashing. Instead, nodes in a PoS model are attributed block-producing power based on the amount of coins they hold (their “stake”) in proportion to the total amount of coins in circulation.
There are multiple staking methods (chain-based, Byzantine fault tolerance-based, etc.), but the overarching idea is that owners of network coins stake their own coins as a form of confidence related to a block, and receive transaction fees for mined or validated blocks as the block height increases (blockchain lengthens).
Another key difference between PoW and PoS is how the miners or validators of a block are selected. In PoW, the competition to mine creates huge energy inefficiencies, but in PoS, the staking algorithm can choose the next block miner (typically in proportion to your staked coins) and/or validators on the network to confirm the block hashed by the chosen miner, thus drastically reducing energy costs.
There are many other variations of PoS and staking (coin age, nomination/validation, etc.), but the idea is usually similar to the strategy outlined above.
- Cost effective: No need for specialized mining hardware.
- Energy efficient: Excess hashing is not needed to mine.
- Decentralization: PoS decreases economies of scale for mining pools and allows for greater decentralization of mining validations for the network (as compared to PoW).
- Curbs inflation. The network does not need to issue new coins, as there is no need for mining rewards other than the network transaction fees, because PoS miners do not need to be reimbursed for high energy costs.
- Cheaper for users of the network: Because mining/validating is so much cheaper in PoS, these cost savings will trickle down to users of the network.
- Secure: Much like PoW, it would be very costly to get 51% of coins for a 51% attack. Also like PoW, PoS utilizes private and public keys for verification of message/transaction initiators.
- Scalability: Solutions like sharding (breaking up data to multiple tables) support scalability.
- Economic security: Validators are incentivized to act appropriately, since their coins are locked up as a stake in the network. In certain PoS models, validators also can have coins revoked if they act maliciously.
- Immutability: As in PoW, the chain can’t be changed once it’s created.
- Initial coin distribution: Since coins may not be created during the mining process but instead are created upon blockchain/contract creation, who receives and dictates the supply of the network coins/tokens? (Note: PoS can still issue coins during the block creation process, but it is not a necessity.)
- Rich get richer: Since coins are typically the basis for staking, the more coins you have staked (i.e. the richer you are), the more blocks you can mine, and thus get the associated transaction fees.
- Locking of coins: Staking locks out your coins from other uses, such as transactions on the network.
- Vulnerable to 51% attack: As with PoW, an attack is possible.
- Nothing at stake: A block miner or validator can sign two blocks vying for the same spot on the blockchain if there is no downside to signing each of them.
As blockchain technology is still in its relative infancy, more robust and incentive-aligned consensus mechanisms may come to fruition. For now, however, PoW and PoS are paving the way for the future of blockchains.
Don’t know much about blockchain and cryptocurrencies? Read our post – Blockchain and Cryptocurrencies: What You Need to Know.
Jeremy is a manager in Armanino’s Blockchain practice, with more than 4 years of experience performing compliance, internal and blockchain-technical audits. He has experience leading and participating in cryptocurrency/blockchain engagements for exchanges, crypto-startups, and stablecoins. Jeremy authors Armanino’s blockchain audit memos, and he has helped develop proprietary procedures to test digital assets for reliance during an audit.
A Certified Blockchain Professional and member of the Cryptocurrency Certification Consortium, Jeremy is also a Certified Public Accountant (CPA) and Certified Management Accoutant (CMA). He holds a Bachelor of Business Administration, Accounting from California State University, Chico.