DUCAT’SBitcoin Guild
All curriculum
COMPLETE MINING GUIDE

Blocks, mining, difficulty and consensus

Mining proposes an order for valid transactions and proves costly work over an 80-byte block header. Full nodes independently decide whether the result follows every rule. This route connects block bytes, target encoding, retargeting, chain selection, issuance and attack boundaries.

14 connected lessons Practice in every lesson
01

See the whole system first

Each specialist lesson expands one relationship in this end-to-end map.

  1. 01
    Template

    A miner orders valid packages and creates the coinbase and commitments.

  2. 02
    Header

    Version, prior hash, Merkle root, time, nBits and nonce total 80 bytes.

  3. 03
    Proof search

    The header hash must be numerically less than or equal to the target.

  4. 04
    Broadcast

    The discovered block is only a proposal sent to peers.

  5. 05
    Validation

    Every full node checks proof, transactions, issuance, scripts and context.

  6. 06
    Chain selection

    Among valid branches, the node selects the one with most accumulated work.

You will be able to parse raw block and blk.dat bytes, verify proof of work, explain retargeting and issuance, and reason about reorg and majority-hash-power risks.

02

Run the mechanism here

Predict first, execute exact bytes or rules, then change one input and inspect the first failed boundary.

EXACT MECHANISM WORKBENCH

Validate proof of work and calculate a full retarget

Decode nBits into a 256-bit target, compare the displayed block hash as an integer, calculate target-derived work and difficulty, then apply Bitcoin's 2016-block retarget with the quarter-to-four-times timespan clamp and integer truncation.

Predict the result
Required cases complete: 0/3.
6 LIVE BITCOIN UTILITIES

Calculate blocks, mining, difficulty and consensus

Use real learner input rather than a prewritten answer. Every result is calculated locally from the fields shown and invalid data fails closed.

Bytes

Reverse Bytes

Reverse complete hexadecimal bytes without reversing the characters inside each byte.

Ready to calculate

Change any field, predict what should change, then run the utility.

Safety boundary: This learning surface does not store inputs. Never paste a live seed phrase, private key, wallet backup, or confidential transaction.

03

Follow the mechanism in order

Start at the top for a guided route, or open any lesson directly.

01

Block structure

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

Teach, predict, run, explain
02

Proof of work

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

Teach, predict, run, explain
03

Difficulty adjustment

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

Teach, predict, run, explain
04

Block validation

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

Teach, predict, run, explain
05

Chain selection and reorgs

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

Teach, predict, run, explain
06

Coinbase and subsidy

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

Teach, predict, run, explain
07

Mining pools and templates

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

Teach, predict, run, explain
08

Attacks and security budget

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

Teach, predict, run, explain
09

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.

Teach, predict, run, explain
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.

Teach, predict, run, explain
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.

Teach, predict, run, explain
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.

Teach, predict, run, explain
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.

Teach, predict, run, explain
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.

Teach, predict, run, explain
04

Keep these boundaries clear

These distinctions stop the most consequential mistakes in this topic.

  • Miners order transactions but cannot make full nodes accept an invalid state transition.
  • nBits encodes a target, while difficulty is a human-friendly ratio derived from targets.
  • Height is derived from the parent chain and committed in modern coinbase inputs, not stored as a general header field.