Free lessonUnderstanding Bitcoin · 3/43 min read

How Bitcoin transactions work: UTXOs, fees and custody

Bitcoin's UTXO model explained with coins and change, how mempool fees work, and the trade-offs of exchange custody vs. self-custody.

Bitcoin does not track balances the way a bank account does. Instead it tracks individual pieces of bitcoin. Understanding this helps explain fees, change addresses and why wallets behave the way they do.

UTXOs in simple words

A UTXO (unspent transaction output) is a piece of bitcoin you received and have not spent yet. Think of UTXOs as bills in a physical wallet. Your "balance" is just the total of all the bills you hold.

When you pay, you must hand over whole bills. If they add up to more than the payment, you get change back. In Bitcoin, the change goes back to an address in your own wallet, usually a new one your wallet creates automatically.

Example

Your wallet holds two UTXOs: 0.3 BTC and 0.5 BTC. You want to send 0.6 BTC. The wallet uses both (0.8 BTC total) as inputs. The outputs are 0.6 BTC to the recipient and about 0.1999 BTC back to you as change. The missing 0.0001 BTC is the fee, which goes to the miner. Inputs always equal outputs plus the fee.

Fees and the mempool

Unconfirmed transactions wait in the mempool. Miners usually pick the transactions that pay the most per unit of block space. Bitcoin fees are based on the transaction's size in data (measured in virtual bytes), not on the amount of bitcoin sent. A transaction using many small UTXOs is larger, so it can cost more than one using a single big UTXO, even if the amount sent is the same.

When the mempool is crowded, fees rise. When it is quiet, low fees are often enough. Most wallets suggest a fee for a fast, medium or slow confirmation.

Exchange custody vs. self-custody

If you buy bitcoin on an exchange and leave it there, the exchange holds the keys. This is custodial storage. It is simple, but you depend on the company. The collapses of Mt. Gox in 2014 and FTX in November 2022 left many customers unable to get their money back for a long time, or at all.

With self-custody, you control the private keys, often through a phone wallet or a hardware wallet such as Ledger or Trezor. Crypto users sum it up as "not your keys, not your coins." The trade-off: if you lose your seed phrase or send to a wrong address, nobody can help.

Before moving a large amount to self-custody, practice with a tiny amount first: send it, confirm it arrives, and test restoring your wallet from the seed phrase.
Save your progress — free

A free account tracks lessons, unlocks the quizzes and gives you 10,000 virtual USD (no real value) to practise with.

Create free account

Education, not investment advice. Crypto prices can fall sharply and most retail traders lose money. Practice in DUKOIN uses virtual USD with no real value.