Consensus Battles

Consensus Battles

This post provides argues that a hybrid approach to achieving “consensus” can combine elements of both a comparative view of Proof of Work and Proof of Stake. The post then provides a deeper look at Delegate Proof of Stake.

Readers may also be interested in reading Zane Witherspoon’s A Hitchhiker’s Guide to Consensus Algorithms, which was also published  in our Thought Leaders section.


Proof of Work or Proof of Stake? How About Both?

The debate between proof of work (PoW) and proof of stake (PoS) consensus models have been front and center on the cryptocurrency market for the last few years. The debate has been even more visible recently with all the controversy surrounding Ethereum’s performance issues and the uber-anticipated released of Casper. The PoW vs. PoS debate have rapidly contributed to improve the innovation in terms consensus protocols in distributed ledger architectures. While both sides of the debate have mostly driven by purist that passionately evangelize the advantages of one approach vs. the other, there is a third emergent trend in the crypto community that has been advocating for a Solomonic solution: combining PoW and PoS in a single governance-consensus model.

The Tragedy of the Commons vs. Nothing at Stake Problem

A lot has been written about PoW vs. PoS so I don’t plan to bore you repeating the same arguments. A good way to generalize the PoW vs. PoS argument is think about it as the friction between two major economic dilemmas: “the tragedy of the commons” and the “nothing at stake challenges”.

In PoW systems, miners are compensated for solving computational puzzles in the network. Miners aren’t able to cheat the system because it takes real-world resources to work out these solutions.

As a PoW network grows, the cost of mining will become significantly less lucrative when the block reward subsidy becomes negligible, and the reward consists (almost) entirely of transaction fees. The rationale behind this stems from an economic phenomenon known as the “tragedy of the commons”, which is a prevalent problem in the study of economics and game theory. In its most purist form, the tragedy of the commons describes a system in which participants have an opportunity to act selfishly, taking action to benefit themselves at the cost of harming their peers. A selfish rational agent will always take such action because she is interested only in her own well-being; but if everyone acts selfishly, everyone will be worse off than if everyone cooperates.

How is this relevant to PoW? Well, in a PoW network, rational miners will be encouraged to only process transactions that pay a high-fee so the cost of transaction can be manipulated by a small group of miners. What is even worse, miners can compromise the security of the entire PoW network by not validating transactions in order to avoid the computation fees.

In a Proof-of-Stake system, the coin holders get paid transaction fees for validating transactions. Therefore, Proof-of-Stake creates a clear and unambiguous economic incentive to hold coins for the long term. Proof of Stake isn’t about mining, it’s about validating, it happens by a miner putting up a stake, or locking up an amount of their coins, to verify a block of transactions. Each validator owns some stake in the network, that they bond. Bonding stake means you keep you coins in the network, and in some sense use it as collateral to vouch for a block.

PoS systems suffer from another economic challenge known as the “nothing at stake” problem. In a PoS network, there are only rewards, and no penalties, for validating transactions. As a result, participants in a transaction can start producing blocks on top of each other in a way that causes the network to never reach consensus.

Decred and the Emergence of Hybrid Consensus

A new wave of consensus models have been created to take advantage of the benefits of both PoW and PoS systems. Arguably, Dash is the most active cryptocurrency that uses a hybrid PoW-PoS approach. Another project that I like a lot in this space is Decred, which combines the benefits of PoW and PoS in a very clever lottery system.

In the Decred world, a transaction is first processed by PoW miners which create the blocks in the blockchain. After that, the stakeholders will use a PoS model to confirm if the block is indeed valid. They do so by buying voting tickets in a lottery system. Decred’s mantra can be summarized as “mining the transaction is hard but validating it is easy”.

Just like Decred, there are many other projects that are starting to combine the benefits of PoW and PoS systems. As blockchain evolves, it is likely that these hybrid models will find a way into mainstream applications that can benefit from the robustness of PoW architectures and the flexibility of PoS models.

Understanding Delegated Proof of Stake

The ideas behind delegated proof of stage (DPoS) can be traced back to a paper published by Dan Larimer in 2013 that explores some alternatives to address the limitations of the consensus models in PoW networks. The algorithm was originally designed to power Larimer’s work in BitShares and later perfected on Steem. Today, the protocol is powering some of the most innovative blockchain initiatives in the market including Larimer’s own EOS as well as Golos, Ark, Lisk, PeerPlays, Nano (formerly Raiblocks), and Tezos, Cosmos/Tendermint, and Cardano.

DPoS Basics

DPoS divides the consensus model in two fundamental parts: electing a group of block producers and scheduling production. Not everyone in a DPoS network can produce blocks to validate a transaction. In the DPoS world, participants who hold tokens are able to cast votes to elect block producers; votes are weighted by the voter’s stake, and the block producer candidates that receive the most votes are those who produce blocks. From that perspective, DPoS imitates many of the concept of governance models in corporate environments in which a group of people at certain level can decide who should perform a specific task and other group of people evaluates the result of the task.

Another useful way to think about DPoS is about the role that notaries and witnesses play during the signing of a contract. Neither notaries nor witnesses are part of the contract itself but they are relevant parties that can certify the legal validity of a document. In the DPoS world, you can think as stakeholders as notaries and block producers as witnesses.

Using DPoS consensus, the stakeholders can elect any number of witnesses to generate blocks which are, essentially, a group of transactions which update the state of the database. Each account is allowed one vote per share per witness, a process known as approval voting. The top N witnesses by total approval are selected. The number (N) of witnesses is defined such that at least 50% of voting stakeholders believe there is sufficient decentralization. When stakeholders expresses their desired number of witnesses, they must also vote for at least that many witnesses. A stakeholder cannot vote for more decentralization than witnesses for which they actually cast votes. Each time witnesses produce a block, they are paid for their services. Their pay rate is set by the stakeholders via their elected delegates (to be discussed later). If a witness fails to produce a block, then they are not paid, and may be voted out in the future.

One of the most notable features of DPoS is that the number of block producers is explicitly limited. For instance, EOS keeps the number of block producers to 21. This constraint prevents all sort of potential brute force attacks in the network. Despite the limitation, DPoS implementations keep a pool of block producers available so in case existing block producers exhibit a malicious behavior.

DPoS Benefits

DPoS implementations are still in relatively early stage, although some of the them such as BitShares or Steem have achieved meaningful traction in the blockchain space. The initial implementations of DPoS have already surfaced some of key benefits of the protocol. Here are some of my favorites:

  • Separation of Concerns: DPoS separates the election of block producers from the block production itself which opens the door for more creative models to solve both problems in isolation.
  • Token Holders Control: Obviously, the election of block producers guarantee that token holders remain in control of the network which is the key principle of decentralization.
  • Scalability: Early implementations of DPoS have shown that it addresses some of the scalability limitations of traditional PoW and PoS models.
  • On-Chain Governance: The DPoS method provides the foundation for implementing interesting governance models in blockchain applications. In some sense, DPoS can be seen a form of liquid representative democracy where voting power can be allocated to other participants and votes can be changed at any time.
  • Avoid the Nothing-at-Stake Problem: DPoS addresses the famous Nothing-at-Stake problem in PoS networks in which a small group of validators can take control of the network. The fixed of number of token validators in DPoS as well as the dynamic election model prevents this issues from happening.

 This post combines two posts originally published in Coinmonks.

 

Feature Image: Proof by Nick Youngson CC BY-SA 3.0 Alpha Stock Images