- What is labeling?
- What's coin control?
- How do you label your UTXOs?
- How to choose the right UTXOs?
- Understanding automatic UTXO selection
- Tutorial on UTXO labeling
As we discovered in the section on string analysis, numerous heuristics and patterns can be used to infer information about a transaction. As a user, it's important to be aware of these techniques in order to better protect yourself against them.
This involves rigorous management of your wallet in self-custody, which means knowing the origin of your UTXOs, as well as carefully selecting which UTXOs to consume when making payments. This efficient wallet management relies on two important features of good Bitcoin wallets: tagging and coin control.
In this chapter, we'll look at these features and see how you can use them intelligently, without adding too much workload, to greatly optimize your privacy on Bitcoin.
What is labeling?
Labeling is the practice of assigning an annotation or label to a specific UTXO in a Bitcoin wallet. These annotations are stored locally by the wallet software and are never transmitted over the Bitcoin network. Labelling is, therefore, a personal management tool.
For example, if I have a UTXO from a P2P purchase on Bisq with Charles, I could label it "
Non-KYC Bisq Charles".Tagging is a good practice that helps to remember the origin or intended destination of a UTXO, which therefore facilitates the management of funds and the optimization of privacy. Indeed, your Bitcoin wallet surely secures several UTXOs. If the sources of these UTXOs are different, you may not want to merge these UTXOs in the future; otherwise, you could reveal their common ownership. By properly labeling all your UTXOs, you can be certain that you'll remember where they originated from when you need to use them, even years later.
What's coin control?
The active use of labelling becomes even more interesting when coupled with a coin control option on your wallet software.
Coin control is a feature found in good Bitcoin wallet software, giving you the ability to manually select specific UTXOs to use as inputs to complete a transaction. In fact, in order to satisfy an output payment, you need to consume an input UTXO in return. For several reasons, which we'll examine later, you may want to select precisely which UTXOs to use as inputs to fulfill a specific payment. This is exactly what coin control allows you to do. To provide an analogy, this feature is similar to selecting a specific coin from your wallet when you pay for your baguette.
The use of wallet software with coin control, coupled with UTXO labeling, enables users to both distinguish and accurately select UTXOs for their transactions.
How do you label your UTXOs?
There's no one-size-fits-all method of labeling UTXOs. It's up to you to define a labeling system that's easy to understand for your wallet. In any case, keep in mind that good labeling is labeling you can understand when you need it. If your Bitcoin wallet is primarily intended for savings, the labels may not be useful to you for decades to come. Ensure they're clear, precise, and comprehensive.
It's essential that your loved ones can easily identify the origin of the funds if, one day, they need to access your wallet. This will help them both for reasons of confidentiality and for legal purposes, should they need to justify the origin of the funds to an authority.
The most important thing to note on the label is the source of the UTXO. You should simply indicate how the coin came to be in your wallet. Is it the result of a purchase on an exchange platform? An invoice payment from a customer? A peer-to-peer exchange? Or does it represent the change of an expense? For example, you could specify:
remove Exchange.com;customer payment David;buy P2P Charles;Change sofa purchase
To fine-tune your UTXO management and respect your fund segregation strategies within your wallet, you could enrich your labels with an additional indicator that reflects these separations. If your wallet contains two categories of UTXO that you are keen not to mix, you could incorporate a marker into your labels to clearly distinguish these groups. These separation markers will depend on your own criteria, such as distinguishing between UTXOs resulting from an acquisition process that involves KYC, or between professional and personal funds. Taking the label examples mentioned above, this could translate into:
KYC - Withdrawal Exchange.com;KYC - Customer Payment David;NO KYC - Buy P2P Charles;NO KYC - Change sofa purchase
It is also advisable to perpetuate the labeling of a UTXO over the course of transactions. For example, when consolidating UTXO no-KYC, be sure to mark the resulting UTXO not just as
consolidation, but specifically as consolidation no-KYC to keep a clear record of where the coins came from.Finally, it's not mandatory to put a date on a label. Most wallet software already displays the transaction date, and it's always possible to find this information on a block explorer thanks to its TXID.
How to choose the right UTXOs?
When you perform a transaction, the coin control lets you specifically choose which UTXOs to consume as inputs to satisfy the payment output. There are two aspects to this choice:
- The possibility for the recipient of the payment to link part of your identity to the UTXOs used in inputs;
- The ability of an external observer to establish links between all the UTXOs consumed as inputs.
To illustrate the first point, let's take a concrete example. Suppose you buy bread in bitcoins from your baker. You use one or more UTXOs that you hold as inputs to meet at least the price of the baguette in outputs, as well as the transaction fees. Your baker could then potentially associate your face, or any other part of your identity that he knows, with the coins used as inputs. Knowing the existence of this link, you may prefer to choose a specific UTXO over another when making a payment.
For example, if one of your UTXOs comes from an exchange platform and you'd rather the baker didn't know about your account on that platform, you'll avoid using that UTXO for payment. If you have a high-value UTXO that reveals a significant amount of bitcoins, you might also choose not to use it to avoid the baker becoming aware of your BTC fortune.
Choosing which UTXOs to use for this first point is, therefore, a personal decision, influenced by what you are willing to reveal or not. The labels you assign to your UTXOs when you receive them will help you select those which, once spent, only expose information you're comfortable revealing to the recipient.
Beyond the information potentially revealed to the recipient, the choice of inputs also influences what you reveal to all observers of the blockchain. Indeed, by using several UTXOs as inputs to your transaction, you reveal that they are owned by the same entity, according to the CIOH heuristic (Common Input Ownership Heuristic).
When selecting your UTXOs, therefore, you need to be aware that the transaction you're about to broadcast will create a link between all the UTXOs used. This link can pose a risk to your personal privacy, especially if the UTXOs originate from different sources.
Let's take the example of my no-KYC UTXO from Bisq; I want to avoid combining it with a UTXO from, say, a regulated exchange platform that knows my identity. Indeed, if I ever use these 2 UTXOs as inputs to the same transaction, the regulated platform will be able to link my identity with the UTXO I bought on Bisq, which was not previously linked to my identity.
Finally, when choosing which UTXOs to use as inputs to a transaction, the most important thing is to avoid using multiple UTXOs. At most, when you can, select a single coin large enough to satisfy your payment. In this way, you completely avoid the risks associated with CIOH. However, if no single UTXO is sufficient for payment and you need to consume several, make sure they come from similar sources to minimize the risk of unwanted links. Also, bear in mind that the recipient may associate the information they hold about you with the history of coins used in transactions.
Understanding automatic UTXO selection
In the previous sections, we discussed the manual selection of UTXOs to be used for a transaction. But what happens when the wallet software performs this selection automatically? Several methods exist for determining which coins to consume, and the selection of UTXOs constitutes a veritable field of research on Bitcoin. The primary objective of this automated process is often to minimize transaction costs for the user.
UTXO selection methods such as FIFO (First In First Out) and LIFO (Last In First Out) are among the simplest, but also the least efficient. With FIFO, the oldest UTXOs in the wallet are used first. This approach is generally inefficient for both minimizing transaction costs and preserving confidentiality, except in cases where relative timelocks are used and need to be renewed regularly. Conversely, LIFO prioritizes the use of the most recent UTXOs. Both methods, though simple, often prove ineffective.
A more advanced method is the Knapsack Solver. This was used on the Bitcoin Core wallet until version 0.17. It consists of iteratively and randomly selecting UTXOs from the wallet, adding them in subsets, and retaining the solution that minimizes the transaction weight as much as possible, thereby reducing the cost to the user.
The Branch-and-Bound (BNB), often nicknamed the "Murch algorithm" after its inventor, has replaced the Knapsack Solver in Bitcoin Core as of version 0.17. This more advanced method aims to find a set of UTXOs that corresponds exactly to the amount required to satisfy the transaction's outputs. The objective of BNB is to minimize the change amount and fees by reducing the so-called waste criterion, which considers both the immediate costs and the expected future costs of the exchange. This method is derived from the original concept of Branch-and-Bound, conceived in 1960 by Ailsa Land and Alison Harcourt, and offers a more precise optimization of fees than the Knapsack Solver.
All these automatic UTXO selection methods may be effective in reducing transaction costs, but they are often ineffective in preserving user confidentiality. Indeed, these algorithms can merge several UTXOs into inputs, thus revealing a common property of these UTXOs due to CIOH. Obviously, these methods cannot account for the labels affixed to the UTXOs, which are nonetheless crucial for consciously choosing which UTXOs to reveal to the transaction recipient. At present, the only way to optimize confidentiality when selecting coins is to do so manually.
Tutorial on UTXO labeling
If you'd like to find out how to tag your UTXOs, we've done a comprehensive tutorial on the main Bitcoin wallet software out there:
Quiz
Quiz1/5
btc2044.2
What is the purpose of the coin control option in Bitcoin wallet software?
