Transactions and UTXOs

A UTXO is like a coin sitting in your wallet that hasn’t been spent yet.
Once you spend it, it stops being a UTXO and is replaced by new UTXOs created by the transaction.
You can see UTXOs like the change in your wallet; each coin or note you have in your wallet is like an UTXO of which you control.
Let’s say that you look in your wallet and find one $50 note, one $5 note, and one $2 coin, giving you a total balance of $57.

This is very similar to what your Bitcoin wallet does to work out your balance. It keeps track of all the UTXOs that your private keys control, sums them up, and shows you the total.

UTXO's are like the notes in your wallet, except that it can be any amount from 0.00000001 to 21 millions BTC.
Alice is selling a T-shirt for 20 Bitcoins, and you want to buy it.
We know that you have enough since your wallet shows a balance of 57 Bitcoins.
You then prompt your wallet to create a transaction to Alice’s address. Your wallet will then look at all the UTXOs that your private key controls and find the most efficient way to send that specific amount to Alice.
Since you’re looking to send 20 Bitcoins plus the transaction fee, the 5 Bitcoins and 2 Bitcoins UTXOs aren’t enough.
Your wallet will only use your 50 Bitcoin UTXO.





How does transaction fees work?
Unlike traditional payment systems, where transaction fees are calculated based on the amount you’re sending, Bitcoin’s transaction fees are based on the weight per unit, or how much data you’re sending.
The current network fee is expressed in sat per vB (sat/vB).

The more inputs and outputs you have in a transaction, the bigger in size it will be.

Even though the 2nd transaction actually paid less in fee rate, the total fee is 2.5x higher due to its size.

A good UTXO management will avoid you paying high fees in the future.
Each time you receive Bitcoin, your amount of “change” UTXOs grows. Which means that when you spend them, your transaction will be bigger and accrue more fees.
In times of low fee rate, such as 1 to 5 sat/vB, it’s recommended to regroup your small UTXOs to a new Bitcoin address.
When fees spike again, it’ll be a lot cheaper to send 1 UTXO containing 1 Bitcoin rather than 1 Bitcoin spread across 10 UTXOs.

To do so, simply send Bitcoins to yourself using your preferred wallet using a new, unused address.
It’ll re-group all of your current UTXOs as input and send them to one output, that new address.

That new address of 57 Bitcoins is now the only UTXO that you have control of. It’ll be a lot cheaper to send Bitcoin next time since there will only be one input instead of three.

At 1sat/vB, it might seem meaningless to group your UTXOs, but fee rates can change radically at any time.
Those are transactions from December 2023, with an average fee rate of 146 sat/vB.

Keep an eye on the current fee rate for a good time to consolidate your UTXO's here:

