Skip to content

Revision · Transactions & the UTXO Model

Part 2 answered “what is a coin?” and “how does value move?” The throughline is that Bitcoin has no account balances — only discrete unspent outputs guarded by scripts — and that this choice is what makes double-spends trivial for any stranger to check.

  • UTXO vs the account model — there is no balance field; your balance is a derived sum of the discrete unspent outputs your keys can unlock, which makes a double-spend check as simple as “is this coin still in the unspent set?”
  • Anatomy of a transaction — five rigid fields (version, inputs, outputs, witness, locktime) that say “consume these coins, create these”; an input holds no money, only a pointer (txid, vout) to a prior output plus the proof to spend it.
  • Fees, change & conservationsum(inputs) ≥ sum(outputs), and the fee is never a field but the gap you leave; because coins are spent whole you must add a change output or you tip the miner the remainder.
  • Transaction IDs — a txid is the double-SHA-256 of the serialized transaction, so it’s self-certifying and tamper-evident, and coins are addressed by the (txid, index) outpoint that stitches the whole ledger together.
  • Locking & unlocking — every coin carries its own lock (scriptPubKey, the challenge) and spending means supplying a scriptSig/witness (the response); owning a bitcoin is nothing more than being able to make the lock evaluate to true.
  • Bitcoin Script — a stack machine deliberately not Turing-complete (no loops, hard size caps) so validation always halts and its cost is bounded before it runs — constraint chosen as a feature for a ledger every node must re-verify.
  • Standard scripts & address types — an address is a checksummed shorthand for a locking script, and the P2PK → P2PKH → P2SH → P2WPKH → P2TR evolution each fixed the last (smaller, malleability-proof, more private), rolled out as backward-compatible soft forks.
  • Coinbase transactions — the one privileged transaction per block allowed to break conservation, paying the miner subsidy + fees; it has a phantom input, doubles as the extranonce search space, and its outputs must mature 100 blocks before spending.

The UTXO model turns “is this payment valid?” into objective, locally-checkable, parallelizable set membership plus a script that runs to true — no balances to trust, no ordering puzzle. Value can’t be conjured because every node redoes the same subtraction, and new supply enters only through the capped, self-verifying coinbase. With coins defined and moving, the next question is how transactions get bundled and chained into a tamper-evident history.