Skip to content

Part 2 · Transactions & the UTXO Model

This part comes after Cryptography, because transactions are built from hashes and signatures.

Here’s the surprise that trips up most newcomers: in Bitcoin there are no account balances. There is no row that says “you own 2 BTC.” Instead there are UTXOs — discrete chunks of unspent coin, like physical bills in a wallet. This part makes that click.

We build up from “what is a coin?” to the full machinery of how value is locked, unlocked, and minted, in dependency order:

  1. UTXO vs the Account Model — coins as discrete “unspent outputs,” not balances; why your “balance” is just the sum of UTXOs you can spend, and how this differs from Ethereum’s account model.
  2. Anatomy of a Transaction — version, inputs, outputs (in satoshis), witness, and locktime; how inputs reference earlier outputs by (txid, vout).
  3. Fees, Change & the Conservation Rule — inputs ≥ outputs; the difference is the miner fee; why you need an explicit change output.
  4. Transaction IDs — double-SHA-256 of the serialized transaction; how UTXOs are addressed by (txid, index).
  5. Locking & UnlockingscriptPubKey (the lock on an output) and scriptSig / witness (the key that unlocks it); the challenge/response model.
  6. Bitcoin Script — the stack-based, intentionally-not-Turing- complete language, and why that’s a safety choice; common opcodes.
  7. Standard Scripts & Address Types — P2PK, P2PKH, P2SH, P2WPKH (SegWit), P2TR (Taproot) — and what an “address” really encodes.
  8. Coinbase Transactions — the special transaction that creates new coins in each block.

Signatures in context — the SIGHASH flags that decide what part of a transaction a signature commits to — get their own deep dive in SIGHASH flags.

How does the UTXO model help untrusting strangers agree on one ledger? (Preview: UTXOs make double-spends trivial to detect — a coin is either still in the unspent set or it isn’t.)