The recent attack on the Steem blockchain have shown a major flaw in DPOS system. I thought this would be a good time to go over some blockchain consensus algorithms to understand the pros and cons for each. There are actually 14 consensus algorithms that I know of but since I will end up writing a book to explain all of them, I will focus on the most popular POW, POS, and DPOS systems for this article.
What are Blockchain Consensus Algorithms Anyways?
A decentralized blockchain network consists of thousands of nodes which keeps track of all the transactions that goes on the network. All these nodes need to go by certain principles to reach a collective agreement. A common consensus algorithm will allow the network of nodes to come to a consensus and move on with a resolution if there is a fault (like double spending). There are lots of discussion on which is the best Blockchain algorithm. There are pros and cons for each one so lets take a look at some of them.
Proof of Work (POW)
Proof of Work (PoW) Blockchain Consensus Algorithm, which was first used on Bitcoin network in 2009, is based on Hal Finney’s Reusable Proof of work (RPoW) idea established in 1999. Finney’s idea was that just as value of gold coin is underpinned by the value of raw gold needed to make it, RPoW token’s value is guaranteed by the real world resources (electricity and hardware) required to ‘mint’ it. POW system in Bitcoin goes further and introduced decentralized P2P protocol for tracking transfer of coins and to protect the network from double spending rather than hardware trusted computing function used by RPoW.
So, basically, the current PoW system is maintained by network of mining nodes that uses electricity and hardware to solve complex cryptographic problems. This process of mining proves that the work was put into the network by the miners. Therefore, rewarding the miners with newly ‘minted’ tokens and transaction fees of that specific block mined. This is a great way to incentivize more people to run a mining node, hopefully keeping the network decentralized.
This effort to maintain the decentralization of the blockchain is considered secure and reliable for fault tolerance. In order to take over this consensus model, the attacker will need to take over more than half of the mining power. This is called a 51% attack and it would be very expensive to pull off due to energy and hardware that would be required for majority control of the mining power. Although there has been successful 51% attacks on smaller PoW networks (Verge, GameCredits, Bitcoin Gold, etc), there has been no attacks on large PoW networks like Bitcoin and Monero.
Due to the amount of energy and specialized equipment(ASICs) that is required for mining, PoW network is becoming more centralized as time goes on. The introduction of Application Specific Integrated Circuit (ASIC) miners made it unprofitable to mine most PoW coins without them. Also, due to the huge amount of energy that is required for PoW mining, the mining activities are becoming more centralized to an area with cheaper electricity. These issues make the network more susceptible to a 51% attack.
It’s the same situation as gold and gold mining. The marginal cost of gold mining tends to stay near the price of gold. Gold mining is a waste, but that waste is far less than the utility of having gold available as a medium of exchange.
I think the case will be the same for Bitcoin. The utility of the exchanges made possible by Bitcoin will far exceed the cost of electricity used. Therefore, not having Bitcoin would be the net waste. -Satoshi Nakamoto
Proof of Stake (PoS)
In Proof of Stake (PoS) Blockchain Consensus Algorithm, there are no miners. Instead, a network of validators take turns proposing and voting on the next block. The weight of the validator’s vote depends on how many tokens they are staking as a validator. New blocks will be created proportional to the number of coins staked. This addresses the energy and hardware concern we had with PoW mining. Instead of having external investments via energy and hardware like the PoW, PoS only requires internal investment of staking the cryptocurrency itself.
This does not make the PoS system completely immune to an attack though. It is still possible to attack the blockchain by acquiring at least 51% of the total existing token. The validator in the PoS blockchain is discouraged from launching a 51% attack because of the risk of depreciating his own staked tokens from the attack.
Also, it can be said that this is less decentralized than the PoW system because only a handful of validators gets to participate in the staking on the network. PoS blockchains usually have a requirement for minimum tokens need to be staked to participate in the validation of the network. For example, the Ethereum 2.0 estimated to be launched this year will require minimum of 32Eth to be staked. At todays Ethereum price, this is $7360, a huge barrier to entry.
The one-sentence philosophy of proof of stake is thus not security comes from burning energy, but rather security comes from putting up economic value-at-loss. -Vitalik Buterin
Decentralized Proof of Stake (DPoS)
Decentralized Proof of Stake allows all token holders to vote on a small number of delegates or witnesses who will secure the network on their behalf. The weight of the vote is dependent on number of the token each user holds. This system is extremely reliant on the voting mechanism and because of this, some people would even call it a Democratic Proof of Stake. The delegates are responsible for achieving consensus during the generation and validation of new blocks. Because there are small number of delegates acting as master nodes, the DPoS network can operate very fast and efficiently.
Users are supposed to take in account delegates reputation when voting and are supposed to vote out bad actors. This doesn’t always happen because not all users are paying attention to what is going on in the blockchain. Voting also has the following problems as outlined by Vitalik Buterin:
- Low voter participation (the DAO carbonvote, the current EIP186 carbonvote, the DAO proposal votes, and even Bitshares DPOS votes in 2014 all had <10% participation)
- Game-theoretic tragedy-of-the-commons vulnerabilities: because each voter only has a tiny chance of influencing the result, their incentive to vote correctly is thousands of times lower than the socially optimal incentive. This means that situations like everyone putting their coins on exchanges and exchanges voting on users’ behalf, with users not really caring how exchanges vote with their money, are likely to happen.
- Coin holder interests are not perfectly aligned with user interests, and so proposals that increase coin prices at the expense of making the system useful may get implemented.
Interestingly enough, 2nd bullet point is what happened recently with the Steem blockchain. Steem tokens being held in exchanges were used to vote in new delegates into the top 20 that controls the blockchain.
In short, the DPoS system basically gives up some decentralization for higher transaction speed and energy efficiency.
You require a ⅔ majority to have an honest system. Originally BitShares started with 100. There’s not enough oversight of who those 100 people are because there’s not enough bandwidth of voters’ attention to decide. Bringing it down to 21 reduces the cost of the system. The network has to pay each person that runs a full node. – Dan Larimer
To summarize the 3 Blockchain Consensus Algorithms I have covered in this article,
- PoW is the most decentralized and the DPoS is the most centralized.
- DPoS has the fastest transaction speed and PoW is the slowest.
- PoW is the most energy hungry and DPoS is the most energy efficient.
- PoS is the happy middle for all these points.
I think that these 3 algorithms all have it’s place. I think that due to the decentralization, PoW is best suited for store of value and high value monetary transactions. DPoS is best suited for DApps and communication platforms like Steem where there are thousands of transactions going on every second and the transaction costs need to be close to zero. PoS is best suited for mid value transactions like Smart Contracts and Defi applications.