Mining, blocks, and consensus
Follow a transaction from gossip to deeply buried block state.
Follow these 14 lessons in order, or choose the topic you need. Each lesson combines an explanation, a worked example and practice inside the Guild.
Block structure
A block header commits to version, prior block, transaction Merkle root, time, target, and nonce.
35 minutes · Open lessonProof of work
Mining searches header variations for a hash below the target, making history costly to extend and rewrite.
45 minutes · Open lessonDifficulty adjustment
Bitcoin retargets periodically to keep average block production near ten minutes despite changing hash rate.
55 minutes · Open lessonBlock validation
Full nodes independently check proof of work, transactions, scripts, issuance, weight, and contextual consensus rules.
65 minutes · Open lessonChain selection and reorgs
Nodes follow the valid chain with the most accumulated work and may disconnect blocks during reorganization.
35 minutes · Open lessonCoinbase and subsidy
The coinbase creates permitted subsidy and collects fees, with maturity rules before its outputs can be spent.
45 minutes · Open lessonMining pools and templates
Pools coordinate work and payouts; Stratum and template negotiation affect miner autonomy and centralization.
55 minutes · Open lessonAttacks and security budget
Double-spends, selfish mining, censorship, pool concentration, and fee-market uncertainty require economic analysis.
65 minutes · Open lessonRaw block anatomy and blk.dat
Decode disk framing, the 80-byte header, CompactSize transaction count, coinbase, ordinary transactions, witness commitment, and neighbouring block links.
35 minutes · Open lessonMining lifecycle and candidate blocks
Follow mempool selection, ancestor packages, template construction, coinbase and witness commitments, target search, broadcast, and independent full-node validation.
45 minutes · Open lessonBlock time, MedianTimePast, and future limits
Validate a candidate timestamp against the median of the previous eleven blocks and the receiving node's two-hour future-time limit.
55 minutes · Open lessonVersion bits and soft-fork activation
Decode the block-version marker and deployment bits, then follow period thresholds through DEFINED, STARTED, LOCKED_IN, ACTIVE, or FAILED.
65 minutes · Open lessonBlock height and BIP34 coinbase commitments
Encode the block height as the first minimally encoded Script number in the coinbase ScriptSig and keep it distinct from header fields.
35 minutes · Open lessonSoft forks, hard forks, and compatibility
Run one block through old and new rule sets to see subset restrictions, rule expansions, activation risk, and persistent chain splits.
45 minutes · Open lesson