Consensus Mechanisms: Proof of Stake vs. Delegated Proof of Stake
What is the difference between PoS and DPoS? Is one better than the other?
What Is a Consensus Mechanism?
In blockchain, a consensus is the way in which peers (nodes) of a blockchain network achieve an agreement on the current state of the data in the network. In a centralized network, consensus can easily be achieved through the work of a single governing entity who decides what constitutes the data in the network; but in the case of a decentralized network, a consensus mechanism is needed to allow all stakeholders of the network to agree on a single version of truth of the data that constitutes the network.
Blockchain networks are decentralized; every node on the network maintains an identical copy of the blockchain and must verify transactions. Before a blockchain can process new transactions, a consensus must be reached. A blockchain’s consensus mechanism refers to the protocol by which all nodes on the network agree on the validity of transactions — thereby securing the data on the blockchain. There are many different ways to reach a consensus on a blockchain, and each blockchain uses a different consensus mechanism that fits the needs of the users and their use cases. The two most prevalent consensus mechanisms are Proof of Work (PoW) and Proof of Stake (PoS), most notably used by Bitcoin and Ethereum respectively. A non-exhaustive list of other mechanisms include Delegated Proof of Stake (DPoS), Practical Byzantine Fault Tolerance (PBFT), Proof of Authority (PoA), Proof of Burn (PoB), Proof of Capacity (PoC), Proof of History (PoH), Proof of Replication (PoRep), and e.t.c., with each mechanism using different concepts to validate changes on the blockchain.
Proof of Stake (PoS)
The Proof of Stake mechanism was first hypothesized as a more efficient alternative to validate blockchain transactions than the Proof of Work mechanism which struggled with low scalability and intensively high energy usage. In a nutshell, the PoW mechanism relies on high computer processing power from miners (dedicated nodes involved in creating and adding blocks to the blockchain) to compete and solve complex computational puzzles in order to verify and record blockchain transactions. The miner who solves the puzzle first earns the right to validate transactions and add a new block to the network, and receives compensation in the form of the blockchain’s native cryptocurrency for doing so.
Unlike PoW, PoS relies on a network of nodes for the verification and recording of blockchain transactions, as well as in earning rewards. Nodes earn the right to validate transactions, create new blocks, and earn rewards through computational randomness, weighted by the amount of collateral — in the form of the blockchain’s native cryptocurrency, that they have locked-up, or staked, in the network. Such nodes under the PoS mechanism are known as validators. Becoming a validator requires users to stake a minimum amount of tokens designated by the rules of the network. The validator is then responsible for checking and “attesting” — voting, that new blocks propagated over the network are valid, and occasionally proposing (creating and propagating) new blocks themselves. Validators earn staking rewards for their participation in the consensus based on their role: voting or proposing, and the amount of collateral they have staked.
As a result, anyone can stake tokens to the network, and users can even contribute smaller amounts of tokens to staking pools to combine tokens and aggregate their staking power with other users who wish to also participate in staking.
Underlying Mechanism
The PoS mechanism uses several methods to decide which validator will validate transactions:
- The amount of staked cryptocurrency: the higher the staked amount, the higher the chance of getting selected to validate the next block
- The age of the stake: when a validator’s stake is used to verify a block, its age is reset to zero. The greater the age of the stake, the greater the chance of selection.
- Random selection: a validator is pseudo-randomly chosen to propose the next block, based on an underlying randomness generation algorithm such as RANDAO, which mixes a hash with another metric — often the largest stake or a seed that gets updated every block.
In PoS blockchains, this means that a validator is algorithmically chosen to validate transactions and create a new block based on their stake on the network. Block time in PoS blockchains are commonly divided into slots and epochs, where x slots make up one epoch. Each epoch, every validator is assigned a role, and validators selected to be block proposers are assigned to a specific slot each in the epoch. At the end of an epoch, validator rewards are distributed and roles are shuffled.
The term “Proof of Stake” technically refers to a Sybil resistance mechanism. Resistance to Sybil attacks are vital for a decentralized blockchain to reward its stakeholders in a fair manner based on the resources they put in; and Proof of Stake protects against Sybil attacks by requiring stakeholders to put up collateral as an economic deterrent. In simple terms, each vote on a PoS blockchain is backed by money. Another important aspect of a blockchain’s consensus is the chain selection algorithm that allows nodes to correctly identify and follow the canonical chain. In PoS blockchains, the correct chain is determined by the “weight” of the chain, calculated by the accumulated sum of validator votes and weighted by validator staked balances.
The Good and the Bad
Proof of Stake is a popular consensus mechanism that is considered to be more secure, less energy-intensive, and more scalable than Proof of Work. In PoS blockchains, priority is placed on tokens staked on the network instead of computing power, thus allowing more users to participate in the validation process; and in return, a large distribution of nodes promotes greater decentralization and greater security. Transactions are approved much faster in PoS as validators are selected algorithmically rather than the time taken to solve a puzzle. However, the biggest drawback of the PoS mechanism is that it can tilt towards centralisation by favoring large token holders — as validators with a larger stake increase their chances of selection over validators with a smaller stake. Many variants of the classical PoS consensus mechanism have emerged to address the shortcomings of the validator selection process and improve network efficiency, including different validator selection methods and staking processes. The most notable of these variants is Delegated Proof of Stake (DPoS).
Delegated Proof of Stake (DPoS)
Delegated Proof of Stake works similarly to Proof of Stake, but with a distinction. DPoS uses a voting and delegation mechanism to incentivise users to participate and secure the network with their staked collateral. A successful block production requires users of the network to vote and elect delegates, also referred to as validators or witnesses, who will validate blocks. Users of the network get to determine which validators will validate new blocks, through a voting mechanism in which votes are weighted by the amount of staked collateral found in a staking pool linked to each validator. In essence, users of a DPoS blockchain stake their collateral with the validator they wish to vote for; and the weight of validators is determined by the total amount of staked collateral they carry.
Unlike in PoS blockchains, most DPoS blockchains assign a limited number of active validators to validate each new block, and the validator(s) for one block may not be the validator(s) for the next; and this number can change to suit the needs of the network. Different DPoS blockchains may also have different rules in determining what constitutes an active validator; for instance, only the top n validators, ranked by the amount of their staked collateral, get to be deemed as active and can participate in the consensus. The validator voting process is continuous and users (delegators) can replace ineffective/inactive validators with another validator any time, through re-delegating their staked collateral to another validator of their choice. As a result, validators are encouraged to be active and honest to continue receiving the backing of their delegators.
Anyone can be a validator in a DPoS network so long as they meet the staking requirements to be a validator. Validators participate in the blockchain’s consensus by broadcasting their votes and proposing new blocks, and receive revenue for their work. In DPoS, each block proposer is selected deterministically, and the frequency of being selected is proportional to the validator’s staked collateral, i.e. the validator’s voting power. Rewards in the form of block rewards and transaction fees are distributed to validators when they validate blocks. The distribution of rewards may vary slightly between DPoS blockchains, but in general, rewards are divided among active/elected validators according to their weight. Then, in exchange for backing a validator, delegators receive a share of that validator’s rewards in proportion to each of their stake with that validator. In some cases, a commission on delegators’ earnings can be applied by the validator before distribution.
Is DPoS better than PoS? Or not?
Right off the bat, one can argue that Delegated Proof of Stake is more democratic in selecting validators than Proof of Stake, through its stake-weighted voting and delegation mechanism. In DPoS, validators are selected by the voting power they carry, while in PoS, this is dependent on the amount of collateral staked. The agency of electing validators means that in DPoS, reputation is valued over overall wealth, allowing a more diverse group of individuals to participate in the consensus as opposed to individuals with a lot of money. Users help to ensure accountability as only honest (and the most profitable) validators are retained.
The limit on the number of active validators allows DPoS blockchains to reach consensus faster than PoS counterparts which require complete network-wide consensus. Setting a cap on the number of active validators means having a smaller group of validators attest to and propose blocks on the network. The outcome is achieving transaction finality quickly and more efficiently, with more blocks being generated and more transactions being handled on DPoS blockchains compared to blockchains that use PoS or other consensus mechanisms.
In PoS, users may not be able to participate in the network’s governance and play any part in influencing network decisions — this ultimately depends on the rules defined in the genesis block. Often, governance is taken off-chain where only a select group of stakeholders are involved. However in DPoS, users can participate in the network’s governance directly on-chain by virtue of having the voting and delegation mechanism. Users on a DPoS blockchain participate in the network’s consensus with their voting power proportional to the amount of collateral they stake. Validators are required to actively participate in governance by voting on proposals, but delegators are not required to. When a delegator doesn’t vote, they will simply inherit the vote of the validator(s) that they have staked with.
DPoS is recognised to be one of the most equitable ways to achieve consensus on decentralized blockchains, more so than PoS. But it is not free of limitations. DPoS requires active engagement from its users to vote for validators to ensure that the blockchain network is operational. Without enough participation from both delegators and validators, the network will fail to run. Due to the limited number of validators participating in the consensus, DPoS blockchains may be more susceptible to a 51% attack than PoS blockchains, which occurs when a single validator or group of validators owning more than 50% of a network’s staked collateral behave maliciously towards the network. Though this is highly unlikely, as validators are voted in by users of the network, it is not impossible. On the same narrative, with a limited number of validators, as opposed to hundreds or thousands of validators, a DPoS blockchain may be less decentralized than PoS blockchains when very few users/groups can act as validators. Some may even argue that DPoS blockchains only have a fixed degree of decentralization as the number of validators who can participate in the consensus is predefined, unlike PoS blockchains which have no limits on that number. The same argument could also be said for PoS blockchains which do not feature the voting and delegation mechanism and are regarded as less democratic — thus less decentralized, than DPoS counterparts.
Conclusion
Ultimately, both Proof of Stake and Delegated Proof of Stake consensus mechanisms feature their own set of merits and demerits. DPoS and PoS are similar in some aspects and yet different in other aspects; and neither is better than the other. Choosing between DPoS and PoS, even other consensus mechanisms, should depend on the use cases and vision of the blockchain project as well as the needs of its users. Ethereum’s co-founder Buterin coined the blockchain trilemma, which articulates that decentralized networks can truly only provide for two out of the three following benefits simultaneously: decentralization, security and scalability. Theoretically, each consensus mechanism diminishes one of the three benefits by a varying degree — PoS and DPoS are no exceptions. Many innovative solutions have come up to help blockchain projects achieve a balance between the three edges of the blockchain trilemma. For instance, the Tendermint consensus (otherwise known as the Ignite consensus as of 2022) which many Cosmos-based blockchains run on — including f(x)Core, features a BFT (Byzantine Fault Tolerance) + DPoS stack to find an effective balance in the blockchain trilemma.
Next
Thank you for reading this month’s tech article and stay tuned for the next one on our f(x)Core publication!
If you’d like to know more about Function X and stay up-to-date with us, check out one of the links below.
Website | Twitter | Forum | Telegram Announcements | Telegram Group | Discord | Github