Staking Update: March 2022

By PolkadotMarch 31, 2022

By Kian Paimani, Parity Technologies

Nomination pools explained

The nomination pools are still in the review process. To see the most up to date code and docs check out the primary feature PR and the extracted slashing logic PR.

Problem

The number of nominators in elections is bounded due to memory constraints in the runtime and offchain context.

Solution

Nomination pools have been designed to alleviate this bottleneck by allowing users (pool members) to pool their funds together and act as a single nominator.

All operations are constant space and time complexity relative to the number of members, eliminating any theoretical upper bound on the quantity of members the system can handle.

The rewards of the pool are split pro rata to a members stake in the bonded pool (and thus rewards for members will be the same as if they were a nominator). Importantly, slashes are also applied proportionally to members who may have been actively bonded when a validator committed a slash-able offense.

Key Components

Member Lifecycle

Join a pool

A user delegates funds to a pool by transferring some amount to the pool’s bonded account with the join extrinsic. The pool then increases its bond in the staking system with the new funds. A member is afforded the ability to bond additional funds and rewards as long as they are already actively bonded. Note that a member may only belong to one pool at a time.

To be more specific, when joining a pool, a member transfers some funds to the pool’s account and in return receives some points in the “Bonded pool”.

Claim rewards

The member can claim their portion of any rewards that have accumulated since the previous time they claimed (or in the case that they have never claimed, any rewards that have accumulated since the era after they joined). Rewards are split pro rata among the actively bonded members.

Unbond funds

At any point in time after joining the pool, a member can start the process of exiting by unbonding. The unbond transaction will unbond either all or a portion of the members' funds.

When unbonding, a portion of the member’s points are burnt in the Bonded pool and are moved to a corresponding “Unbonding sub-pool”.
If a member no longer has any points in the bonded pool (i.e. they are fully unbonded), then they can no longer claim rewards. To prevent accidental loss of rewards, all unbond transactions will automatically claim any pending rewards as well.

Withdraw unbonded funds

After unbond has been called and the unbonding duration has passed (e.g. 28 days on Polkadot), a member may withdraw their funds with withdraw_unbonded. Withdrawing effectively ends a member’s relationship with their pool, allowing them to join a different pool if desired.

Limitations

Pool Administration

States

Roles:

Pool Lifecycle

Creation 👶

  1. The depositor calls the create extrinsic, setting the administrative roles and transferring some funds to the pool in order to add themselves as the first member. As stated above, the depositor must always be a member as long as the pool exists; they will be the last member to leave, ensuring they always have some skin in the game.
  2. The pool’s ‘nominator role’ selects validators with the nominate extrinsic.

Upkeep 🧹

  1. The nominator can update the pool’s validator selection.
  2. The state-toggler can update the pool’s state to blocked, then kick members by calling unbond and withdraw_unbonded. (The state can also be toggled back to open).
  3. The root can change itself, the state-toggler or the nominator at any time.

Destruction ☠️

A pool can be pushed into the “destroying” state via one of:

Dismantling a destroying pool:

  1. When a pool is in ‘destroying’ state, unbond and withdraw_unbonded become permissionless, so anyone can help all the members exit.
  2. Once the depositor withdraws, no members belong to the pool, and all the pool’s resources are wiped from state.

Slashing

If a pool’s underlying nomination account is slashed by the staking system, then the slash is distributed evenly across the bonded pool and the unbonding pools. To be more specific, the staking system will slash proportionally the active, and the unlocking chunks of the nominator account, except for chunks who’s unlock era is strictly smaller than `slash_era + bonding_duration`. The slash is then reflected in the pools system by mirroring the slash to the active ledger to the bonded pool, and similarly the slash to each unlocking chunk to its corresponding unbonding pool.

NOTE: why the chunks with an unlock era less than “slash_era + bonding_duration” are exempt? Imagine Alice has 40 DOT. She unbonds 10 at era 99, 10 at era 100, and 10 at era 101. Her unlocking eras are therefore 127, 128 and 129.

A slash is then known to happen at era 100.

Assuming a slash defer duration of 27, this slash will be enacted at the beginning of era 128, and Alice can withdraw the first chunk (127), leaving only two chunks (128 and 129) and her active ledger exposed.

But, even if the slash defer duration was 10, and the slash was applied at era 111, the staking system would look at the above condition: since the slash happened at era 100, chunks that will be unlocked before era 128 remain untouched. This means that even in this scenario, the 127 chunk will not get slashed.

In both scenarios, the 10 DOT that are left active remain exposed to slashing.

Thus, any member who either a) was unbonding or b) was actively bonded in the aforementioned range of eras will be affected by the slash. In other words, a member who may have been actively bonded when the offense happened is slashed pro rata based on its stake relative to the total slash amount.

Unbonding pools need to be slashed to ensure all nominators who were in the bonded pool while it was backing a validator that committed an offense are punished. Without these measures a nominator could unbond right after a validator equivocated with no consequences.

This strategy is slightly unfair to members who joined right after the slash, because they get slashed as well, but spares members who unbond. The latter is much more important for security: if a pool's validators are attacking the network, their members need to unbond fast! Avoiding additional slashes gives them an incentive to do that if validators get repeatedly slashed.

Notable Contributors

The Parity staking team would like to highlight the work of a couple external contributors:

Thinking about contributing? Look for issues in the Substrate repo with the mentor tag, or the NPoS and Elections project. All successful contributions will get an on-chain tip initiated by the staking team.

Also, if you are interested in contributing long-term, there’s a “Staking / PoS Engineer” position available at Parity Technologies.

Miscellaneous

By The Numbers

Confused by the meaning of all these terms? What is “intention”? What is “electing/electable”? Then checkout the February update, in which we explained the new staking terminology.

Polkadot

Nominators

Stake

Count


Minimum

Current

Max

intention

10 DOT

23083

22500

electing

24.4 DOT

20878

22500

active

124.19 DOT

20878

22500

Validators

Stake

Count


Minimum

Current

Max

intention

0 DOT

1027

1200

electable

0 DOT

1027

1200

active

1.79 MDOT

297

297

Kusama

Nominators

Stake

Count


Minimum

Current

Max

intention

100 mKSM

7323

20000

electing

369 nKSM

6541

22500

active

673 pKSM

6541

22500

Validators

Stake

Count


Minimum

Current

Max

intention

0

2062

4000

electable

0

2062

4000

active

4.13 kKSM

1000

1000

From the blog

What is a crypto wallet? Your all-access pass to the future web

In Web3, your wallet is your most valuable digital tool. It’s more than just a place to store, send, and receive cryptocurrencies securely—it’s your passport to the decentralized world.

July 2024: Key network metrics and insights

Welcome to your go-to source for the latest tech updates, key metrics, and discussions within Polkadot, brought to you by the Parity Success Team. This blog series covers a variety of topics, drawing insights from GitHub, project teams, and the Polkadot Forum.

Polkadot 2.0: The rebirth of a network

Polkadot 2.0 reimagines blockchain with a bold rebrand and powerful features: Agile Coretime, Async Backing, and Elastic Scaling. Step into a more flexible, faster, and scalable network. Learn about the improvements and changes that led to this next era of Polkadot.

Meet the Decentralized Futures grant recipients: transforming ideas into impact on Polkadot

The Decentralized Mic is here to spotlight the innovative projects and teams driving Polkadot’s growth. Join us as we explore the achievements of Decentralized Futures grant recipients and their contributions to the Polkadot ecosystem on the new ecosystem community call series.

The ultimate 2024 Polkadot grants and funding guide

Explore Polkadot ecosystem funding: grants, venture capital, bounties, and community initiatives. Discover opportunities for blockchain builders today.

Decoded 2024: Polkadot’s vision for a decentralized future

Polkadot Decoded 2024 in Brussels brought together top blockchain minds to explore the future of Web3. Highlights included Björn Wagner's insights on payments and Dr. Gavin Wood's vision for digital individuality. Showcasing technical breakthroughs and real-world use cases, Polkadot affirmed its leadership in the multi-chain future.

June 2024: Key network metrics and insights

Welcome to your go-to source for the latest tech updates, key metrics, and discussions within Polkadot, brought to you by the Parity Success Team. This blog series covers a variety of topics, drawing insights from GitHub, project teams, and the Polkadot Forum.

Introducing the New Polkadot Ledger App

Discover the new Polkadot Ledger app for seamless, secure transactions. Now available on Ledger Live, it supports Polkadot, Kusama, and more.

Polkadot’s May Ecosystem Insights

Welcome to your go-to source for the latest tech updates, key metrics, and discussions within Polkadot, brought to you by the Parity Success Team. This blog series covers a variety of topics, drawing insights from GitHub, project teams, and the Polkadot Forum.

Top takeaways from the decentralization panel at Consensus

Consensus by Coindesk 2024: a blockbuster success

Empowering Decentralization: Polkadot DAO Allocates 3M DOT for DeFi Growth

With an overwhelming majority of voters in favor, the Polkadot community has chosen to allocate 3 million DOT to enhance the ecosystem’s decentralized finance (DeFi) landscape. Made through three separate proposals via Polkadot’s decentralized governance (OpenGov), this decision provides an accessible, deep layer of native liquidity to help the ecosystem flourish. It also demonstrates the power of community-driven initiatives to shape the future of decentralized finance.Hydration (formerly known as HydraDX) focuses on improving DeFi liquidity, while StellaSwap aims to optimize the efficiency of automated market makers (AMMs).

Polkadot and the Future of Real World Asset Tokenization

The world of blockchain is rapidly evolving, and one of the most exciting developments is the emergence of Real World Assets (RWA) tokenization.