Learn › Module 2 of 6

How it works

Six objects explain everything: a key, an address, a transaction, a UTXO, a fee and a confirmation.

1. Keys and addresses

A private key is a very large random number. Whoever knows it can spend what it controls. A public key is derived from it, and an address is a short, readable form derived from the public key.

The direction matters:

So an address is safe to publish — it is a one-way label — and a key is never shared with anyone, ever.

Modern wallets do not handle one key: they handle a seed, from which a whole tree of keys (and therefore addresses) is derived deterministically. That is the trick that makes a 12-word backup enough for unlimited addresses (module 3).

2. What a transaction is

A transaction is a signed statement with two halves:

  1. inputs: which previously received amounts you are spending;
  2. outputs: who receives what, including (usually) one output back to you.

Each input carries a signature made with your private key. The network checks three things: the signature is valid, the inputs exist and are unspent, and the outputs do not create money out of nothing.

Then the transaction is broadcast: it is sent to nodes, which relay it to each other. It is now in the mempool — valid, visible, not yet in a block.

3. UTXOs: your balance is a pocket of notes

There are no accounts with a number. Coins exist as UTXOs — unspent transaction outputs. Each one has an amount and a condition (roughly: "spendable by whoever holds this address's key").

They behave like banknotes in a pocket:

Each UTXO also has an age (how many confirmations it has) and a cost to spend (the space it occupies in a future transaction). That is why wallets show you individual UTXOs, and why "coin control" exists (module 6).

Two consequences that surprise everyone:

4. Change: the part that comes back

If you spend a 100 000 sat UTXO to pay 30 000 sat, the transaction must declare where the remaining ~70 000 sat go. Leaving them unassigned would donate them to whoever mines the block.

So the wallet adds a second output: the change, paid to a new address of your own wallet. Seeing a transaction with two outputs is normal and does not mean you paid twice.

5. Fees: paying for space

A fee is not a percentage of the amount. It is the price of the space your transaction occupies in a block, measured in virtual bytes (vB), at a rate in sat/vB.

Total fee ≈ size × rate. Size depends mainly on the number of inputs: 1 input is small, 10 inputs are large. Amount is irrelevant to size.

6. Confirmations and mining

Miners collect transactions from the mempool and try to assemble a valid block. Producing a block requires solving a computational puzzle, which is what makes the history expensive to rewrite.

When a block containing your transaction is mined, you get 1 confirmation. Every further block adds one. Rough guide:

While a received UTXO has 0 confirmations it may appear as "not available": it is not missing, it is queued. The app tells you how many blocks it is waiting for.

7. Watch-only with an xpub

Your account's xpub is the public key from which all your addresses are generated. With it, software can watch your balance and history and still be unable to spend a single satoshi.

It is useful (a second device, an accountant, a spending device kept offline) and dangerous in one specific way: it is a privacy key. Publishing it exposes every address and every payment of that wallet (module 4).

Takeaway — A wallet holds keys, not coins. A payment spends whole UTXOs and creates new ones, one of which is your change. You pay for bytes, not for amount, and a payment is only final when blocks pile up on top of it.

8. Check yourself

  1. Can you receive money on the same address twice? Should you?
  2. Why does a transaction with 10 inputs cost more than one with 1 input?
  3. You paid 20 000 sat from a 100 000 sat UTXO with a 500 sat fee. How many outputs does the transaction have, and who owns them?