One of the most important aspects of any blockchain network is the consensus algorithm that is used to validate transactions. In centralized systems like Visa and MasterCard, transactions are verified by a host of authorities. On the other hand, in a decentralized system like blockchain, the network nodes need a set of rules to help them arrive at consensus regarding the authenticity of new transactions. This is where the consensus algorithm comes in.
The consensus algorithm is directly responsible for the 3 critical aspects of blockchain technology – scalability, security and decentralization. The time taken to validate new blocks of transactions directly affects the network scalability. The robustness of the network to attacks also depends on how sophisticated the consensus algorithm it. And of course, the consensus algorithm also dictates how much say the nodes will have in network governance.
A lot of research directed towards solving the Blockchain Trilemma has gone into the fine-tuning of the consensus algorithm. This has given rise to a variety of algorithms. The most common implementations are Proof-of-Work and Proof-of-Stake; other variants are usually derivatives or hybrids of these two.
PoW, the Original Choice
Proof-of-Work (PoW) is the backbone of the Bitcoin blockchain, but it has been in existence even before the idea of Bitcoin came into existence. In fact, the original Bitcoin whitepaper by Satoshi Nakamoto refers to HashCash‘s use of PoW. Apart from Bitcoin, PoW is the choice of consensus algorithm for some of the largest market cap cryptocurrencies out there today, such as Ethereum, LiteCoin and Bitcoin Cash.
In PoW, nodes (called miners) have to solve complex cryptographic puzzles to validate transactions and add new blocks to the blockchain. This process is known as mining. Solving this puzzle requires computation power, and in order to compensate for this expenditure, the miner who solves the puzzle first is rewarded with newly mined Bitcoin. As the price of Bitcoin has seen a meteoric rise over the years, the difficulty of solving this puzzle has increased significantly, accompanied by a reduction in the amount of Bitcoins rewarded for mining new blocks.
Now Bitcoin was originally conceptualized to be a store of value, a form of ‘digital gold’. Nakamoto kept the supply of Bitcoin limited to 21 million, to be mined gradually over the years. This mechanism was put in place to ensure that there is no inflation in Bitcoin’s value due to an endless supply coins, and its price is decided only by the market supply-demand mechanism.
And what about the increasing puzzle solving difficulty? This puzzle is implemented in such a manner that miners can only arrive at its solution by making a guess and checking if it turns out to be a legitimate solution. The Bitcoin protocol adjusts the difficulty of solving this puzzle with time, by increasing the range of possible solutions to the puzzle.
This has increased the processing power (or hash power) required to mine Bitcoin at alarming rate. While a decade ago you could mine Bitcoin with any consumer grade CPU, specially manufactured ASIC processors are needed today. In fact, this article suggests that the total power involved in the mining of Bitcoin is as high as the total energy consumption of the Czech Republic!
Bitcoin's energy consumption has been a matter of great concern
Curiously, the insane amount of power required to keep the Bitcoin blockchain alive is also what keeps the network secure. Bitcoin suffers from a vulnerability called the 51% attack. If a single entity can control 51% of the total hash power of the network, it can manipulate the entire network.
Fortunately, given the magnitude of the Bitcoin network today, acumulating 51% of its hash power would require a gargantuan amount of money. Moreover, any such attack would automatically reduce the demand of Bitcoin in the market and drive down its price. Simply put, there is no financial incentive in launching a 51% attack.
So we have a dilemma here – the high mining cost increases the power consumption, but also guarantees that the network remains safe. Moreover, the increasing puzzle solving difficulty has led to staggeringly high Bitcoin confirmation times today. If only there were an alternative way of securing the blockchain!
PoS, the Environment-Friendly Alternative
Proof-of-Stake (PoS) was developed by Sunny King in 2011 as a low-power and faster alternative to PoW. Although Sunny King is a pseudonym, it belongs to a well-known albeit reclusive individual in the crypto circle (unlike Satoshi Nakamoto). Peercoin became the first digital currency to adopt PoS in 2012. Today, Neo and Cardano are some of the well-known cryptocurrencies that use PoS. Even Ethereum developers have been working on a transition to PoS from PoW through the Casper upgrade.
In PoS, nodes (called minters or validators) have to deposit (or stake) coins to the network. Unlike PoW, no complex cryptographic puzzles have to be solved to validate new blocks. Nodes earn minting fees when new blocks are created, but instead of new coins being created as rewards, validators are usually rewarded through transaction fees. The minting fee earned is also proportional to the total amount of coins staked by a node.
PoS uses a pseudo-random election process to choose the validator of the next block, which depends on the quantity of tokens each node has staked. In order to prevent nodes with large stakes from dominating the network, techniques such as Randomized Block Selection and Coin Age based Selection are usually adopted by the algorithm.
Depositing stakes to the network makes the nodes stakeholders of the network. It’s generally believed that greater a node’s stake, more the likelihood that the node would want the network to remain secure. In order to launch a 51% attack, a malicious node would require control of 51% of the entire circulating supply, an expensive proposition just like PoW. Moreover, if any node is found to behave in a fraudulent manner, all its staked coins are confiscated by the network, providing further incentive to the nodes to stick to the rule book.
PoS is much more energy efficient and decentralized compared to PoW. Since no special hardware is required to become a validator, anyone with a simple laptop can join the network as a node. Greater decentralization arguably leads to greater security.
However, just as every coin has two sides, greater decentralization also brings along performance issues. The nodes in a PoS network have different hardware metrics, which essentially makes the network as good as its weakest node. Block validation time can be higher for nodes using outdated hardware, resulting in an overall increase in confirmation times under heavy traffic.
Anyone who has tried to participate in a Neo ICO would know what I’m talking about here! While this hadn’t been a problem when PoS was first conceptualized, the speed and reliability that Web3.0 DApps need today make PoS in its native form an incompetent consensus algorithm.
The PoS Variants
Efforts have been made by different blockchain projects to address the limitations that conventional PoS suffers from, by making modifications in the protocol while retaining its core essence. Daniel Larimer came up with Delegated Proof-of-Stake (DPoS) in 2014, which was first adopted by BitShares. Later on, other cryptocurrencies like Lisk and EOS have also gone on to use DPoS.
In DPoS, nodes vote for a fixed number of delegates (or witnesses), who participate in the consensus process and secure the network. The voting power of each node (or stakeholder) is proportional to the number of coins it possesses. The voting rewards are usually collected by the delegates, and proportionally shared with their respective electors. If an elected node engages in fraudulent behavior, it is immediately expelled and replaced by another.
DPoS divides the duties between nodes and delegates. Since ordinary nodes only take part in the block validator election process, transaction times depend on the performance of the delegates alone and not on ordinary nodes. Delegates are motivated to remain honest or they get voted out, which supposedly adds to overall network security.
Another popular PoS variant is Leased Proof-of-Stake (LPoS), which was developed in 2017. LPoS allows nodes to lease their coins to mining nodes, which validate blocks and earn rewards. Mining nodes need to stake a minimum number of coins. Leased coins are locked in the user’s account, and are not physically transferred to the miner. As in other cases, greater the amount of coins leased to a miner, higher is its chance of earning block rewards. Waves was the first project which used LPoS.
Since miners are required to be online 24x7, every user might not be interested in running a mining node. By allowing users to lease their coins for mining, more nodes can be involved in the overall network governance. This increases the degree of network decentralization, although this also entails the risk of formation of mining pools.
Unfortunately, none of the derivatives of PoS have gained widespread popularity, and are only used by a handful of blockchain projects. The incremental changes in the native PoS protocol have not made any significant difference to blockchain network performance.
Supernode Proof-of-Stake (SPoS) is the latest in line when it comes to PoS-based consensus algorithms. It is the brainchild of Sunny King, the creator of PoS himself, and was announced to the public in Jan, 2019. While it retains the core principles of PoS (and some of its derivatives), what sets SPoS apart is that it focusses more on hardware upgrade than on enhancements in the protocol.
SPoS only allows supernodes to participate in the consensus process. These supernodes have higher memory, bandwidth and processing power compared to ordinary nodes, ensuring that the network performance does not get restricted by the limitations of individual nodes. The SPoS protocol itself demands that the supernode hardware be upgraded as and when blockchain performance demands so. By removing the dependence on ordinary nodes, SPoS claims that constant network performance can be guaranteed even under heavy traffic. V SYSTEMS is the first project which has implemented SPoS.
Ordinary nodes can still participate in the network governance by leasing their coins to these supernodes, which distribute the minting rewards proportionately among the actual stake owners. Coins can be leased without actually giving up on their ownership through the technique of Cold Staking.
Each user has 2 keys - the minting key, which remains online and allows the minter to sign the newly block minted; and the spending key, which actually ‘owns’ the stake, and is kept offline safely. The spending key allows nodes to lease their coins without relinquishing ownership. Stake owners can also transfer or spend their staked coins whenever they want to, encouraging more nodes to stake coins. In principle, this is similar to LPoS, although LPoS doesn’t put any restriction on the choice of hardware for the mining nodes.
SPoS also supports a new coin staking mechanism called Staking 2.0. In ordinary PoS, by staking coins to the network, nodes earn the network’s own native coin as rewards (for example, staking Neo makes users earn NeoGas). In Staking 2.0, not only will the supernodes earn the native coin of the blockchain, but all the tokens which the blockchain supports (for example, staking VSYS will make users earn both VSYS and IPX as of now). The supernodes are then expected to distribute them all among the stake owners. This is another step aimed at encouraging more nodes to stake coins and participate in network governance.
Concerns about Decentralization
Inspite of SPoS’ attempts at greater decentralization through Staking2.0, there are concerns about the centralizing tendencies inherently present. As compared to Bitcoin or Ethereum which have thousands of miner nodes worldwide taking part in consensus, SPoS’ governance is commandeered by a handful of supernodes.
Stake owners would naturally tend to lease coins to supernodes with a higher leasing rate. This would lead to the tendency to create minting pools, and if a supernode ends up assimilating the majority of the staked coins, it can compromise the entire network security.
SPoS tries to counter this by maintaining a balance between the lease rates of all supernodes, by providing them with equal minting rights. With more coins being leased, a supernode’s lease rate would automatically drop, ensuring that a balance is maintained and no supernode ends up becoming a dominant player in the ecosystem.
Unfortunately, this still doesn’t prevent rogue supernodes from ganging up and trying to take over the network. I had a chance to put forth this doubt to Jacob Gadikian, a blockchain technologist who has been part of the SPoS development team.
As per Jacob, in order to launch such an attack, the supernode(s) would first need to acquire a sufficient quantity of stake. They can earn it by either purchasing the coins on exchanges, or by using social marketing skills to convince users to lease coins to them. In the first case, buying such a vast quantity of coins would drive up the coin’s price, making such an attack financially impractical (similar to the arguement for Bitcoin). And in the second case, they would no longer be rouge supernodes, but rather ecosystem partners chosen by the stakeholders themselves.
“Basically, stake is expensive… and it doesn’t matter if it’s acquired socially, or acquired with money. In the end, attacking the SPoS platform is expensive, either socially or financially.”
PoS was an attempt to provide the same security and decentralization that PoW does, but at a lesser cost. SPoS further tries to improve upon the network performance, by shifting the focus from algorithm update to hardware upgrade. In the process, they seem to have gone softer on the decentralization aspect. After all, no project has been truly able to solve the Blockchain Trilemma yet.
Having said that, even PoW is no guarantee against network attacks. Earlier this year, one of the top-20 market cap coins ETC (Ethereum Classic) fell prey to a 51% attack. It continued for 3 days, leading to losses to the tune of $1.1 million. SPoS is taking a different approach compared to other PoS variants, and it’s still teething days for it. Only after a sufficient amount of time has elapsed and a decent number of projects have adopted SPoS, would we be in a position to say whether King’s second child has been able to surpass his firstborn.