In order to reduce commission costs for Bitcoin (BTC) transactions, the Xapo crypto wallet nested around 4 million UTXO (Unspent Transaction Output) through batch payments or batching.
In a Bitcoin (BTC) wallet, however, each output amount is independent of other amounts received. Thus, if a user gets 0.01 BTC, 0.1 BTC, and 0.09 BTC in his wallet, he can see a total number of 0.20 BTC, but each of these amounts is kept separate from the others, and the user can check it by consulting the details of his transactions. These amounts, in turn, come from transactions previously made.
In the event that such a user wishes to send a total of 0.007 BTC to another address, the crypto wallet would select one of the available outflows, for example, 0.01 BTC, and there would remain a ‘change’ of 0.003 that would return to its portfolio with a new address, ready to be used in a future transaction.
The 0.007 BTC that the user had sent becomes a sold-out output. The 0.003 remaining from the previous transaction and the 0.1 BTC and 0.09 BTC that have not been yet used are known as the unspent transaction output or UTXO.
Xapo crypto wallet nested 4 million UTXO to reduce Bitcoin (BTC) transactions costs
The consolidation process used in Xapo is in charge of joining UTXO in a process that could be compared to the defragmentation of a hard disk. This procedure, according to Anthony Towns, Xapos’ Bitcoin Core developer, allows you to combine entries before making a transaction, in order to have greater control over transaction costs, since the fewer UTXOs to process, the lower the load on the network.
When the average of your outgoing payment is greater than your average incoming payment (or when they are the same, but you are making lots of outgoing payments), you will often have to combine many UTXO in order to finance one outgoing transaction, which increases the fees you pay. By consolidating UTXOs in advance, you can combine tickets in advance, giving you more control over when most of those costs are incurred.
Anthony Towns, Xapo’s Bitcoin Core developer
For nesting more than 4 million UTXOs, the Xapo team combined multiple Bitcoin (BTC) payments, known as batching, into a few transactions. To do this, they used a script that selected groups of small UTXO and created a consolidation transaction that spent them on a single group address at a rate of 1.01 Satoshis per byte.