On 12/03/2012 10:02 AM, Gregory Maxwell wrote:
(1) Make client software aggressive about sweeping up dust inputs: "Any time a transaction is created that has change keep adding in extra inputs— smallest to largest— until an additional one would increase the cost of the transaction by 0.0001 BTC or more" — the only major complication is doing this without concurrently harming privacy which is why it's not done yet in the reference client.


FYI, Armory uses exactly this logic to try to clean up dust outputs in the user's transactions.  However, there's enough conditions on it, that I don't know how often it triggers.  Recommendations are welcome for how to improve it.

Right now, if the transaction has less than 5 inputs, there exists dust UTXOs from addresses already included in the transaction, and those UTXOs are sufficiently small in priority, then the Armory will add them to the input side and increase the change accordingly.  Looking it just made me realize I lost the last condition of making sure the tx already has a change output -- don't want to turn a free tx into a fee-needed tx just to do this.  (reorganized the code recently, and must have fell through the cracks).

Perhaps it could be improved by cleaning up dust from any address by default (not just ones already included in the tx), with the option for the user to disable that behavior.  After all, anonymity was never a core feature of the network -- I think it makes sense that the logic would reduce anonymity by default in exchange for a cleaner network, with a clear option to "opt-out" of that logic if user cares.  I think most users don't actually care...

-Alan