@adlrocha - Forget About Work, Let's Stake the Consensus

The Fight of the Consensus

This week it has been impossible for me to find the time to work on my weekly publication, but I didn’t want to leave you, my dearest reader, without something to read with your Sunday morning coffee. So I decided to retrieve one more of my Medium articles for the newsletter. The design of consensus algorithms is a field of research within blockchain that fascinates me, and I am looking to extensively write about it in future publications. In the meantime, this article is short and to the point, the perfect introduction for the content yet to come. I hope you like it.

Reaching consensus in a trustless blockchain network is not an easy task, but don’t take me from granted and ask our friend Satoshi. He faced this problem while designing and implementing Bitcoin, how did he fix it? Proposing a proof-of-work (PoW) consensus algorithm, i.e. forcing nodes in the network, miners, to dedicate their hardware resources to fix a hard-mathematical problem.

The solver of this problem would be allowed to seal the next block in the chain, decide the order of transaction, and be consequently rewarded for its services helping to keep the network running.

After a decade operating on a production system such as Bitcoin, proof-of-work has been shown a solid consensus algorithm, widely accepted by the crypto community and almost impossible to attack. However, proof-of-work still poses certain drawbacks such as:

  • Waste of Energy. Miners are constantly trying to solve a hard-mathematical problem, even if they don’t end up being the ones rewarded for solving the block. All this computational power could have been used for more useful tasks such as discovering a new protein to cure cancer (who knows?).

  • Scalability. Proof-of-work’s operation makes it difficult to scale over the dozen transactions per second, something unacceptable for certain use cases.

  • Centralization. The increased difficulty in certain PoW-based blockchain platforms has resulted in the appearance of big mining pools owning a great majority of the computational power of the network, and increasing the likelihood of 51% attacks.

These drawbacks are the ones that made blockchain developers and researchers around the world to embark in the hard quest of designing brand new consensus algorithms.

As a result of this quest Proof-of-Stake was discovered. Proof-of-stake (PoS) is a more energy-efficient consensus algorithm compared to PoW. Instead of randomized block solving based on computational power, this algorithm bases the randomization on the number of tokens a network member is staking.

If a node wants to be eligible for solving the next block, it needs to stake a set of tokens in a wallet.

The bigger the amount someone stakes, the bigger the odds he has to be selected as the next verifier of a block of transactions. As with PoW, block verifiers are rewarded for their service.

Proof-of-stake increases decentralization, allows higher transaction throughputs and promotes decentralization. However, basic PoS algorithm still has some problems, e.g. the classic “the rich get richer and the poor stay poor”.

If you could afford a big bag of coins of a certain blockchain, the chances are higher that you will get rewarded if you stake and your holdings will increase through said staking — yet again increasing your chances for getting rewarded, and so on down the line.

Fortunately, smart variations of PoS have been proposed to enhance its vanilla version:

  • Delegated Proof-of-Stake (dPoS): In DPoS there is a fixed number of validators authorized to secure the network. Token holders instead of directly staking their tokens use them to vote for the next authorized node to validate the transaction. The validators with the most votes get to become delegates, validating transactions and collecting rewards for doing so. Platforms such as Lisk, Tron, Steem, Bitshares and EOS use variants of dPoS. I am not a big fan of this variant of PoS, as it reminds me greatly to Proof of Work mining pools.

  • Liquid Proof-of-Stake (lPoS): In LPoS delegation is optional. Token holders can delegate validation rights to other token holders without custody, i.e. they don’t lose the tokens from their wallets. In this PoS variant only the validator is penalized if an attack is detected in the chain. LPoS also offer voting rights, except that as a token holder you get to vote directly in the protocol amendments, and not only in who secures the network like in DPoS. Platforms such as Tezos use lPoS.

  • Bonded Proof-of-Stake (bPoS): BPoS is very similar to LPoS, delegation is optional, non-custodial, and token holders benefit from voting rights in protocol amendments. Although, there is a reason why it is called BPoS: in case of safety or liveness fault, a portion of the validators and delegators’ stake will be slashed. In LPoS, only the validator is at risk of slashing, while the delegator’s only risk is to miss on some rewards/interests in case its validator is dishonest or not efficient. BPoS has the advantage of providing a clear solution to the issue of staking ratios (similar to capital requirements) where some validators on LPoS protocols have to maintain if they do not want to become over-delegated and disappoint some of their delegators. While it solves this issue, it also means that delegators need to conduct extra due diligence before delegating and remain active in verifying the performance of their validator. BPos may be found in projects such as Cosmos.

  • Hybrid Proof-of-Stake (HPoS): Hybrid PoS/PoW is often referred to as a mix between Proof-of-Work and Proof-of-Stake. In HPoS miners produce new blocks via PoW, and PoS validators then vote on the validity of these. HPoS provides a superior deterrent to majority attacks by augmenting hashing power with stakeholder voting.

These are just some of the main representatives of PoS variants already implemented, nonetheless in the quest of finding the perfect PoW replacement, way more brand new consensus algorithms and PoS variants will appear in time, and if you don’t believe me just try to make a quick search about Wave’s Leased PoS, Tomochain PoS Voting, Dash’s Masternode staking or NEO’s Delegated Byzantine Fault Tolerance. We will have to stay tune to know the result of this quest. A set of consensus algorithms I personally want to go deeper into are Cardano’s Ouroboros, and Algorand’s PoS. Ouroboros is backed by years of academic research, and both are said to be elegant ways out to the blockchain trilemma (security v.s. decentralization v.s. performance). We’ll see.