Proof of Work (POW) vs. Proof of Stake (PoS) – A Comparison Of Two Blockchain Consensus Algorithms
The proof of work (POW) consensus algorithm is the most commonly used in the blockchain technology. Major Cryptocurrencies such as Bitcoin and Ethereum, the two most famous cryptocurrencies, use it. However, Ethereum, the underlying protocol of Ether, has recently tried to switch to the proof of stake (PoS) algorithm as part of their development roadmap. This will be a high significance project, and the crypto enthusiasts are eagerly debating the Proof of Work (POW) vs. Proof of Stake (PoS) comparison.
The Importance Of Blockchain Consensus
The two most important promises of blockchain are decentralization and immutable record. It’s a distributed database that the computers on the network, called ‘nodes,’ maintain in a shared manner. All nodes are complete ledgers, i.e., they have the entire transaction history in the blockchain. Hence the blockchain technology is also called ‘distributed ledger network’ (DLT). The network can’t be destroyed by taking out any central server.
Block records, called ‘blocks,’ are linked via a protocol program, and no existing block can be deleted or modified. Adding a new block is the only way to update the blockchain, and any node can do so without any central authority.
If a node disregards the predefined standards and creates a block, the other nodes will ignore it. However, if the non-compliant node continues to create blocks in contravention of the standards and a few other nodes also start creating blocks on top of the non-compliant blocks, then a dispute will arise in the community. The community can choose a hard fork and take away the network’s state before the dispute arose; however, frequent hard forks impact its stability. A consensus mechanism is needed to prevent such non-compliant nodes from causing frequent hard forks.
There can also be malicious nodes overpowering the other network nodes using the ‘distributed denial of service’ (DDoS) attack. Such nodes can trigger false transactions, e.g., ‘double-spend,’ i.e., spending the same cryptocurrency twice. The consensus mechanism is required to guard against this.
What is the POW algorithm?
Cynthia Dwork and Moni Naor had first conceptualized POW in 1993, although Markus Jakobsson had given the name in 1999. Bitcoin is the most famous implementation of POW, and we will use it to explain the concept.
Transactions in the Bitcoin blockchain are grouped in a memory pool called ‘mempool’ while a block is created every 10 minutes. Every transaction in mempool needs verification, and ‘miners’ do it. The transaction verification process is called ‘mining.’
The Bitcoin user requesting the transaction provides the transaction data to the miner, who then proceeds to verify the transaction and includes it in the next available block. However, to include the transaction in the next block, the miner needs to know the cryptographic hash value of the last recorded block, and that’s hidden from everyone. This hash value must be referenced for creating a new block.
To find the last block’s hash, the miner must try one number after another to show brute computing power, and no skills are needed. The miners are rewarded with a fraction of the Bitcoin, and hence it’s a competitive process. The successful miner is the one who beats everyone else in this game and solves this massive mathematical puzzle by using immense computing power. After finding the last recorded block’s hash, the miner announces it to the other nodes to verify and create a new block with the mempool post verification transactions.
The cryptographic puzzle solved by the miner is asymmetric. It’s moderately hard for the miner, but the other nodes in the network can very easily see the evidence of the massive number-crunching done. Over time the miners find the puzzle easier, and the block generation time reduces from 10 minutes. Hence, the puzzle is revised every 14 days to make it more complex. That effectively means more computing power will be needed henceforth.
Carrying out a DDoS attack by capturing 51% of the total computing power in this network is too expensive, and the hacker will end up spending more than he can make off with. Hence POW makes blockchain very secure.
However, this high security comes at a high cost. The ever-increasing computing power of the nodes requires more electrical energy ever, e.g., before the end of 2018, Bitcoin mining operations will consume more energy in Iceland than the country’s total domestic energy consumption. Any tangible asset doesn’t back Bitcoin, and such a strain on the digital currency environment attracts negative media coverage. Also, the involvement of all nodes in the transaction validation process impacts the scalability and transaction throughput.
Besides, it’s hard for the individual miners to continuously upgrade their hardware to solve more complex mathematical puzzles and foot the increasing electricity bill. Hence there is increasing centralization of mining with large organized mining rigs dominating the scene. Such indirect centralization is against blockchain’s core principle of decentralization.
How is the PoS algorithm different?
In the PoS algorithm, nodes decide to stake their own cryptocurrencies for transaction validation. They are called ‘stakers.’ The larger the stake and the longer the stake duration, the better the staker to get transaction validation responsibility.
All cryptocurrencies in this network are already created, and there’s no mining. This eliminates the need to solve a complex cryptographic puzzle. The continuous upgrade of hardware and soaring energy costs are eliminated, too. The transaction validation process is called ‘forging.’
Also, there isn’t a need for the entire network to be involved in the transaction validation process, which improves scalability. PoS allows another technology solution to be implemented, and it’s called ‘sharding.’ Originally a concept from database management, where it means storing different partitions of the database in separate server instance for higher efficiency, in blockchain sharding means storing horizontal portions of the network in separate groups of nodes. Since no node can see the entire network, sharding can’t be implemented in conjunction with the POW algorithm, and PoS is needed with separate stakers for separate shards.
POW vs. PoS: which is better?
POW is well-tested and used in many cryptocurrency projects. DDoS attacks on a blockchain employing this algorithm are impossible with today’s computing technology. However, the high energy cost, increased strain on the environment, associated adverse media coverage, increasing centralization of mining operations, and low transaction throughput will likely make it non-viable in the long run. Communities are increasingly concerned about Bitcoin mining’s high energy costs, and China is officially banning all such operations.
The PoS algorithm provides for a more scalable blockchain with higher transaction throughput, and a few projects have adopted it already, e.g., DASH cryptocurrency. However, it’s less secure than the completely decentralized POW algorithm.
It’s possible to buy a majority of the coins in the network, become the staker of choice, and validate wrong transactions as part of an attack. However, the market economy has a natural safety valve because the coin price will rise significantly when someone tries to buy such a massive amount of coins, making the attackers’ job far more difficult.
It’s also possible for a staker to turn rogue and validate the wrong transactions. Ethereum project, as part of their planned transition to PoS, has designed the ‘Casper’ protocol where such rogue stakers will be punished by confiscating their staked cryptocurrencies and barring them from staking ever again.