Proof-of-Work vs Proof-of-Stake
Consensus is a general agreement among individuals, like agreeing on which restaurant to go to for dinner among a group of friends. Reaching a consensus among a blockchain’s participants is a fundamentally serious business as it is run by distributed individuals. Proof-of-Work (PoW) and Proof-of-Stake (PoS) are two types of consensus mechanisms. Before diving into them, let’s take a flash review of the anatomy of a blockchain.
A blockchain is a distributed ledger that is shared among the nodes inside the network. It consists of a string of blocks linked chronologically to one another, like book pages. A block is created by the miners or validators and holds batches of valid transactions. A new block has the cryptographic hash reference to the previous block. The blockchain advances with the newly added blocks. Every blockchain has its own mechanism to decide how the block is produced, who can produce the blocks, what determines the true state of the network, etc. These things are specified in the consensus mechanism. PoW and PoS are two distinct consensus mechanisms used by the biggest market cap blockchains.
PoW: how does it work?
In PoW, miners compete to solve a cryptographic puzzle using computational power to mine the next block. Solving the puzzle involves finding a valid cryptographic hash for the block that meets specific criteria. Miners compete to be the first to get the correct hash. This process doesn’t require any particular skills but is achieved through brute force, i.e. trying one number after another to get to the valid one. You can think of this process as winning a lottery ticket. You need to be lucky, and the more tickets and the more quickly you buy, the greater your chances of winning. In mining, the probability of solving the puzzle can be improved by deploying more computational power.
The puzzles are hard to solve, but it is easy for the network to verify the correct solution. When a correct answer is found, the winning miner broadcasts it to the network for other miners to verify its validity. If the answer is valid, the block gets added to the blockchain. The winning miner gets compensated with the block reward.
Examples of PoW blockchains: Bitcoin, Ethereum, Dogecoin, Litecoin
PoS: how does it work?
PoS does not rely on miners competing with each other to solve the puzzles. Instead, PoS replaces the computational power with the currency power, the “stake”. And the ability to validate the transactions and add new blocks depends on a set of variables determined by the network’s consensus protocol. Usually, the protocol applies an algorithm to pseudo-randomly select a node to propose the next block. The selected node is responsible for verifying the validity of the transactions within the block, signing it, and proposing it to the network for validation. The block producer gets rewards.
The PoS network is run by the validators who are required to stake a certain amount of the network’s native cryptocurrency. The chances of being selected to produce the next block are correlated to the amount of stakes a validator controls but not only. Otherwise, it would be purely “the rich get richer”. The consensus protocol takes into account other factors to incentivize decentralization and ensure the network’s security and uptime.
Examples of PoS blockchains: Polkadot, Cardano, Avalanche, Solana
PoW vs PoS
PoW and PoS differentiate primarily in how the blocks are produced. PoW uses computation and electricity power to solve puzzles. In contrast, PoS uses the stake to secure and advance the network. It also consumes computation power but way much less than PoW. We can fairly say that PoS is much more energy-efficient than PoW.
Concerning the barrier to entry, PoW mining is higher for its fixed costs and operation: buying hardwares, configuring them, running the operations, and paying electricity bills. PoS, on the other hand, requires coins and a computer to run a validator node. People can participate in staking by delegating their stakes to the validators. From a user’s perspective, staking is much more accessible than mining. Though some mining projects provide access for retail users to participate in mining by investing money, they are not as diffused as staking.
An ideal blockchain should be
· secured and resistant to attacks and censorship;
· has a good level of decentralization, minimizing the power of a central entity;
· scalable to support the network’s transactions and the functioning of applications built on it.
These aspects form the blockchain’s trilemma. It is nearly impossible to get all of the three. PoW and PoS have their edges and weakness in each of the three aspects.
Security
Security measures a blockchain network’s resistance to attacks. The most critical to tackling is the Sybil attack. Sybil attack happens when one or a small number of entities try to take over the network and gain the majority of influence by creating multiple accounts. In this case, they can attack the network by taking malicious actions such as reversing and censoring transactions, etc. A 51% attack is such a kind, meaning the small number of bad actors control more than 50% of the entire network’s hash power.
PoW’s Sybil resistance lies in the need of intensive computational power and electrical energy. Bad actors need higher computational power to win over the collective force of the honest miners in the network. This is extremely expensive, and the cost of an attack can be higher than the profits to earn, largely disincentivizing the bad behaviours.
Making a 51% attack on Bitcoin costs $8.6B for hardware and $19.8M for electricity per day!* If you are concerned about an extreme case for Bitcoin when a national state controls 51% of hashrate and attacks the network, here is Andreas Antonopoulos’s response:
PoS’s Sybil resistance depends on the honest validators’ collective power to remove attackers from the network. Some PoS blockchains apply a “penalty” to punish the bad actors by slashing (destroying) their stakes. These measures provide a defence against a 51% attack. Vitalik has pointed out that the cost to attack a PoS network becomes asymmetrically expensive for the attackers after each round since the attacks’ stakes get slashed. They need to buy back the coins for the next attack. Thus the attacks become significantly expensive should they continue. He also argued that PoS is easier to recover from attacks because it does not need a hard fork to retake network control. While PoW is under a 51% attack, a hard fork is required to continue the network. **
It is worth mentioning that PoS blockchains that use BFT-style (Byzantine Fault Tolerant) consensus reduce the Fault-Tolerance stake threshold to 33%. Anyone that can accumulate more than 33% of the total value staked can attack the network. Solana, Algorand, and Avalanche are examples that fall into the 33% category.
DDoS attack is another potential threat to the security of blockchain. DDoS is short for Distributed Denial of Services. The attack consists of a malicious attempt to halt a network by spamming and flooding a large sum of spam transactions into it. The more decentralized and the more hash rate there are in a network, the more resistant it is to such an attack. In this respect, PoW and PoS can have the same potential to get good resistance to a DDoS attack. Bitcoin and Ethereum are very resistant in this regard; Cardano has a transaction fee design that makes DDoS attacks extremely expensive to execute. Solana, however, has suffered DDoS attacks, which led to a network down.
Decentralization
PoW incentivizes a constant hunt for locations where the electricity cost is cheaper, thus distributing the mining operations in diversified geographical areas globally. Concerns argue that individual and small miners will have difficulty staying competitive, leading to a centralization of mining towards big players. However, it is worth noting that the mining pool’s hash power isn’t necessarily owned by the mining pool itself. Small miners can participate in mining pools to combine the hash rate with other miners and share the rewards. And miners can switch mining pools easily by routing their hash rate to a different pool. They can stop contributing power to pools that show signs of wrongdoing. This reduces the potential risk of big mining pools attacking the network.
PoS is more vulnerable to centralization than PoW for its power of stakes. The proverb “If the problem can be solved by money, it’s not a problem” speaks for PoS. Buying coins for greater control is easier than investing heavily upfront in mining hardware and managing the hassle operation. Staking is practically using the current coins to get more coins, the more coins in staking the more rewards will be. This creates a positive feedback loop for “the rich to get richer”. And in BFT-style PoS blockchains, attackers need only 33% of the network’s total stake to attack, making them even less decentralized.
Scalability
PoW consumes energy to produce the blocks, and the transaction validation takes longer than PoS because of the mining competition. PoS does not consume energy for block producing and is more efficient. Because PoS chains select the node that creates the new block, which is not “work” dependent like PoW. In this regard, PoS is superior to PoW in scalability. We can also see it from the richness of ecosystems from PoS chains. Ethereum is transiting from PoW to PoS to make it more secure, less energy-intensive, and better for implementing new scaling solutions.
Conclusion
PoW and PoS are two consensus mechanisms used by the most adopted blockchains. They differ mainly in how the blocks are produced. There is no absolute superiority of one over the other. One certain fact is that PoS consumes much lower computational power and energy than PoW. In tackling the blockchain trilemma, both have their inherent strength and defence system, but also vulnerabilities. Among equally decentralized PoW and PoS chains, PoW could mean a higher level of security and resistance against attacks. Because attacking a PoW chain requires an upfront investment in hardware and mining operations. However, PoS can be easier to recover from the attacks than PoW. It is reasonable to argue that PoW wins PoS over decentralization in their inherent design. PoS allows acquiring “stakes” by money is an easier-to-achieve threat to decentralization. As of today, PoS is better at scalability because its block-producing process is more energy and time efficient. Reaching a reasonable trade-off is essential for projects that want to choose a type of network to build on.
Reference
* Kraken Intelligence report https://kraken.docsend.com/view/58b6xidjxk44xedc