DAY 35 / 40
>> Module 04 / Day 35 / Lecture

NPoS Deep Dive

How Polkadot actually chooses its validators

On Day 27 you wrote weighted_choice() to simulate validator selection. Today you see how Polkadot's real NPoS election works — and why it's designed the way it is.

Lecture 75 min | Lab 60 min · Research validators on Polkadot.js | M4 · Polkadot Basics
DAY 35 / 40
>> Today's agenda

What we'll cover

  1. Recap: what weighted_choice() modelled
  2. Validators and nominators — roles revisited
  3. The NPoS election algorithm — balancing stake
  4. Rewards — how they flow from validators to nominators
  5. Slashing — the punishment system in detail
  6. Lab — find a validator and count its nominators
DAY 35 / 40
>> Where we left off

You already built a model of this

pos_review.py
# Day 27 — your weighted validator selection validators = { "Alice": 5000, # DOT staked "Bob": 3000, "Carol": 8000, "Dave": 2000, } def weighted_choice(validators): total = sum(validators.values()) r = random.uniform(0, total) cumulative = 0 for name, stake in validators.items(): cumulative += stake if r <= cumulative: return name
DAY 35 / 40
>> 01 / 03 · The participants

Validators and nominators — different jobs

VALIDATORS
Responsibilities:
Run a full node 24/7, produce relay chain blocks, verify parachain proofs, participate in GRANDPA finality voting.
Requirements:
Technical expertise, high uptime, large self-stake.
Active set: ~300 at a time
NOMINATORS
Responsibilities:
Research validators, bond DOT behind trustworthy ones (up to 16).
Requirements:
No technical setup, minimum ~250 DOT to nominate.
~50,000+ nominators currently backing the validator set
DAY 35 / 40
>> 02 / 03 · The election

Why Polkadot balances stake — not just picks the richest

A naive system would just pick the validators with the most DOT staked. Problem: 10 validators with 90% of all stake means huge centralisation. One cartel controls Polkadot.

NAIVE: PICK TOP STAKERS
  • The 300 richest validators always win.
  • Their nominators get all rewards. Nobody else bothers.
  • Stake concentrates. Network becomes centralised.
NPOS: PHRAGMÉN ALGORITHM
  • Tries to spread stake evenly across all elected validators.
  • A validator with less total DOT can win if spreading their backers' stake increases overall distribution.
  • More decentralised, fairer rewards.
DAY 35 / 40
>> 03 / 03 · The rewards

How rewards flow from validators to nominators

At the end of each 24-hour era, the protocol calculates rewards for each validator based on the number of blocks they produced and the fees they collected. The validator takes their commission (e.g. 5%), and the rest is split proportionally among all nominators backing that validator.

ERA REWARD
POOL
→
VALIDATOR
COMMISSION
(e.g. 5%)
→
REMAINING 95%
split pro-rata among
nominators
DAY 35 / 40
>> The deterrent

Slashing — graduated penalties for misconduct

Offence Slash Amount Who Loses
Being offline / unresponsive Small % (0.1%) Validator only
Equivocation (double-signing) Up to 100% Validator + all nominators
Coordinated attack Up to 100% Validator + all nominators
DAY 35 / 40
>> 11:00 – 12:00 · Lab

Today's lab — Validator Research

CORE Validator deep dive

Go to polkadot.js.org/apps/#/staking. Pick one active validator. Record:

  • Total stake (self + nominated)
  • Number of nominators
  • Commission %
  • Any slash history
  • Validator's identity (if set)

Write findings as Python comments.

STRETCH ★ Compare three validators

Find one high-stake validator, one medium-stake, and one new/small validator.

Compare their commission, nominator count, and uptime. Which would you nominate and why? Write a short comment explaining your reasoning.

>> End of Day 35

NPoS in three sentences

  • ✓Validators produce blocks; nominators back them with DOT — both earn rewards, both risk slashing.
  • ✓The Phragmén election algorithm distributes stake evenly to prevent centralisation.
  • ✓Your Day 27 weighted_choice() was a simplified version of this — the real algorithm adds fairness balancing.
01 / 9
←/→ navigate   F fullscreen