BA-08 · Advanced

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.

  1. Block structure

    A block header commits to version, prior block, transaction Merkle root, time, target, and nonce.

    35 minutes · Open lesson
  2. Proof of work

    Mining searches header variations for a hash below the target, making history costly to extend and rewrite.

    45 minutes · Open lesson
  3. Difficulty adjustment

    Bitcoin retargets periodically to keep average block production near ten minutes despite changing hash rate.

    55 minutes · Open lesson
  4. Block validation

    Full nodes independently check proof of work, transactions, scripts, issuance, weight, and contextual consensus rules.

    65 minutes · Open lesson
  5. Chain selection and reorgs

    Nodes follow the valid chain with the most accumulated work and may disconnect blocks during reorganization.

    35 minutes · Open lesson
  6. Coinbase and subsidy

    The coinbase creates permitted subsidy and collects fees, with maturity rules before its outputs can be spent.

    45 minutes · Open lesson
  7. Mining pools and templates

    Pools coordinate work and payouts; Stratum and template negotiation affect miner autonomy and centralization.

    55 minutes · Open lesson
  8. Attacks and security budget

    Double-spends, selfish mining, censorship, pool concentration, and fee-market uncertainty require economic analysis.

    65 minutes · Open lesson
  9. Raw 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 lesson
  10. Mining 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 lesson
  11. Block 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 lesson
  12. Version 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 lesson
  13. Block 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 lesson
  14. Soft 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