Your wallet holds a collection of UTXOs. When you send a transaction, a coin selection algorithm decides which ones to consume. This choice affects fees, privacy, and the long-term health of your wallet.
The problem is surprisingly deep. Say you want to send 65 ₳ and your wallet holds UTXOs of 5, 8, 10, 12, 15, 20, 30, and 50 ₳. There are multiple valid combinations: 50 + 20 (change: 5 ₳), 50 + 15 (exact match!), 30 + 20 + 15 (change: 0), 30 + 20 + 10 + 5 (change: 0), and many more. Each choice has consequences.
More inputs means a larger transaction in bytes, which means higher fees. But always picking the biggest UTXOs leaves behind a growing pile of tiny “dust” UTXOs that become uneconomical to spend. And spending UTXOs together in a single transaction suggests to observers that they belong to the same owner, affecting privacy.
This is why coin selection algorithms exist: to balance these competing goals automatically.
Three major approaches, each with distinct trade-offs.
Always picks the biggest available UTXOs until the target amount is covered. Simple, fast, predictable.
Randomly selects UTXOs to cover the amount, then keeps adding random inputs aiming for roughly twice the payment value, so the change output ends up close to the payment itself.
Tries to find a combination that exactly equals the target (no change needed). Falls back to other strategies when no exact match exists.
| Property | Largest First | Random Improve | Exact Match |
|---|---|---|---|
| Input count | Minimal | Variable | Variable |
| Fee efficiency | Good short-term | Balanced | Optimal (if found) |
| UTxO set health | Degrades over time | Maintains balance | Depends on fallback |
| Change output | Usually small | Targets payment size | None (ideal case) |
| Privacy | Predictable pattern | Randomized | Minimal footprint |
| Computational cost | Low (sort once) | Low (random draws) | Exponential (subset search) |
Enter a send amount and see how each algorithm picks UTXOs from the same wallet.
When UTXOs become so small that spending them eats a large share of their value in fees, they are called “dust”. Bad coin selection creates dust. Good coin selection prevents it.
6 UTXOs · avg 30 ₳ · no dust
10 UTXOs · 7 near-minimum · fragmented
On Cardano, every UTxO has a minimum ada requirement (minUTxO). A UTxO must hold enough ada to cover its on-chain storage cost, around 1 ada for a plain-ada output. Outputs below that threshold cannot be created at all, so on Cardano “dust” means UTxOs sitting just above the floor, like the 1 to 2 ada coins above. This is a protocol-level defense against UTxO set bloat, but each near-minimum UTxO still adds size and fee when spent, so smart coin selection is still essential to keep wallets efficient and fees low.
Every transaction links its inputs together. Coin selection directly impacts how much of your wallet structure you reveal on chain.
When multiple UTXOs are spent together in one transaction, an observer will usually assume they belong to the same owner. This “common input ownership heuristic” is a guess, not a proof: collaborative transactions and batchers combine inputs from different people. Still, the more UTXOs you combine per transaction, the more you tend to reveal.
Largest First is predictable. It picks UTXOs in a fixed order, which makes spending patterns easier to recognise, although it often needs fewer inputs and so links fewer UTXOs per transaction. Random selection breaks the pattern at the cost of sometimes combining more inputs.
Exact Match avoids the change output when a fitting combination exists, so there is no change to trace back to you. If the match needs many inputs, it links all of them instead. None of the strategies wins on privacy in every situation, and on Cardano a shared stake key already links a wallet’s base addresses anyway.
When a transaction has two outputs, chain analysts try to figure out which one is the payment and which is the change. Round amounts are usually payments (50 ₳). Odd amounts are usually change (13.847 ₳). Good wallets can mitigate this with techniques like multiple change outputs or change address rotation.
Cardano’s eUTxO model adds unique considerations to coin selection: native tokens, datum storage, and multi-asset UTXOs.
Multi-asset UTXOs make selection harder. A single UTxO on Cardano can carry ada plus multiple native tokens. When you want to send a specific token, the algorithm must also consider the ada bundled with it, and ensure the remaining ada covers minUTxO requirements.
Datum size affects fees. UTXOs locked at script addresses carry datums, which increase the transaction size. Coin selection must account for the byte cost of including datum-heavy UTXOs as inputs.
Cardano wallets typically implement CIP-2 selectors, with Random Improve (and Largest-First as fallback) adapted for multi-asset selection. The algorithm first selects enough to cover the ada requirement, then ensures all requested tokens are also covered, and finally optimizes the change output to maintain a healthy UTxO distribution. Concrete defaults vary by wallet and have changed over time.
Cardano has a formal Improvement Proposal (CIP-2) that specifies coin selection algorithms for ada-only UTxOs. It describes Largest-First and Random-Improve, and notes that the Cardano wallet prioritises Random-Improve because it keeps a healthier UTxO set. Paying fees is explicitly outside its scope, and multi-asset selection came later in wallet implementations that build on these ideas.
Optional. Score 3/3 to earn mastery badges. Your first attempt counts for the Polymath badge. Questions and answer order are randomised on every attempt.