Talk to an engineer →

How Proof of Stake works: validators, staking and slashing

Charles-Edouard Ladari
Charles-Edouard Ladari
Massive Sombrero · Published · Updated
SHORT ANSWER

A blockchain is a shared ledger of blocks, each linked to the previous one by a cryptographic hash and copied by many independent nodes. In Proof of Stake, validators lock up the network's token as a stake, take turns proposing blocks, and audit each other's blocks by re-executing them and voting. A validator caught signing conflicting blocks is slashed: part of its stake is burned and it is forced out of the network.

What is a blockchain?

A blockchain is a ledger of transaction blocks copied by many independent nodes, where each block carries the cryptographic fingerprint (hash) of the previous one, so changing an old block breaks every link after it.

Hashes, linked blocks and why the network rejects a changed copy are explained step by step, with a diagram, in How blockchains work: blocks, gossip and Proof of Work. This guide starts from there and covers what Proof of Stake changes.

What is Proof of Stake?

In Proof of Stake, validators lock up the network's token and are selected to propose and attest blocks, instead of competing with computation.

Locking up tokens is called staking, and the stake is what a validator can lose if it cheats. On Ethereum, a validator deposits 32 ETH into a deposit contract, as described in the Ethereum documentation on Proof of Stake.

Time is divided into slots, and in every slot one validator is randomly selected to propose the next block. A bigger stake means more chances to be selected, never a guarantee.

The proposer builds the block from pending transactions and broadcasts it. The other validators then check it and vote, as the diagram below shows step by step.

PROOF OF STAKE · SLOT 12 · STEP 1/5
Validators lock coins in a staking contract. The stake is what they can lose if they cheat.
STAKING CONTRACT
320 locked
stake = skin in the game
VALIDATORS
v1 · stake 32
v2 · stake 80
v3 · stake 48
v4 · stake 120
v5 · stake 40
Proof of Stake: stake-weighted selection, voting and slashing. Stake values are illustrative.
Proof of Stake, step by step
StepWhat happensWhy it matters
StakeValidators lock up the network's token in a deposit contractThe stake is what a validator can lose if it cheats
SelectIn every slot, one validator is randomly selected to propose a blockNo single party decides who adds the next block
ProposeThe proposer builds a block from pending transactions and broadcasts itEvery node receives the block through gossip
AuditValidators re-execute the block's transactions and send a signed vote (attestation)Invalid blocks are rejected before they become final
FinalizeCheckpoints backed by two-thirds of the total stake become finalReverting a final block would get the attackers slashed
SlashProvable cheating burns part of the stake and forces the validator outCheating costs more than it can earn

How do nodes share transactions and blocks?

Nodes relay new transactions, blocks and votes to their peers, without a central server, in a process called gossip.

A new payment reaches a few nodes first and then spreads across the network. A block built by the proposer travels the same way, and validators send their votes by gossip too, so every node can count them.

Why gossip keeps working when some nodes go offline is shown in the gossip diagram of How blockchains work.

How are validators audited and slashed?

Every block is audited by other validators, and a validator that provably cheats is slashed: part of its stake is burned and it is forced out.

When a block is broadcast, validators re-execute its transactions to check that the changes are valid, then send a signed vote for it, called an attestation. For each slot, a committee of validators is chosen at random, and its votes decide whether the block is valid.

Slashing applies to three kinds of provable cheating: proposing and signing two different blocks for the same slot, voting for two different blocks for the same slot, and casting a vote that surrounds an earlier vote. Each one leaves two signatures that contradict each other, as listed on the Ethereum page on rewards and penalties.

Any node that sees both signatures can turn them into a proof, and the block proposer that includes it on chain is rewarded. The protocol then burns part of the stake at once and removes the validator over a period of 36 days.

Halfway through that period, an extra penalty applies, and it grows with the total stake slashed in the same weeks. A validator slashed alone loses a small part of its stake, while many validators slashed together can lose all of it, which makes coordinated attacks expensive.

Being offline is not slashing. A validator that misses its duties only loses the rewards it would have earned, unless the network stops finalizing blocks, in which case inactive validators lose stake gradually until the active ones hold enough to finalize again.

AUDITING AND SLASHING · STEP 1/4
Every block is audited: validators re-execute its transactions, then send a signed vote (an attestation) for it.
BLOCK #1044
proposed by v2
4 of 5 votes in ✓
VALIDATORS
v1
stake
✓ valid · voted
v2
stake
✓ valid · voted
v3
stake
✓ valid · voted
v4
stake
re-executing…
v5
stake
✓ valid · voted
offline validator → missed rewards, not slashing
Auditing and slashing: a provable double signature costs part of the stake and the validator seat.

How does a block become final?

A block becomes final once validators holding two-thirds of the total stake have voted for it, through checkpoints.

On Ethereum, the first block of each epoch is a checkpoint. When a pair of checkpoints receives votes representing at least two-thirds of the total staked ETH, the more recent one is justified and the earlier one is finalized, as described in the Ethereum documentation on Proof of Stake.

Reverting a finalized block would require validators holding at least a third of the stake to sign conflicting votes, and those signatures would get them slashed. Finality therefore comes with a clear price for anyone trying to undo it.

How does Proof of Stake differ from Proof of Work?

Proof of Stake secures the network with stake that can be lost, while Proof of Work secures it with computation that must be spent.

In Proof of Work, miners race to find a valid block and nodes follow the chain with the most accumulated work, as explained in How blockchains work: blocks, gossip and Proof of Work. In Proof of Stake, a proposer is selected instead, and finality comes from votes rather than from more blocks piling up.

Ethereum moved from Proof of Work to Proof of Stake in an upgrade called The Merge. Bitcoin still uses Proof of Work.

What does this mean for a product built on a blockchain?

For a payment product, Proof of Stake gives a clear point at which a payment can be treated as settled: when its block is final.

Before finality, a payment is included but could still be reorganized in rare cases. A product can show it as pending, then confirm it once the block is final.

Choosing a chain for a payment product is covered in Stellar vs EVM vs Polkadot for stablecoin payments. Massive Sombrero's Services list the chains it supports, and Selected work shows its production projects.

Frequently asked questions

What is Proof of Stake in simple terms?

Proof of Stake is a way for a blockchain network to agree on new blocks without a central party. Validators lock up the network's token as a stake, one is randomly selected to propose each block, the others check it and vote, and a validator that cheats loses part of its stake.

How much do you need to stake to run an Ethereum validator?

A validator on Ethereum deposits 32 ETH into the deposit contract, according to the Ethereum documentation on Proof of Stake.

How is the block proposer chosen in Proof of Stake?

In every slot, one validator is randomly selected to propose the block. A bigger stake means more chances to be selected, but never a guarantee.

What is slashing in Proof of Stake?

Slashing is the penalty for provable cheating. Part of the validator's stake is burned at once, the validator is forced out of the network, and an extra penalty applies that grows with the total stake slashed around the same time.

What gets a validator slashed?

On Ethereum, three actions: proposing and signing two different blocks for the same slot, voting for two different blocks for the same slot, and casting a vote that surrounds an earlier vote.

What happens to a validator that goes offline?

It is not slashed. It loses the rewards it would have earned, and if the network stops finalizing blocks, inactive validators lose stake gradually until the active ones hold enough stake to finalize again.

When is a block final in Proof of Stake?

On Ethereum, a block is final once a pair of checkpoints receives votes from validators representing at least two-thirds of the total staked ETH. Reverting it would get those who sign conflicting votes slashed.

Is Proof of Stake less secure than Proof of Work?

They are secured differently. Proof of Work relies on computation that an attacker would have to outspend, while Proof of Stake relies on staked tokens that an attacker would have to acquire and would lose by misbehaving.

Talk to an engineer

A first call with Massive Sombrero clarifies goals, constraints and timeline.

Talk to an engineer

More from the blog