freecoding.school100% FREE · NO SIGNUP
The EVM CoreISSUE #1 of 48

the beacon chain · the consensus layer

SoliaVSThe Reentrancy Reaper
Solia saysThe beacon chain is Ethereum’s consensus layer: a separate chain of slots and epochs, ticking every 12 seconds, with each validator staking 32 ETH.

The Merge split Ethereum into two layers: the execution layer (former PoW chain, runs the EVM) and the beacon chain, the consensus layer that orders blocks via PoS. Time on the beacon chain is divided into slots (12 seconds each) and epochs (32 slots = 6.4 minutes). Each slot has one proposer; each epoch is the finality boundary for Casper FFG.

Validators each stake 32 ETH, perform proposing and attesting duties, and earn rewards proportional to their participation. The active set is around a million validators, putting roughly 32 million ETH at stake. The demo lays out the time hierarchy and validator economics.

Power-ups you unlock

The Reentrancy Reaper attacks — common mistakes

Boss battleCompute slots and epochs per year, and the total ETH staked for a 1M-validator active set.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>
const slot = 12;
const slotsPerEpoch = 32;
const epoch = slotsPerEpoch * slot;
const slotsPerYear = (365 * 24 * 3600) / slot;
const epochsPerYear = slotsPerYear / slotsPerEpoch;
const stake = 32;
const activeValidators = 1000000;
const totalStaked = activeValidators * stake;
document.getElementById('o').textContent = [
  'beacon chain time hierarchy:',
  '  slot   = ' + slot + 's',
  '  epoch  = 32 slots = ' + epoch + 's ≈ ' + (epoch/60).toFixed(1) + ' min',
  '  finality (current FFG) = 2 epochs ≈ ' + ((2*epoch)/60).toFixed(1) + ' min',
  '  slots / year  = ' + Math.round(slotsPerYear).toLocaleString(),
  '  epochs / year = ' + Math.round(epochsPerYear).toLocaleString(),
  '',
  'validator economics:',
  '  stake per validator = ' + stake + ' ETH',
  '  active validators   ≈ ' + activeValidators.toLocaleString(),
  '  total ETH staked    ≈ ' + totalStaked.toLocaleString() + ' ETH'
].join('\n');
</script></body></html>
▶ Open the interactive comic issue
Attestations · Committees · Aggregation ›