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:
- key → address: always possible, and the app does it for you;
- address → key: computationally impossible.
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:
- inputs: which previously received amounts you are spending;
- 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:
- you cannot split one without spending it;
- to pay 30 you may need to hand over a 100 note and get 70 back;
- the sum of the notes is your "balance", computed by the wallet every time it looks at the chain.
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:
- sending to yourself changes nothing except your UTXO shape, and costs a fee;
- many small UTXOs are expensive to spend later, because each one adds bytes to the transaction.
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.
- Why pay at all: the fee is the reward for the miner who includes your transaction. It is not an app commission — none of it goes to this wallet's author.
- Why it varies: when the mempool is crowded, blocks are scarce and the price of space rises; when it empties, it falls.
- Choosing a rate: low = cheap and slow (may be dropped if the mempool empties); normal = the sane default; high = when time matters; custom = when you know the current market rate.
- Paying too little: the transaction waits. If it signalled replaceability, the app can bump the fee (RBF) by replacing it with a version that pays more.
- Dust: outputs below 546 sat are rejected by the network — they would cost more to spend than they are worth.
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:
- 0 — pending: valid, replaceable, not yet final;
- 1 — in a block: fine for small amounts between people who trust each other;
- 3+ — reasonably settled;
- 6+ — the traditional bar for large amounts.
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).
8. Check yourself
- Can you receive money on the same address twice? Should you?
- Why does a transaction with 10 inputs cost more than one with 1 input?
- 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?