A suggestion for reducing the size of the UTXO database [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2015-05-26T12:40:28+00:00


Summary:

Building a transaction in Bitcoin can lead to the growth of the Unspent Transaction Output (UTXO) database. The current practice is to select the minimum number of unspent outputs from a specific address for a transaction. However, a proposal suggests that all UTXOs from a particular address or wallet should be selected instead. This approach involves sending the required amount to the payee and sending the remaining funds back to the same address or a change address as a single output. By consolidating unspent outputs in this way, the UTXO database would gradually decrease in size over time, preventing its continuous growth.Implementing this solution poses some challenges. Spending unconfirmed outputs requires a different security model for the receiver, and wallet software may refuse to spend unconfirmed outputs. There is also a proposal for a fork/merge design where the network calculates the change instead of the submitter. This would allow transactions with the same change address and a common input to be merged or split, but it has privacy implications and would require a hard fork.Various proposals have been suggested to address the issue of UTXO growth, including consolidating unspent outputs at the wallet level and implementing a fork/merge design. Wallet developers and miners have a vested interest in reducing the size of the UTXO database. Relays could enforce behavior that promotes this goal by refusing to relay or deprioritizing transactions that don't use all available UTXOs from input addresses. However, these proposals come with challenges and trade-offs, and further discussions and considerations are needed to find an effective solution.The consolidation of UTXOs in transactions would also benefit miners by reducing the storage space required for holding the UTXO. Relays could play a role in enforcing this behavior by prioritizing transactions that utilize all available UTXOs. The criteria for selecting UTXOs when making a Bitcoin transaction include choosing the smallest possible set of addresses that can provide enough BTC, selecting sets with the largest number of UTXOs, sets with the largest total amount of BTC, sets that destroy the most bitcoin days, and randomly selecting from multiple sets.The age of UTXOs is another factor discussed in relation to Bitcoin transactions. Miners typically do not consider the age of UTXO entries, except for cases involving free transactions or coinbase transaction outputs. Free transactions need to have a priority level determined by BTC-days-destroyed per byte, while coinbase transaction outputs cannot be spent until 100 confirmations after being added to the blockchain.Privacy concerns are also raised when building Bitcoin transactions. Some suggest limiting the selection of UTXOs to a single address and sending change back to the same address to ensure privacy. However, others argue that sending change back to the same address could compromise privacy and propose sending the change output to a new change address. While mainstream wallets have different priorities regarding privacy compared to privacy-focused wallets, all wallets can improve their algorithms and promote some degree of consolidation.The issue of UTXO growth has implications for transaction fees and privacy. The size of the UTXO set affects the ease of running a full node and the spread and value of Bitcoin. Wallet developers are encouraged to adopt UTXO selection algorithms that reduce the database size. However, UTXO growth is not limited to wallets alone, and economic implications should be considered when charging differently for in/out mismatches.Overall, the email thread and conversations underscore the importance of considering privacy concerns, UTXO growth, and fee optimization when building wallets and improving algorithms. Developers, miners, and other stakeholders should collaborate to find effective solutions that balance these factors and ensure the continued efficiency and scalability of the Bitcoin network.


Updated on: 2023-08-01T12:37:12.528074+00:00