Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Meska on October 24, 2013, 12:18:31 PM



Title: Dust/Transaction too large, how to solve ?
Post by: Meska on October 24, 2013, 12:18:31 PM
Hi, I'm using bitcoind on a Linux Debian. (Compiled version)
I have a lot of dust due to free bitcoin services (when I was trying to look how it work), and now, I'm facing the problem of I have a lot of dust in my wallet. (I'm used to create one BTC address by services).

So basic example today :
Code:
GQHNoTt9aJfQASLMrTyfdS 0.1395 
error: {"code":-4,"message":"Transaction too large"}
bitcoin@bea:~$ ./bitcoind sendtoaddress 1LbaY34KEn6mGQHNoTt9aJfQASLMrTyfdS 0.1295
error: {"code":-4,"message":"Transaction too large"}
bitcoin@bea:~$ ./bitcoind sendtoaddress 1LbaY34KEn6mGQHNoTt9aJfQASLMrTyfdS 0.1195
error: {"code":-4,"message":"Transaction too large"}
bitcoin@bea:~$ ./bitcoind sendtoaddress 1LbaY34KEn6mGQHNoTt9aJfQASLMrTyfdS 0.1095
error: {"code":-4,"message":"Transaction too large"}
bitcoin@bea:~$ ./bitcoind sendtoaddress 1LbaY34KEn6mGQHNoTt9aJfQASLMrTyfdS 0.0995 
error: {"code":-4,"message":"Transaction too large"}
bitcoin@bea:~$ ./bitcoind sendtoaddress 1LbaY34KEn6mGQHNoTt9aJfQASLMrTyfdS 0.0895
error: {"code":-4,"message":"Transaction too large"}
bitcoin@bea:~$ ./bitcoind sendtoaddress 1LbaY34KEn6mGQHNoTt9aJfQASLMrTyfdS 0.0795
error: {"code":-4,"message":"Transaction too large"}
bitcoin@bea:~$ ./bitcoind sendtoaddress 1LbaY34KEn6mGQHNoTt9aJfQASLMrTyfdS 0.07 
error: {"code":-4,"message":"Transaction too large"}
bitcoin@bea:~$ ./bitcoind sendtoaddress 1LbaY34KEn6mGQHNoTt9aJfQASLMrTyfdS 0.06
47510431b7edcabe3cb73e0a6e5f55d9541b76bdd65fbe0d98c9c6cd5a14e445
bitcoin@bea:~$ ./bitcoind gettransaction 47510431b7edcabe3cb73e0a6e5f55d9541b76bdd65fbe0d98c9c6cd5a14e445
{
    "amount" : -0.06000000,
    "fee" : -0.00840000,
    "confirmations" : 0,
    "txid" : "47510431b7edcabe3cb73e0a6e5f55d9541b76bdd65fbe0d98c9c6cd5a14e445",
    "time" : 1382616790,
    "timereceived" : 1382616790,
    "details" : [
        {
            "account" : "",
            "address" : "1LbaY34KEn6mGQHNoTt9aJfQASLMrTyfdS",
            "category" : "send",
            "amount" : -0.06000000,
            "fee" : -0.00840000
        }
    ]
}

So the question is : How can I deduced "how size it will be".
In fact I'm moving everything properly to my inputs.io account, I want to do this with the "less" transactions I can, but trying for ten minutes everytime I want to transfert is quite boring (the "error: {"code":-4,"message":"Transaction too large"}" erreur message took 30s to one minute to be applied).

Is there any functions to find the "max amount with the max size" (without compiling the client again, I saw some patches to avoid this problem, but I don't like screwing the network).




Title: Re: Dust/Transaction too large, how to solve ?
Post by: domob on October 25, 2013, 07:07:32 AM
When I had the same problem, I wrote a small script to "collect" dust output step by step into larger denominations.  You can find it at https://www.domob.eu/projects/coinCollection.php, but you should know what you are doing when you want to try it (and use at your own risk, but for me it works well).  I think other such tools are probably also available (and may be a lot easier to use, but I don't know of any at the moment).

If you want to find out some more information, you can try "bitcoind listunspent" to see all unspent outputs you have, and if there are larger ones among all the dust or not.


Title: Re: Dust/Transaction too large, how to solve ?
Post by: Meska on October 25, 2013, 10:37:13 AM
Thank you for this message and the script sharing.
I will look into it, but it looks like exactly what I want to do.

My last transaction : https://blockchain.info/tx/cee21b80afd46d59da318d9fc64c129b1969f67ef58696a69d47f2aae10f08c9
0.001 BTC for 0.0025 BTC fees...


Title: Re: Dust/Transaction too large, how to solve ?
Post by: dserrano5 on October 25, 2013, 11:02:01 AM
You should try to combine the largest unspent output(s) you have in your wallet with a few of the smaller ones in every transaction you do, and repeat this as many times as needed until you reduce the (apparently very large) number of tiny outputs you seem to have.


Title: Re: Dust/Transaction too large, how to solve ?
Post by: RoadTrain on October 26, 2013, 01:18:56 AM
If you had one large output (the larger the better, a dozen BTC e.g.), you could even combine this dust without paying fees.
Just this large input and up to ~9.900 Kb of dust for one tx.
Though it would be a long process. Read about transaction fees and priority on the wiki.


Title: Re: Dust/Transaction too large, how to solve ?
Post by: mb300sd on October 26, 2013, 01:22:19 AM
This may help, you can build transactions using individual outputs and consolidate the dust.

https://bitcointalk.org/index.php?topic=315999.0


Title: Re: Dust/Transaction too large, how to solve ?
Post by: Dabs on October 26, 2013, 01:51:10 AM
Coin Control.


Title: Re: Dust/Transaction too large, how to solve ?
Post by: Gavin Andresen on October 26, 2013, 05:33:43 AM
Peter's dust-b-gone:
  https://github.com/petertodd/dust-b-gone


Title: Re: Dust/Transaction too large, how to solve ?
Post by: DobZombie on October 26, 2013, 12:21:58 PM
Peter's dust-b-gone:
  https://github.com/petertodd/dust-b-gone


What a fantastic script!

 ;D ;D


Title: Re: Dust/Transaction too large, how to solve ?
Post by: Mike Hearn on October 27, 2013, 05:47:38 PM
Peter's script sends the dust to miners - I suspect most people simply want to consolidate/defrag their wallet and keep the money. I don't think there's any program that does that currently.


Title: Re: Dust/Transaction too large, how to solve ?
Post by: Peter Todd on October 28, 2013, 01:04:23 AM
Peter's script sends the dust to miners - I suspect most people simply want to consolidate/defrag their wallet and keep the money. I don't think there's any program that does that currently.

What do you suggest such a script do?


Title: Re: Dust/Transaction too large, how to solve ?
Post by: gmaxwell on October 28, 2013, 02:58:33 AM
Peter's script sends the dust to miners - I suspect most people simply want to consolidate/defrag their wallet and keep the money. I don't think there's any program that does that currently.
Yea, but who cares if they "keep" payments of 1 satoshi? Even thousands of them add up to nothing.

The advantage of coinjoining them up and giving them to miners, as Peter's tool does, is that it also thwarts attempts to reduce privacy (paying exhausted addresses tiny amounts in order to produce extra linkage)... and giving the coin to miners is the most incentive possible for miners to accept the transaction (short of actually paying extra to get it mined).

It's probably not something you'd want to use for "dust" at the scale of 0.01 BTC to (say) 0.0001 BTC. I posted a tool (now probably bitrotted) for general defragmenting last year:  https://people.xiph.org/~greg/groomer.py  basically it aggregates up outputs while trying to avoid reducing your privacy.

It might be interesting to combine the ideas in peter's tool:  For very tiny coins, give them away to miners, for larger ones aggregate them up and return them to yourself.


Title: Re: Dust/Transaction too large, how to solve ?
Post by: Mike Hearn on October 28, 2013, 10:31:51 AM
Right, a mixed tool sounds good, although it'd be best if it was sensitive to the exchange rate. We have a recurring problem where amounts that seem too small to care about a year later start to become interesting due to the exchange rate moving by an order of magnitude (nice problem to have ...).

And yes for defragmentation I was thinking just generate free transactions that merge inputs together. I think now the fee rules changed to not count input bytes (correct??) it would be possible for wallets to do that at night, when load on the network might be lower. It'd be interesting to plot fine-grained traffic graphs and see if any such effect is observable at the moment or whether automated dice gaming drowns out the organic usage.


Title: Re: Dust/Transaction too large, how to solve ?
Post by: kjj on October 28, 2013, 07:31:00 PM
Small transaction management is hard to do in a way that works for everyone, is safe, and doesn't leak privacy.  One or two of those are easy enough, but getting that third one in there is a bear.

It gets much worse when you try to preserve coin age and priority for the free transaction calculation.  Someone with an unhealthy attachment to their old satoshidice in-band notification payments isn't going to be happy if their whole wallet is tied up in new coins when they have to pay a fee for a trivial spend.