Under the hood

Ch 10 · What a Transaction Actually Is

Under the hood progress: chapter 1 of 8
You chose: Under the hood

What a Transaction Actually Is

Hook

A bitcoin “send” is not a balance field subtracting numbers in a company database. It is a small message that unlocks value you control and locks it for someone else—recorded for the whole network to verify.

One idea

A Bitcoin transaction consumes inputs (existing coins you unlock with keys) and creates outputs (new coins locked to recipients); whatever value is left between inputs and outputs is the fee that motivates miners to include it.

Plain walkthrough

Inputs unlock. An input points at a previous output that still has not been spent—an amount sitting on the ledger that your keys can authorize. When you spend, you prove (with a signature your wallet creates) that you control those keys. That proof unlocks the old output so its value can be reassigned. You do not “edit a balance line”; you spend specific prior coins.

Outputs lock for someone else. An output creates a new locked amount: “this many sats can be spent by whoever satisfies these conditions,” usually “controlled by the keys behind this address.” The receiver’s wallet watches for outputs it can spend later. Your payment to them is an output; any leftover returning to you is also an output (often called change—Chapter 11).

The shape of one transaction.

  1. Gather one or more inputs (coins you can unlock).
  2. Create one or more outputs (payee, and usually change back to yourself).
  3. Leave a gap: sum of input values − sum of output values = fee.
  4. Sign, then broadcast. Nodes check the math, the signatures, and the rules. Miners may include the transaction in a block; then it is confirmed.

Fee intuition without the auction yet. The fee is not a separate “tax line” you attach from a bank. It is the leftover value in the transaction that nobody’s output claims—so miners who build the next block can collect it. Bigger transactions (more data) and busier times usually mean you offer a higher fee-rate to get in sooner. Chapter 12 unpacks the mempool auction; here, only the accounting identity matters: inputs fund outputs plus fee.

Why this model matters. Bank apps show one balance and hide the plumbing. Bitcoin wallets often show one balance too—but underneath, every spend names real prior coins (inputs) and creates new locked coins (outputs). That is why a send can create change, why fees depend on transaction size, and why “the money” is always a set of spendable pieces on the ledger (next chapter: UTXOs).

A short metaphor after the mechanism: imagine cashing in specific bills at a counter, handing the clerk new envelopes labeled for the recipient (and one envelope back to you), and leaving a tip on the counter equal to what did not go into any envelope. The tip is the fee; the envelopes are outputs; the bills you handed in are inputs.

What gets verified. Nodes check that inputs were not already spent, signatures are valid, values do not inflate money out of thin air, and scripts meet the rules. Nobody needs to trust your wallet’s screenshot; the ledger entry is public and checkable. That does not mean every user must run a node on day one—it means the system’s claim is inspectable.

Watch-outs

  • “Balance went down, so it sent” — Your wallet may show pending changes before confirmation. Look at transaction status, not only the big number.
  • Fee is leftover, not magic — If outputs claim almost all input value, the fee is tiny and inclusion may be slow. If you mis-build (rare in good wallets), you could overpay a fee by sending too little to outputs.
  • Inputs are all-or-nothing pieces — You generally spend whole prior outputs and take change back; you do not slice a coin in place without creating new outputs (Chapter 11).
  • Signatures authorize; addresses receive — Sharing an address does not authorize spends. Signing inputs does.
  • Explorer views look scary — Long hex ids and many addresses are normal. Focus on: which inputs were spent, which outputs were created, fee, and confirmation count.

You now can…

  • Describe a transaction as inputs unlock → outputs lock, with fee = inputs − outputs.
  • Separate authorization (signatures on inputs) from destination (outputs / addresses).
  • See why wallets talk about pending, change, and fees as parts of one object—not as three unrelated mysteries.

What next?

Ebook: continue to Ch 11

Back one stepReturn to map