Slot election
Every 30 seconds the network elects one block. Each eligible stake output gets exactly one draw, and nobody, the owner included, can rank keys for a future slot before its beacon is fixed. Nobody else can know a miner's score until its header is published.
Spek calls a block producer a miner, the word the protocol and its software use. Mining here means submitting one candidate block per slot, not racing to find a hash.
One draw
A miner's score for the slot at height h is
score = middle_out( BLAKE3("spek/score/v2" ‖ B_e ‖ h ‖ pk ‖ r_h) )
B_eis the beacon for the epoch the slot belongs to (an epoch is 1,440 slots, 12 hours);his the height, which is also the slot number;pkis the miner's public key;-
r_his the miner's slot secret for that height: a value only the key owner can compute, unique per height, committed inside the stake output before the beacon existed.
middle_out measures how far the hash, read as a 256-bit number, sits from the centre of the hash space.
Both 0x00…00 and 0xFF…FF score the maximum, 2255; the two values either side
of the centre score 1. The highest score whose full block validates wins the slot.
Every input is fixed before the beacon it is drawn against exists, and the key sits inside the hash, so there is nothing to grind: no nonce, no key to swap in afterwards, and nothing a winner can re-sign or re-order to improve its own or any later draw. A copied commitment or a replayed slot secret gives the copier an independent draw, never the victim's score.
Try it
Add miners, each with a stake output and its own slot seed, then advance slots: each score appears only when its header is published, and the highest score wins. A second view advances epochs and shows where each beacon comes from, and lets one miner try to grind.
The sandbox needs JavaScript, and nothing else on this site does. Without it the figures on this page show the same rules: how a hash becomes a score, how a slot runs, and where an epoch's beacon comes from.
Slot secrets
Each miner key file holds a SQIsign Level I key pair and a 32-byte slot seed drawn from the operating system's random source, independent of the signing key. From the seed the node builds one hash chain per 3-day segment and reveals it backwards, one value per slot, so publishing a slot's secret exposes only values for heights already passed. The tops of 1,024 consecutive segment chains, about 8.4 years, form a Merkle tree whose root is committed in the stake output. That commitment is made before any beacon it will be drawn against exists, so for every key, commitment and height exactly one slot secret verifies.
A header carries the slot secret and its Merkle path. A verifier walks the secret up to its segment top, climbs the path, and uses the root it derives to rebuild the stake address. If the secret is wrong, there is simply no stake at that address.
The beacon
The beacon for epoch e is read from the chain's election seed at the last block of epoch e−2, a full epoch before epoch e starts. Every block mixes its winner's slot secret into the election seed, so the beacon cannot be predicted until that whole source epoch has been produced. It is the same on every fork that shares that history, which covers every propagation fork.
Stake counts only if it was created below a cutoff one full epoch before the beacon height. Anyone who learns a beacon is already too late to create a key, fund it and have it count for that beacon's epoch: new stake first counts 24–36 hours after it is created.
Why share equals draws
Any selection rule over independent uniform draws awards a party holding N of N+H draws exactly N/(N+H) of the slots. The election cannot change that, so what a draw costs to field is where the security lives. Spek prices it explicitly: see Eligibility. Because no winner schedule exists to read in advance, there is no predicted winner to attack or bribe.
Inside one slot
For the first 6 seconds only headers travel: 743-byte candidate headers flood the network and the ranking settles. From 6 to 30 seconds nodes pull full bodies only for the top three candidates and serve the top five. At the slot boundary each node commits the highest-ranked candidate whose full body is in hand and passes validation. If none does, every node builds the same null block.
A miner key gets one entry per slot. A second header from the same key with different signed content is equivocation: the key's entry is evicted for that slot, and a compact proof is passed on so every node does the same.