bitcoin-dev

OP_KEEPCHANGE - mitigating dust outputs

OP_KEEPCHANGE - mitigating dust outputs

Original Postby James Ferguson

Posted on: September 26, 2024 00:44 UTC

James proposes a novel idea titled "Keep the Change" aimed at enhancing Bitcoin's efficiency and network performance through a mechanism called "OP_KEEPCHANGE".

This concept is designed to address the issue of small, unspendable residual amounts, known as dust, that result from Bitcoin transactions. Typically, when Bitcoin is sent, any leftover amount is returned to the sender's change address. However, if this amount is too small, it becomes economically impractical to spend, contributing to several problems.

The introduction of "OP_KEEPCHANGE" seeks to automatically credit these small residual UTXOs (Unspent Transaction Outputs) to the primary recipient's address instead of creating new change outputs. This strategy is expected to mitigate inefficiencies related to dust outputs by reducing blockchain bloat, lowering transaction fees, and simplifying transaction construction. Furthermore, it aims to enhance privacy by obfuscating common patterns used to identify change outputs and preserve the overall Bitcoin money supply by preventing the accumulation of economically unspendable UTXOs.

Additionally, "OP_KEEPCHANGE" presents secondary benefits such as preventing value erosion when transferring funds between wallets owned by the same party, providing a slight revenue uplift for recipients like merchants or fiat exchange users without costing the sender, and facilitating a reduction in the dust threshold due to lower transaction costs. The proposal suggests that this approach would benefit all users by increasing the size of UTXOs, thereby reducing the default dust threshold and fostering a more equitable system with positive feedback mechanisms.

The high-level specification of "OP_KEEPCHANGE" involves configuring a dust threshold, selecting inputs for transactions in a manner that minimizes change, and marking transactions below this threshold with "OP_KEEPCHANGE" to add any excess change to the primary output. This mechanism promises backward compatibility with existing systems while striving for greater Bitcoin network efficiency, reduced costs, improved privacy, and a stable money supply.