The Bitcoin blockchain, chainstate and reorganizations
The blockchain is a validated history of blocks, while chainstate is the current set of spendable outputs derived from that history. Follow headers, proof of work, transaction validation, atomic state updates and temporary branch changes without treating a block explorer or miner as the source of truth.
28 connected lessons Practice in every lesson
01
See the whole system first
Each specialist lesson expands one relationship in this end-to-end map.
01
Receive a candidate
A peer announces a header or block but does not make it trusted.
02
Check the header
The prior hash, target, time, Merkle root and proof of work must satisfy contextual rules.
03
Check transactions
Every transaction, Script, amount, fee and issuance claim must be valid in order.
04
Update chainstate
The node removes spent UTXOs and creates new UTXOs only after the whole block passes.
05
Compare work
Among valid branches, the node selects the chain with the most accumulated proof of work.
06
Reorganize if needed
Disconnecting one valid branch and connecting another reverses and reapplies exact state changes.
You will be able to trace a block from peer announcement to chainstate, compare competing branches by accumulated work and explain exactly what disconnects and reconnects during a reorganization.
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
Parse raw blocks and blk.dat record boundaries
Read mainnet magic, little-endian block length, the complete 80-byte header, CompactSize transaction count, nBits exponent and coefficient, target, proof of work, and the next record offset.
Required cases complete: 0/3.
Choose an outcome, then execute the exact bytes or rule.
4 LIVE BITCOIN UTILITIES
Calculate the bitcoin blockchain, chainstate and reorganizations
Use real learner input rather than a prewritten answer. Every result is calculated locally from the fields shown and invalid data fails closed.
Hashes
HASH256
Apply SHA-256 twice to UTF-8 text.
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.