# Nominated Proof of Stake in Polkadot > What it is, how does it work and comparison with other staking election protocols This article aims to investigate whether the Phrágmen-based Nominated Proof of Stake (NPoS) protocol design and implementation in Polkadot offers both quantitative and qualitative advantages compared to other NPoS election schemes commonly used in the industry. To accomplish this, we begin by providing a background on PoS and NPoS protocols, along with an overview of the objectives that Polkadot's NPoS protocol aims to achieve. Subsequently, we delve into the specific mechanisms employed by the Polkadot NPoS protocol to attain these goals. Finally, we present a comparative analysis of the outcomes obtained from running NPoS elections using Polkadot's protocol versus employing other widely utilised NPoS-based election schemes within the industry. This article is a follow-up of a [talk given at Decoded 2023](https://www.youtube.com/watch?v=Sl_775xBKFc). ## Prelude Proof-of-Stake (PoS) protocols are a category of consensus mechanisms used by blockchains for large untrusted parties to reach consensus with regards to the state of the blockchain. One of the main responsibilities of PoS protocols is to select a set of validators (the "active validator set") that are tasked with producing and verifying blocks for a limited period of time. While a large number of validator “candidates” may set their desire to be part of the active validator set, only a subset of candidates is selected. The active validator set is bounded since the PoS consensus protocol requires the active validators to communicate and reach consensus in a limited time window. Thus, one of the main goals of a PoS protocol is to select (or "elect") a subset of validators from a larger set of candidate validators that set an intention to take part in helping the network to produce blocks and reach consensus and earn rewards for the work performed. In order to participate as a validator, candidates set their intentions on-chain and lock funds. The funds are locked for as long as the candidate wants to become a validator and earn rewards. These funds are used to align incentives: validators that misbehave are penalised by the protocol by getting their locked funds slashed. PoS protocols leverage economics and game theory by rewarding well-behaved validators and slashing bad actors, which enables large networks of untrusted parties to produce blocks that are eventually consentual to a majority of the network participants. PoS protocols may implement different incentive design schemes, but often they rely on positive (e.g. rewards) and negative (e.g. slashing) incentives to steer the behaviour of validators. There are different approaches to design incentives in PoS protocol. For example, a simple and effective design is to slash a relatively large percentage of the locked funds if the validator misbehaves, while the chance of earning rewards is proportional to the amount of stake locked. In this context, it follows that the larger the funds backing a validator, the larger are the incentives for the validator to behave as expected, since the punishments and the potential for future earnings are economically larger. Given a well designed incentive scheme (e.g. relative large slashing and rewards proportional to locked funds), we can generalise that the higher the overall stake backing the active validator set, the higher is the overall "economic security" of the network. However, the election algorithm used to select the active validators may also try to optimise other factors besides economic security, as we will explore later in this article. ## Nominated Proof-of-Stake Given the risks and complexity of being a validator (up-time requirements, infrastructure costs and maintenance, technical skills required), not everyone can or may want to become a validator. Nominated Proof-of-Stake (NPoS) allows any user to delegate their funds to validators. The funds delegated by nominators are added to the validators stake and are also liable to slashing if the validator misbehaves. In addition to being exposed to slashes, nominators are also rewarded for the work performed by the validators they nominate. In sum, the nominators have similar incentives as validators, but instead of being incentivized to operate and maintain well-behaved validators, they are incentivized to nominate well-behaved validators in order to earn rewards and not be slashed. NPoS protocols have two considerable advantages: it increases the overall stake of the validator set by giving the opportunity for more users to lock and use their funds to secure the network and opens up the possibility for any user to be rewarded by helping to secure the network. NPoS Election Algorithm An important building block of the NPoS consensus protocol is the election algorithm that selects which candidate validators will be selected to produce and verify the blocks in the upcoming blocks. Ideally, the election algorithm selects a set of winner validators from the list of candidates that maximise the economic security of the network (i.e. the total stake backing the active set) from the list of nominations and candidate intentions in the system at the time of the election. The election algorithm must run trustlessly (e.g on-chain or with a hybrid on-chain/off-chain) to ensure that bad actors cannot bias the election results. ![image7](https://hackmd.io/_uploads/ByCgCmwF6.png) *Figure 1. The Nominated Proof-of-Stake stages. Nominators vote on validator candidates and lock staking funds; the on-chain election algorithm selects a subset of winner validators that will produce and verify blocks in the next epoch.* ## Polkadot and NPoS Polkadot implements a nominated proof of stake consensus protocol. The main focus of this article is to study the impact of the design and implementation decision behind Polkadot’s election algorithm, how it affects the overall performance of the network and how it compares with other commonly used election algorithms in the industry. In order to provide context to the design decision of Polkador’s NPoS protocol, we first examine the election algorithm (see Figure 1) used in Polkadot, namely, what are the goals of the NPoS algorithm in Polkadot and what are the key aspects it is optimising that affect the network security, fairness and usability. Finally, we will present the performance results of the NPoS election algorithm in Polkadot with other NPoS protocols that are commonly used in the industry. The remainder of the article is divided into three sections: 1) how does Polkadot implement the election algorithm and why; 2) how has Polkadot's election algorithm been performing and how does it compare to other election solutions and 3) future work and improvements. #### Key takeaways - Polkadot uses a Nominated Proof-of-Stake protocol to coordinate the selection of the validators that have the responsibility to produce and verify blocks. Validators and nominators stake their tokens to provide economic security to the network and align incentives; - The NPoS election algorithm selects the subset of active validators to author and validate the next blocks and it optimises different parameters, economic security being of the most important parameters but not the only one. ## Polkadot NPoS Election Algorithm As stated above, one of the most important design decisions of PoS blockchain is how the protocol selects the subset of winner validators from a list of candidates that will propose and validate the next blocks. The most intuitive approach is to select the subset of validators that have higher stake, in order to maximise the amount of stake backing the active validators, which in turn maximises the overall economic security of the network. Although maximising the amount of stake backing the selected validators is the best strategy to optimise the overall security of the network, there are other factors that are important to consider for the sake of security, aligning network incentives, optimising capital efficiency and fairness and having a good UX of token holders. The Polkadot PoS protocol tries to optimise for more parameters than only the amount of stake backing the active validators in the network. Besides maximising the economic security (total stake behind the winner validator set), Polkadot's NPoS election algorithm also seeks to maximise the capital efficiency, fairness and nominator freedom. Often, multiple goals overlap (e.g. optimising capital efficiency also optimises economic security). However, there are a few design decisions that greatly influence the performance of the election algorithm. The next sections will define more precisely the goals the NPoS election algorithm tries to achieve and explain further how the Polkadot NPoS election algorithm helps achieving the outlined goals. ### Economic Security The economic security of a PoS network is directly correlated with the amount of stake that is backing the active validator set and the distribution of the stake per validator operator. A validator operator is an entity that controls one or more validators. An entity that controls multiple validators in the active set may potentially disrupt the network if their cumulative stake is high and if the number of relative validators under its controls is large enough. For the sake of simplicity and scope, in this article we will focus on the case when each validator is independent from each other. In this context, the economic security is proportional with the amount of stake backing the active validators. Recall that the larger the economic security in a PoS network, the smaller the incentives for validators are to misbehave, provided that the incentives are correctly designed. Thus, we can generalise that the goal of an NPoS protocol is to maximise the amount of stake backing the active validator set. ### Capital Efficiency In the context of NPoS, capital efficiency is the ratio of active stake (see Figure 2) that is useful to secure the network to the total amount of stake locked by validators and nominators. In other words, the capital efficiency is as large as the total stake backing the winner validator set, compared to the total stake locked for staking. ![image8](https://hackmd.io/_uploads/r1Af07PFa.png) *Figure 2. Capital efficiency is the ratio between active stake and total stake locked for by nominators and validators in staking.* The goal of the Polkadot election algorithm is to maximise the capital efficiency of each election. The larger the capital efficiency is, the more stake is backing the active validators that need to produce and verify blocks, which means that the overall incentives for validators to respect the state transition logic when producing/verifying the blocks is larger. The inactive stake is, in practice, idle and not used to secure the network since it is not exposed to slashing. Locked idle stake also negatively impacts the utility of the network, since the locked funds can not be used for transfers or help to secure the network. Economic security and capital efficiency are directly correlated, since the higher the active stake, the higher the stake backing the active validator set. It follows that the goal of the NPoS election algorithm is to maximise the capital efficiency when selecting the active validator set. ### Fair representation There is a detail in Polkadot's consensus protocol that guides what the election algorithm should optimise for. In Polkadot, the elected validators that are part of the active validator set have equal producing/voting power in the consensus protocol. In practice, this means that the validators that are selected to author and verify the next set of blocks have similar responsibilities, regardless of the relative stake of each validator compared to other validators in the winning set. Thus, one of the NPoS election scheme goals is to ensure that the result of the election consists of a set of winners whose stake is as evenly distributed as possible. In addition, the NPoS scheme was designed to prevent any minority to be overrepresented in the winner set, in order to prevent an attacker – which in PoS is assumed to be a minority – from acquiring asymmetric power over the elected validator set. We call this property fair representation and the election algorithm in Polkadot tries to maximise this property. ### Nominator Freedom Finally, the NPoS protocol also optimises for nomination freedom. Nominators can vote on multiple validators (16 in Polkadot and 24 in Kusama). This aims at activating as much of the capital locked from nominators as possible, while giving a high degree of freedom for nominators to select the validators they trust the most. The main advantage of letting nominators selecting multiple validator candidates is risk diversification and to help new validators to bootstrap. #### Key takeaways - Polkadot's NPoS election algorithm is designed to maximise the following properties: economic security, capital efficiency, fair representation and nominator freedom. - Polkadot's NPoS election algorithm tries to answer the following question: "Given the current set of validator candidates and their nominations, which subset of validators optimises the economic security, fair representation and capital efficiency of the network?" ## Phrágmen election algorithm for NPoS The question, thus, is how Polkadot's election algorithm selects the active set of validations that better achieve the goals outlined in the previous section. To better understand the problem, it is important to highlight the degrees of freedom that the election algorithm has. One important design decision of the Polkadot NPoS protocol is that the election algorithm is responsible for distributing the nominator’s stake across the nominated validators. This design decision has profound consequences on how the election algorithm is implemented and its implementation and computation complexity. In practice, this means that nominators do not specify the portion of the stake that is delegated to each of their nominated validators. Instead, nominators specify the total amount of stake that is meant to be distributed by the election algorithm across each of the validator candidates that are part of the final active validator set. In this article, we call this step the election algorithm’s stake distribution. To better explain how the stake distribution works, consider the following example: In Figure 3, we see that nominator A has nominated 2 validator candidates and staked 100 tokens. The nominator has the freedom to vote on multiple candidates with a specified backing amount that is locked. Periodically, the election algorithm processes all the nominator’s votes and stakes and decides which set of active validator and stake distribution better maximise economic security, capital efficiency and fairness. Figure 4. demonstrates the case in which validator 1 is selected by the election algorithm to be part of the active nominator set (but not validator 2). Since only one of the nominated validators was selected, all the stake locked by nominator A will be backing validator 1. By design, if a nominator votes on many candidates and if at least one validator candidate is elected, all the nominated stake will back that validator. This is an example of the stake distribution performed by the election algorithm. This property helps to maximise both the capital efficiency and economic security (as well as the nominator freedom, as we’ll see below). The capital efficiency is impacted positively by the fact that all the locked stake by a nominator is useful if at least one of its voted candidates is selected. By proxy, as we’ve mentioned before, this also improves the overall economic security of the network. The Figure 5., on the other hand, pictures the case when both validators 1 and 2 are selected as part of the active nominator set. In this case, the election algorithm needs to decide how the locked tokens from nominator A will be distributed across both validator 1 and 2. Again, the election algorithm performs the stake distribution decision based on all the other nominations and validators in the network, so that all the goals referred in the previous section are maximised. ![image3](https://hackmd.io/_uploads/rkhICmPKp.png) *Figure 3. Nominator A staked 100 tokens and elected validators 1 and 2.* ![image9](https://hackmd.io/_uploads/H1zu0mwta.png) *Figure 4. The election algorithm selected the validator 1 to be part of the active set. Thus, all the stake from nominator A is distributed to the validator 1.* ![image2](https://hackmd.io/_uploads/ByvFAQwt6.png) *Figure 5. The election algorithm elected both validators 1 and 2 to be part of the active set. Given all the other nominations and validators, the election algorithm distributed the stake from the nominator A so that the specified goals are achieved.* The fact that the stake is distributed by the election algorithm instead of explicitly done by the nominators has several advantages: - **Stake distribution that maximise goals**: First, the election algorithm has a better vantage point to decide how to distribute the stake than the individual nominators. The election algorithm can rely on the current state of all nominations in the network and distribute the stake so that the active set maximises economic security, capital efficiency and fairness. - **Lower risk to non-exposure**: the stake distribution decreases the risks of the nominator’s stake not being “exposed” (i.e. active). For example, let’s consider that the nominator would perform the stake distribution instead of the election algorithm. Let’s assume that the stake distribution would have been 40 tokens for validator 1 and 60 tokens for validator 2 and that only the validator 1 was selected as active. In this case, the 60 tokens assigned to validator 2 would be idle and not backing the active set of validators. In this case, both the economic security and capital efficiency of the network would be worse than if the election algorithm did the stake distribution. - **Easier to bootstrap new validators**: The election algorithm ensures that all the nominator stake will be active as long as one of its nominated candidates is part of the active set. Thus, nominators can also nominate validators that have low chances of being selected but may improve their chances of winning the election in the future. This helps new validators to bootstrap without impacting capital efficiency and economic security by reducing the risks of nominators to nominate new validators. - **Stake variance minimization**: Another advantage is that the election algorithm can distribute the stake across active validators so that the difference between the stake behind all active validators is as low as possible. This helps to prevent over and under representation of validators in the active set. Note that although the election algorithm distributes the stake across the active validator set, it still needs to respect the nominator’s choices when nominating. This means that the stake from a nominator can only be distributed to validators that have been voted by the nominator. Summing up, due to the election algorithm being responsible for the final stake distribution in the active set, it has a high degree of freedom to elect the set of validators and corresponding backing that maximises the economic security, capital efficiency, fairness, all while respecting the nominator’s choices. ## Election algorithm as an optimization problem Given a large set of nominators, votes, and candidates, selecting the active nominator set and corresponding stake distribution that maximIses the capital efficiency, economic security and fairness is an optimization problem with NP-hard complexity. From an engineering perspective, given the constraints inherent to blockchains’s blockspace (i.e. available computation and storage), running an optimization problem on-chain is not feasible for large enough inputs. Recall that one of the requirements for the election algorithm is that it must run trustlessly (Figure 1.), to ensure that the attackers can not bias the final active set of nominators to attack the network. To address this problem, the Web3 Foundation designed an election algorithm inspired by the [Phrágmen voting](https://en.wikipedia.org/wiki/Phragmen%27s_voting_rules) rules that, based on [heuristics and estimations](https://arxiv.org/abs/2004.12990), can select a set of active validators and stake distribution that approximates the ideal solution. In addition, the election solution can be verified in linear time with the number of votes per nominator. In practice, this opens up the possibility to offload the election solution computation off-chain, while performing the solution verification on-chain. Importantly, the entity that performs the solution computation does not need to be trusted since the on-chain verification process verifies whether the solution provided from the untrusted party(ies) follows the Phrágmen election algorithm. At the expense of adding engineering complexity to the protocol, the Phrágmen election algorithm can be used in Polkadot NPoS to select the active validator set. The next section compares the election results of the Phrágmen algorithm with an election algorithm that is commonly used in the industry and analyses their performance in terms of economic security, capital efficiency and fairness. #### Key takeaways: - Delegating the final stake distribution to the election algorithm helps the protocol to maximise the economic security, capital efficiency, and fairness of the network. - The election algorithm minimises the risk of nominator non-exposure and helps new validators to bootstrap operations through the stake distribution, while the nominator’s choices are respected. - Computing an election solution is a NP-hard optimization problem which can not be computed on-chain. The election algorithm used in Polkadot addresses this problem by offloading the solution computation off-chain and verifying the results on-chain. - The election algorithm used in Polkadot that both finds approximate solutions that maximise the required goals and enables to run the election computation off-chain is based on the Phrágmen election algorithm and has been developed by W3F ## Polkadot NPoS Phrágmen election algorithm compared In this section, we show that the Phrágmen-based election algorithm used in Polkadot performs better when compared to other commonly used election algorithms in the industry. We compare the results of previous elections in Polkadot with what the results would be if an approval-voting based election algorithm would achieve, where the stake distribution is not performed by the election algorithm. But first, in order for us to be able to compare election results, we need to define what are the comparison metrics that allow us to weigh and sort different solutions. ### The election score Given multiple election solutions, how do we compare and order them in terms of the economic security, capital efficiency and fairness goals? In Polkadot, the concept of election score is used to help to compare different election solutions and to steer the final solution towards the optimal outcome. Although the election score is used in Polkadot to compare competing solutions submitted by the off-chain third parties, in this section it will be used to compare the performance of the Phrágmen election algorithm with the approval-voting based election algorithm. In practice, an election result can be represented as a directed graph of the final stake distribution per validator in the active set. For example, the election result of Figure 5 can be represented as the following graph ``` 1 → 70 2 → 30 … validator → stake ``` which represents the stake distribution to validators 1 and 2 in a proposed winner set. Based on this election result graph, we can calculate how much stake is backing each validator, what is the stake of the validator with the least stake in the winner set and the variance of the stake backing all the validators in the winner set. ![image11](https://hackmd.io/_uploads/SkyiCmvY6.png) *Figure 6: The election score and its parameters.* In Polkadot, the election score plays a key role in the staking protocol. Since multiple off-chain solutions may be computed and submitted on-chain by different untrusted parties, the staking runtime needs to select the best of the correct solutions submitted. This selection is performed by comparing the results in terms of the submission's "election score". What "best" means is defined by three parameters: Minimal stake (`minimal_stake` in Figure 6): the amount of funds backing the least backed validator in the election result. The minimal stake must be maximised to ensure that all the validators in the active set have aligned incentives to perform their tasks correctly. Maximising the minimal stake also helps with improving the fairness in the final active set; Total stake (`sum_stake` in Figure 6): the total amount of stake backing the full winner validator set, or the sum of funds backing all the validators in the active set. The total stake is directly proportional to both economic security and capital efficiency of the given solution. Thus, we give priority to election results with high total stake; Stake variance across validators (`sum_stake_squared` in Figure 6): the variance of stake across all the validators in the winner set. We want the stake variance to be low, in order to ensure that the stake is as evenly distributed as possible across the validators in the active set. The election score must be simple enough to verify and compare different election results on-chain. However, it should also encapsulate and steer the final solution towards the goals defined. Preferring solutions that have higher sum_stake ensures that the economic security and capital efficiency are higher, since there is more stake backing the winner set. On the other hand, selecting solutions with lower sum_stake_squared ensures that the stake is distributed equitably across the validators in the active set. Finally, preferring solutions with higher minimal_stake has the objective to ensure that even the lowest backed validator has high incentives to perform their tasks correctly. Note that it is not relevant to encapsulate in the election score a nominator freedom metric since that goal is already embedded in the protocol by allowing nominators to vote in multiple validators and ensuring the nominator’s votes are respected when performing the stake distribution. ### Approval voting-based election algorithm We compare the Phrágmen-based election algorithm used in Polkadot with an approval voting (AV) based election algorithm, which is commonly used in the industry by other nominator NPoS blockchains (note that different blockchains using AV-based election algorithms implement their own flavour, which may not be completely captured in this analysis. It should, however, be a good approximation and provide an acceptable baseline for comparison). The AV election algorithm used in this analysis consists of, similarly to the Phrágmen algorithm, selecting the top validators with the highest nominated stake. However, it does not perform any additional optimizations in terms of how the stake is distributed across the winner validator set. The nominators select which validators to vote and explicitly define the stake backing each of the validators. Note that given that AV-based election algorithms do not perform the stake distribution, the implementation is much simpler than Phrágmen. In addition, it is not required to solve an optimization problem to find the best election solution. In practice, the AV election algorithm “only” needs to sort the validators based on their backing stake. The active validator set is constructed from the top backed validators. Some implementation may add some randomness to the mix, but without any considerable impact in the final election score. The Figures 7 and 8 depict an example of the practical differences between Phrágmen and AV-based election algorithms. While the Phrágmen algorithm needs to perform the stake distribution and thus the domain of solutions is larger, the AV-based algorithm only needs to sort the validators by stake and select the top N validators, since the nominators explicitly set the stake distribution across their nominated validators. ![image5](https://hackmd.io/_uploads/SJinAXwta.png) *Figure 7. An election solution using the Phrágmen election algorithm and the AV-based election algorithm.* ![image4](https://hackmd.io/_uploads/H1t6R7vt6.png) *Figure 8. The Phrágmen algorithm may have multiple valid solutions with different stake distributions. The AV-based election algorithm however, only has one valid solution based on the sorting of validators by stake.* As we’ll see in the following sections, the Phrágmen election algorithm achieves better results than the approval voting-based election algorithm due to stake distribution optimizations performed by Phrágmen. ### Data provenance and reproducibility Our goal is to compare the score of the election solutions computed with Phrágmen and AV-based election algorithms. To that end, we use the nominations data in Polkadot from previous eras. However, we need to adapt the data from Polkadot to be used by the AV-based election algorithm, since the on-chain historical data in Polkadot does not have the explicit stake distribution by nominators as expected by AV-based election algorithms. We simulated the nominator stake distribution using two different curves: pro-rata and pareto distribution. The pro-rata distribution consists of splitting the stake from a nominator equally by all its nominated validators. The pareto distribution consists of distributing 80% of the nominator’s stake to the top 20% of the nominated validators. The pareto distribution seems to be widespread among NPoS blockchains that use AV-based election algorithms. We used the [substrate-timetravel](https://github.com/gpestana/substrate-timetravel) tool to fetch historical staking data from Polkadot, compute the staking distribution for the AV-based graphs and to compute election solutions with both algorithms. You can reproduce these experiments by using the [`election-analysis`](https://github.com/gpestana/substrate-etl/blob/main/src/operations.rs#L178) command. The data was obtained from Polkadot for ~365 eras (1 year of election data, starting from block `#14897884`), sampling the staking data at each 15 eras. **Note on bounds in Polkadot**: Currently, Polkadot relies on bounded staking data, which imposes boundaries on the input data to the election algorithm. The current implementation is bounded due to the computational complexity and the high strain that the unbounded Phragmen-based election scheme puts on the chain (even if the election occurs off-chain, the solution verification still needs to be computed on-chain). However, due to the computational complexity of the AV-based election algorithm, we can assume that the Polkadot could in practice implement an unbounded AV algorithm on-chain. Thus, we assume it is fair to compare the bounded NPoS against the unbounded DPoS scheme. In the future, we plan to implement an unbounded election in Polkadot by splitting certain operations and data intake across multiple blocks (see Future Work section for more details). It is expected that the unbounded election will yield better election results when using Phrágmen – especially as the number of nominators, validator candidates and stake increases in the system. In order to confirm this expectation, we also run the Phrágmen elections as if the inputs were not unbounded and compare with bounded Phrágmen (i.e. historical Polkadot result) and to the AV-based election score. ## Election algorithms compared ### Minimal stake ![image6](https://hackmd.io/_uploads/ryL11EPtT.png) *Figure 9. Comparison of the minimal stake using bounded Phrágmen, unbounded Phrágmen and AV-based election algorithms with pro-rata and pareto stake distribution.* #### Observations - Phrágmen election algorithm achieves better (i.e. higher) minimum stake score than the AV-based election algorithm with pro-rata and pareto stake distribution. - Delegating the stake distribution to nominators instead of relying on the election algorithm yields worse results in terms of minimal stake score. - The minimal stake of the unbounded Phrágmen election is marginally better than that of the bounded NPoS. We expect the difference to increase as the number of nominators, validators and stake to increase. ### Total stake ![image10](https://hackmd.io/_uploads/ryzeJVPtp.png) *Figure 10. Comparison of the total stake using bounded Phrágmen, unbounded Phrágmen and AV-based election algorithms with pro-rata and pareto stake distribution.* #### Observations - Phrágmen election algorithm achieves better (i.e. higher) total stake score than the AV-based election algorithm with pro-rata and pareto stake distribution. - Delegating the stake distribution to nominators instead of relying on the election algorithm yields worse results in terms of total stake score. - The total stake of the unbounded Phrágmen election is marginally better than that of the bounded NPoS. We expect the difference to increase as the number of nominators, validators and stake to increase. ### Stake variance across validators ![image1](https://hackmd.io/_uploads/H1_bJVvY6.png) *Figure 11. Comparison of the variance using bounded Phrágmen, unbounded Phrágmen and AV-based election algorithms with pro-rata and pareto stake distribution* #### Observations - Phrágmen election algorithm achieves better (ie. lower) stake variance score than the AV-based election algorithm. - Bounded Phrágmen achieved better stake variance than the unbounded Phrágmen. ### Conclusions The Phrágmen-based election algorithm used in Polkadot achieves better economic security, capital efficiency and fairness than an approval voting-based election algorithm and a stake distribution curve that is commonly seen in the real world. We conclude that the stake distribution optimizations performed by the Phrágmen algorithm yield better results across the board when compared with commonly-used election algorithms in the industry, at the expense of added protocol and engineering complexity. However, the added complexity is transparent to the user and it does not affect the user's UI/UX, thus we believe that it is a tradeoff that greatly benefits the ecosystem. ## Future improvements and directions Apart from the hybrid on/off-chain approach, the current staking protocol in Polkadot implements a few other scaling solutions that considerably improve the usability and scalability. For example, nomination pools allow a larger and theoretically unbounded set of nominators to come together and participate in the stake as one account, lowering the requirements in terms of minimum nomination bond and increasing the number of nominators that the system can handle. However, there are some improvements in the team's road map that will improve the scalability, usability and overall economic security of the staking protocol in Polkadot, namely: - **Multi-block unbounded NPoS**: based on the results above, the unbounded Phrágmen election algorithm performs slightly better than the current bounded implementation. We plan to refactor the current implementation of the staking protocol in Polkadot so that we can run the election algorithm and other building blocks in a multi-block way. This will enable us to drop the enforced bounds and achieve even better election scores than nowadays. - **Staking Parachain**: One of the long-term goals for the staking team is to run the staking runtime in a dedicated system parachain, which opens the way to leverage all the scaling capabilities of the Polkadot vision. - **Further analysis and comparison with other blockchains**: We'd like to find the concrete values of how much safer and more secure other NPoS blockchains would be if they’d use the Phrágmen election algorithm. If you are curious about this and interested in collaborating, reach out by Element or email!