Intermediate

 

Introduction to Staking

Get ready to embark on a staking adventure with Polkadot! On the home page, you’ll find all the resources you need to get started, including a user-friendly Staking Dashboard that makes the staking process a breeze. In this tutorial, you’ll get an overview of staking and why it’s important on Polkadot.

WANT TO LEARN ABOUT NOMINATION POOLS?

Polkadot allows you to stake with just 1 DOT and earn rewards. Learn more by checking out our blog post on the topic. For even more information, head to the wiki doc on nomination pools. You’ll discover how easy it is to start staking on Polkadot.

Proof-of-Stake (PoS)

Blockchains use consensus mechanisms to agree on and add blocks to the chain. This process is called “consensus” and involves two steps: block production (how blocks are created) and block finality (selecting one block from multiple candidates and adding it to the main chain). Proof-of-Work (PoW) and Proof-of-Stake (PoS) are common consensus mechanisms used on public blockchains with many participants who don’t know each other. PoW relies on miners solving difficult math puzzles to add blocks and earn tokens, but it’s criticized for its energy consumption. In PoS, network security is based on the amount of capital locked on the chain. Token holders can lock funds to become validators and receive staking rewards, making PoS more inclusive and eco-friendly than PoW. PoS also incentivizes good behavior and punishes misbehavior, as stakers have a stake in the network and can be held accountable.

Nominated Proof-of-Stake (NPoS)

Polkadot implements Nominated Proof-of-Stake (NPoS), a relatively novel and sophisticated mechanism to select the validators who are allowed to participate in its consensus protocol. NPoS encourages DOT holders to participate as nominators.

Any potential validators can indicate their intention to be a validator candidate. Their candidacies are made public to all nominators, and a nominator, in turn, submits a list of up to 16 candidates that it supports, and the network will automatically distribute the stake among validators in an even manner so that the economic security is maximized. In the next era, a certain number of validators having the most DOT backing get elected and become active. For more information about the election algorithm go to this page on the wiki or this research article. As a nominator, a minimum of 100 DOT is required to submit an intention to nominate, which can be thought of as registering to be a nominator. Note that in NPoS the stake of both nominators and validators can be slashed. For an in-depth review of NPoS see this research article.

MINIMUM NOMINATION TO RECEIVE STAKING REWARDS

Although the minimum nomination intent is 100 DOT, it does not guarantee staking rewards. The nominated amount has to be greater than minimum active nomination, which is a dynamic value that can be much higher than 100 DOT. This dynamic value depends on the amount of DOT being staked, in addition to the selected nominations.

Nominating Validators

Nominating on Polkadot involves two steps: locking tokens and selecting validators. The amount of tokens you lock and the validators you choose are up to you. This process of locking tokens is also referred to as bonding, staking, or backing. Your bonded tokens will be automatically allocated to your selected validators every time the active validator set changes, which occurs every era on Polkadot. Unlike other staking systems, Polkadot automatically assigns your bonded tokens to the most active of your selected validators, increasing your chances of backing a successful one and earning more rewards and network security. This system solves the problem of not being able to earn rewards if your chosen validator is inactive.

Polkadot uses tools ranging from election theory to game theory to discrete optimization, to develop an efficient validator selection process that offers fair representation and security, thus avoiding uneven power and influence among validators. The election algorithms used by Polkadot are based on the Proportional Justified Representation (PJR) methods like Phragmen. For more information about PJR methods visit this research article.

Eras and Sessions

The nomination of tokens by stakers increases the number of tokens held by validator candidates, boosting their chances of being selected by the election algorithm for block production during a specific era. An era is a 24-hour period during which an active set of validators carries out actions on the chain and produces blocks. Not all validators are part of the active set, which changes between eras. Each era is divided into 6 epochs or sessions where validators are assigned as block producers to specific time slots. Although validators know the slots they will produce blocks in, they don’t know all the slots within an era. This division into sessions adds an extra layer of security by reducing the possibility of multiple validators colluding to harm the network.

Staking Rewards

Validators who produce a block are rewarded with tokens, and they can share rewards with their nominators. Both validators and nominators can stake their tokens on chain and receive staking rewards at the end of each era. The staking system pays out rewards equally to all validators regardless of stake. Thus, having more stake in a validator does not influence the amount of block rewards it receives. This avoids the centralization of power to a few validators. There is a probabilistic component in the calculation of rewards, so they may not be exactly equal for all validators. In fact, during each era validators can earn era points by doing different tasks on chain. The more the points, the higher the reward for a specific era. This promotes validators’ activity on chain. To know more about era points, and how and on which basis they are distributed visit the dedicated page. Distribution of the rewards is pro-rata to all stakers after the validator’s commission is deducted.

Skin in the game when Staking

The security of PoS networks depends on the amount of staked tokens. To successfully attack the network, a malicious actor would need to accrue a large number of tokens or would need different participants to collude and act maliciously. If there is an attack in the case of NPoS, both the validator(s) and nominators will be slashed resulting in their stake being partially or fully confiscated by the network and then deposited to the treasury. There is little interest for a rational network participant to act in a harmful way because NPoS ensures that all participants can be held accountable for their bad actions. In NPoS, validators are paid equal rewards regardless of the amount of stake backing them, thus avoiding large payouts to few large validators which might lead to centralization.

Being a Nominator

Tasks and Responsibilities of a Nominator

Validators. Since validator slots are limited, most of those who wish to stake their DOT and contribute to the economic security of the network will be nominators, thus here we focus on the role of nominators. However, it is worth mentioning that validators do most of the heavy lifting: they run the validator nodes and manage session keys, produce new block candidates in BABE, vote and come to consensus in GRANDPA, validate the state transition function of parachains, and possibly some other responsibilities regarding data availability and XCM. For more information, you can take a look at the validator docs to understand what you need to do as a validator. If you want to become a validator you can consult this guide.

Nominators. Nominators have far fewer responsibilities than validators. These include selecting validators and monitoring their performance, keeping an eye on changing commission rates (a validator can change commission at any time), and general health monitoring of their validators’ accounts. Thus, while not being completely set-it-and-forget-it, a nominator’s experience is relatively hands-off compared to that of a validator, and even more with nomination pools. For more information, you can take a look at the nominator guide to understanding your responsibilities as a nominator.

If you want to become a nominator, see this guide. If you are a beginner and would like to securely stake your tokens using the Polkadot-JS UI, refer to this support article.

POLKADOT STAKING DASHBOARD

The Staking Dashboard provides a more user-friendly alternative to staking. See the instructions in this support article to learn how to stake with the dashboard.

Pools. Pools are “built” on top of NPoS to provide a very low barrier to entry to staking, without sacrificing Polkadot’s strict security model.

Selection of Validators

The task of choosing validators is not simple, as it should take into account nominator reward and risk preferences. Ideally one aims to maximize the reward-to-risk ratio by maximizing rewards and minimizing risks, with sometimes having to compromise between the two, as minimizing risks might decrease rewards as well. Nominators should pay attention, especially to six criteria when nominating validators (not in order of importance):

  • recent history of the era points earned across eras

  • validator’s self stake (shows skin in the game)

  • total stake backing the validator (which is the sum of self stake and the stake coming from nominators)

  • commission fees (i.e. how much validators charge nominators)

  • verified identity

  • previous slashes

The diagram below shows how the selection of those criteria affects the reward-to-risk ratio.

Validator Selection Criteria

To maximize rewards and minimize risk, one could select those validators that:

  • have era points above average (because they will get more rewards for being active),

  • have the total stake backing the validator below the average active validator stake (because they will pay out more rewards per staked DOT),

  • have high own stake (because if slashed they have something to lose),

  • have low commission fees but not 0% (because it makes sense that for doing the heavy lifting, validators ask for a small commission),

  • have on-chain registered identity (because it adds a layer of trust and possibly provides access to their website and contact details),

  • and have not been slashed (meaning that their on-chain behavior is genuine).

Network Providers

For successful operation, a Validator node should always be ensured to meet the required software, hardware, and network bandwidth specifications. Understandably, most of the validator nodes run on cloud service providers that guarantee high hardware specifications and high levels of availability and connectivity. Keep in mind that a validator in the active set is supposed to be fully online and available for producing blocks. If the active validator node goes offline due to network interruptions or a power outage, that validator might be subject to slashing due to unresponsiveness. As Polkadot’s block production mechanism is reasonably resilient to a small proportion of validators going offline, no slashing is imposed until 10% of the validators in the active set go offline. Hence, if multiple nodes are running on a single cloud service provider and go offline simultaneously due to an outage or due to a change in their terms and conditions policy regarding the support of Proof-of-Stake (PoS) operations, the offline validators and all the nominators backing them can be slashed up 7% of their stake on Polkadot. Hence, it is recommended that you check if you are nominating the validator nodes that are running on cloud service providers, and if they do, check if they allow for Proof-of-Stake operations.

CHECKING VALIDATORS USING NETWORK PROVIDERS

You can connect your stash account to the Polkawatch app. The app will show your rewards earned in the past 60 eras divided by network provider and country. You will be able to see networks used by each validator and verify if your validators are using providers who support PoS. This is also a great tool to explore how decentralized your nominations are and act accordingly.

Keeping Track of Nominated Validators

NOMINATORS MUST PERIODICALLY CHECK THEIR VALIDATORS

Nominating is not a “set and forget” operation. The whole NPoS system is dynamic and nominators should periodically monitor the performance and reputation of their validators. Failing to do so could result in applied slashes and/or rewards not being paid out, possibly for a prolonged period.

Although the theory can be used as a general guideline, in practice it is more complicated and following the theory might not necessarily lead to the desired result. Validators might have the total stake backing them below average, low commission and above average era points in one era and then have a different profile in the next one. Selection based the criteria like on-chain identity, slash history and low commission make the staking rewards deterministic. But some criteria vary more than others, with era points being the most variable and thus one of the key probabilistic components of staking rewards. Part of this probability is directly related to the fact that a validator can produce blocks for a parachain (i.e. para-validators) or the relay chain, with para-validators earning more era points per unit time (see this page for more information). The role can switch between sessions, and you can look at the staking tab on the Polkadot-JS UI to know which validator is producing blocks for the relay chain or parachains.

It is not recommended to change nominations because of the low era points of a validator in a single era. Variability in rewards due to the era points should level out over time. If a validator consistently gets era points below average, it makes sense to nominate a better-performing validator for the health of the network and increased staking rewards. See this support article to understand in detail how to select the set of validators to nominate.

Stash and Controller Accounts for Staking

Two different accounts can be used to securely manage your funds while staking.

  • Stash: This account holds funds bonded for staking, but delegates some functions to a controller account. As a result, you may actively participate in staking with a stash private key kept in a cold wallet like Ledger, meaning it stays offline all the time. Stash account keys are used to sign staking actions such as bonding additional funds.

  • Controller: This account acts on behalf of the stash account, signaling decisions about nominating and validating. It can set preferences like commission (for validators) and the staking rewards payout account. The earned rewards can be bonded (locked) immediately for bonding on your stash account, which would effectively compound the rewards you receive over time. You could also choose to have them deposited to your controller account or a different account as a free (transferable) balance. If you are a validator, it can also be used to set your session keys. Controller accounts only need sufficient funds to pay for the transaction fees.

DANGER

Never leave a high balance on a controller account which are usually “hot” as their private key is stored on the device (PC, phone) and it is always exposed to the internet for potential hacks and scams. It is good practice to deposit rewards on the stash account or to send them to another account on a cold wallet.

This hierarchy of separate keys for stash and controller accounts was designed to add a layer of protection to nominators and validator operators. The more often one exposes and uses a private key, the higher its vulnerability for hacks or scams. So, if one uses a key for multiple roles on a blockchain network, it is likely that the account can get compromised. Note that the damage linked to stolen private keys is different depending on the type of account derivation. In the case of soft derivation, all derived accounts are compromised. More information about account derivation can be found here.

INFO

For Ledger users staking directly on Ledger Live, currently, there is no option to use separate stash and controller accounts. That is if you stake on Ledger Live your stash account will be your controller too.

Ledger devices are now supported in Talisman extension. Users can import their Ledger accounts in the extension and use them as a stash and controller. You can find more information about Talisman and other third-party wallets that officially secured funding from the treasury here.

Claiming Staking Rewards

Rewards are calculated per era (approximately six hours on Kusama and twenty-four hours on Polkadot). These rewards are calculated based on era points, which have a probabilistic component. In other words, there may be slight differences in your rewards from era to era, and even amongst validators in the active set at the same time. These variations should cancel out over a long enough timeline. See the page on Validator Payout Guide.

The distribution of staking rewards to the nominators is not automatic and needs to be triggered by someone. Typically the validators take care of this, but anyone can permissionlessly trigger rewards payout for all the nominators whose stake has backed a specific validator in the active set of that era. Staking rewards are kept available for 84 eras. The following calculation can be used to approximate this length in days on Polkadot:

84 eras × 24 hours in a single era ÷ 24 hours in a day = 84 days

For more information on why this is so, see the page on simple payouts.

PAYOUTS

Payouts are unclaimed rewards waiting to be paid out to both validators and nominators. If you go to the Staking payouts page on Polkadot-JS, you will see a list of all validators that you have nominated in the past 84 eras and for which you have not yet received a payout. The payout page is visible only to stakers.

Each validator as well as their nominators have the option to trigger the payout for all unclaimed eras. Note that this will pay everyone who was nominating that validator during those eras. Therefore, you may not see anything in this tab, yet still have received a payout if somebody (generally, but not necessarily, another nominator or the validator operator) has triggered the payout for that validator for that era.

TIME LIMIT TO CLAIM STAKING REWARDS

If nobody claims your staking rewards within 84 eras, then you will not be able to claim them and they will be lost. Additionally, if the validator unbonds all their own stake, any pending payouts will also be lost. Since unbonding takes 28 days, nominators should check if they have pending payouts at least this often.

Rewards can be directed to the same account used to sign the payout (controller), or to the stash account (and either increasing the staked value or not increasing the staked value), or to a completely unrelated account. It is also possible to top-up / withdraw some bonded tokens without having to un-stake all staked tokens.

If you wish to know if you received a payout, you will have to check via a block explorer. See the relevant Support page for details. For specific details about validator payouts, please see this guide.

Slashing

Slashing will happen if a validator misbehaves (e.g. goes offline, attacks the network, or runs modified software) in the network. They and their nominators will get slashed by losing a percentage of their bonded/staked DOT.

Any slashed DOT will be added to the Treasury. The rationale for this (rather than burning or distributing them as rewards) is that slashes may then be reverted by the Council by simply paying out from the Treasury. This would be useful in situations such as faulty slashes. In the case of legitimate slashing, it moves tokens away from malicious validators to those building the ecosystem through the normal Treasury process.

Validators with a larger total stake backing them will get slashed more harshly than less popular ones, so we encourage nominators to shift their nominations to less popular validators to reduce their possible losses.

It is important to realize that slashing only occurs for active validations for a given nominator, and slashes are not mitigated by having other inactive or waiting nominations. They are also not mitigated by the validator operator running separate validators; each validator is considered its own entity for purposes of slashing, just as they are for staking rewards.

In rare instances, a nominator may be actively nominating several validators in a single era. In this case, the slash is proportionate to the amount staked to that specific validator. With very large bonds, such as parachain liquid staking accounts, a nominator has multiple active nominations per era (Acala’s LDOT nominator typically has 7-12 active nominations per era). Note that you cannot control the percentage of stake you have allocated to each validator or choose who your active validator will be (except in the trivial case of nominating a single validator). Staking allocations are controlled by the Phragmén algorithm.

Once a validator gets slashed, it goes into the state as an “unapplied slash”. You can check this via Polkadot-JS UI. The UI shows it per validator and then all the affected nominators along with the amounts. While unapplied, a governance proposal can be made to reverse it during this period (7 days on Kusama, 28 days on Polkadot). After the grace period, the slashes are applied.

The following levels of offense are defined. However, these particular levels are not implemented or referred to in the code or in the system; they are meant as guidelines for different levels of severity for offenses. To understand how slash amounts are calculated, see the equations in the section below.

  • Level 1: isolated unresponsiveness, i.e. being offline for an entire session. Generally no slashing, only chilling.

  • Level 2: concurrent unresponsiveness or isolated equivocation, slashes a very small amount of the stake and chills.

  • Level 3: misconducts unlikely to be accidental, but which do not harm the network’s security to any large extent. Examples include concurrent equivocation or isolated cases of unjustified voting in GRANDPA. Slashes a moderately small amount of the stake and chills.

  • Level 4: misconduct that poses serious security or monetary risk to the system, or mass collusion. Slashes all or most of the stake behind the validator and chills.

If you want to know more details about slashing, please look at our research page.

Chilling

Chilling is the act of stepping back from any nominating or validating. It can be done by a validator or nominator at any time, taking effect in the next era. It can also specifically mean removing a validator from the active validator set by another validator, disqualifying them from the set of electable candidates in the next NPoS cycle.

Chilling may be voluntary and validator-initiated, e.g. if there is a planned outage in the validator’s surroundings or hosting provider, and the validator wants to exit to protect themselves against slashing. When voluntary, chilling will keep the validator active in the current session, but will move them to the inactive set in the next. The validator will not lose their nominators.

When used as part of a punishment (initiated externally), being chilled carries an implied penalty of being un-nominated. It also disables the validator for the remainder of the current era and removes the offending validator from the next election.

Polkadot allows some validators to be disabled, but if the number of disabled validators gets too large, Polkadot will trigger a new validator election to get a full set. Disabled validators will need to resubmit their intention to validate and re-garner support from nominators.

For more on chilling, see the “How to Chill” page on this wiki.

Why and Why not to Stake?

Pros of Staking

  • Earn rewards for contributing to the network’s security through staking.

  • Low barrier of entry through Nomination Pools.

  • Can choose up-to 16 validators which can help to decentralize the network through the sophisticated NPoS system

  • 10% inflation/year of the tokens is primarily intended for staking rewards.

When the system staking rate matches with the ideal staking rate, the entire inflation of the network is given away as the staking rewards. Up until now, the network has been following an inflation model that excludes the metric of active parachains. The ideal staking rate is a dynamic value – as the number of active parachains influences the available liquidity that is available to secure the network.

Any divergence from the ideal staking rate will result in the distribution of a proportion of the newly minted tokens through inflation to go to the treasury. Keep in mind that when the system’s staking rate is lower than the ideal staking rate, the annual nominal return rate will be higher, encouraging more users to use their tokens for staking. On the contrary, when the system staking rate is higher than the ideal staking rate, the annual nominal return will be less, encouraging some users to withdraw. For in-depth understanding, check the inflation section on the Wiki.

Cons of Staking

  • Tokens will be locked for about 28 days on Polkadot. No rewards will be earned during the unbonding period.

  • Possible punishment in case of the active validator found to be misbehaving (see slashing).

  • Lack of liquidity i.e. You would not be able to use the tokens for participating in crowdloans or transfer them to different account etc.