Author

Topic: Ideas needed for preventing dust (Read 549 times)

jr. member
Activity: 81
Merit: 4
January 21, 2017, 08:38:40 PM
#3
I guess I was focussed on preventing dust transactions and never thought of just letting it go as part of the fee. I'll probably just do that Smiley

I actually had this mostly working yesterday, and after some unknown fuckup with Windows, every open file in Visual Studio was replaced with a lot of 0x00. Firefox had a shit too and lost all recent history. No recent backup and lost a few days work Sad
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
January 21, 2017, 11:38:47 AM
#2
What wallets do for their coin selection (selecting which UTXO to spend) is that they either go for privacy or priority (I think the the priority approach is no longer applicable ref).
And for privacy they choose outputs in a way to protect the privacy, so if you have multiple address only spend outputs that are connected to addresses in one transaction.
* There may be other things wallets do for that, which I don't know or am forgetting now.

I am not sure what they do for dust but I believe if after making the transaction if there is any leftover (what you usually send to change address) and that leftover is smaller than dust amount, it is considered as fee (they don't send it to a change address).
jr. member
Activity: 81
Merit: 4
January 21, 2017, 10:58:48 AM
#1
I'm working on a project and part of it is is a database based wallet. I'm trying to get a quick and dirty transaction building routine working so I can start making transactions, and filling the database with actual keys and transaction data for testing. This is all on TestNet.

One thing I want to quickly hack together is a fee calculator. I was considering just building the transaction with no fee, grabbing the size and then re-building it with the appropriate fee. It will work for initial testing and filling the database. Is this the best way to get it done quickly, or is there a better way?

I'm also trying to prevent filling change addresses with dust. I will be sorting un-spent outputs by size (after pulling from database where value is greater than payment amount). I would guess that the easiest way is just to use the highest value un-spent output there is, but that would mean a small transaction would potentially leave a larger one later on needing to use several inputs and potentially increase fees.

I am using NBitcoin and programming in C#.

Thanks for any advice Smiley
Jump to: