30

Important parts in bold, for those who don't want to read the detail!

I've received lots of tiny transactions, in amounts sometimes as low as 0.000003BTC. Even though I've also received (relatively) larger amounts, I'm worried that when I want to spend my bitcoins the transaction fees may be very high thanks to the large number of "input" transactions needed to make up the output transaction.

As I understand it, the network has an algorithm for determining minimum transaction fees, and the relationship between number of inputs and required transaction fee is non-linear. This means there is likely some optimum way to combine my inputs. This has already been discussed here and here, but neither question asks how it can be done, and how bad the consequences can be.

It might be best to somehow include as many tiny inputs with a larger input each time I spend a moderate amount, or perhaps it would be better to somehow combine all the tiny inputs in individual batches of some optimum size and send them to myself to prevent future problems.

If I were to combine the tiny amounts, I'd be happy to wait for the newly combined bitcoins to age, so additional fees which would be required by spending young bitcoins won't be a problem.

In most, but not all, cases, my tiny amounts have been received to a dedicated tony-amount address.

For the sake of the question, let's assume I've received 1000 tiny transactions of 0.001BTC each, and another 100 transactions of 0.1BTC each, all in the same wallet. This would give a total balance of 11BTC. Assume all amounts were received 6 months ago.

If I wanted to spend the entire 11BTC at once (with 1100 transaction inputs), how high might the fee be?

If I only spent 1BTC at a time, how high might the fee be?

How can I actually combine the tiny amounts without affecting the larger ones?

I'm running the standard (Satoshi) client, but other clients could be an option.

2 Answers 2

16

I have not actually done this, but here is how I understand it. With many tiny amounts, you probably want to consolidate them because the fees for transactions with lots of inputs will be high. Now you ask, by consolidating, won't I just be paying the fees in advance? The answer is that by planning ahead and consolidating them, you can use the low-fee mining pool Eligius to do it.

To estimate the cost of the transaction, I'm going to use only the transaction size (for large transactions, the fee is dominated by or entirely consists of the cost per KB). This is based on the number of inputs and outputs. If all your balances are the same (0.01 BTC), then it doesn't matter how much you spend at at a time, the fee grows linearly with the total BTC amount.

Assuming 180 bytes per input, 1000 inputs comes to 175KB, which I'm going to round up to 200KB for a safety margin. With the official client, at the default 0.01 BTC / KB fee [1], that would cost 2 BTC.

Eligius will mine transactions for a fee of 0.2 TBC (0.00008192 BTC) per KB [2]. So Eligius's fee would be 0.016384 BTC. Might as well round that up to 0.02 BTC or higher just to be sure.

If your coins are old enough (say, 3 months for 10 BTC and a 200KB transaction size) [3], then the official client might not enforce the minimum fee on your transaction. Otherwise you may need to use a modified client that doesn't enforce a minimum fee.

In any case you will need to point your client to Lightfoot Hosting's free transaction relay, which will relay any transaction to the network [2], so it can be picked up by Eligius.

It may take longer than usual, but Eligius should eventually mine it.

As for combining the "dust" while leaving larger balances alone -- you would have to find a client that allows you to choose the inputs to your transaction. I don't know which clients can do that.

[1] https://en.bitcoin.it/wiki/Transaction_fees (The fee calculations on this page are as of client 0.3, so they may be outdated.)

[2] https://en.bitcoin.it/wiki/Free_transaction_relay_policy

[3] Wiki link [1] above says that transactions with priority over 57,600,000 aren't subject to the minimum fee calculation. If this is true, then 10 BTC with an average age of 3 months in a 200KB transaction would have a priority of (1000000000 * 144 * 90) / (200 * 1024) = 63,281,250

5
  • Thanks for your answer! Especially for the mention of the waiver for the min transaction fee; I didn't know that Commented Dec 5, 2012 at 20:25
  • You may update your answer with the fact that a fork of the original client done by cozz (github.com/cozz/bitcoin) does allow to pick specific inputs.
    – liori
    Commented Apr 8, 2013 at 15:01
  • Not sure why this old question popped up on the rss stream but might as well add the tidbit that bitcoin-qt these days also allows you to pick inputs manually. It has for a while actually.
    – Jannes
    Commented Apr 30, 2015 at 14:57
  • I am in this same basic boat except that 100% of my transactions (around 200) are tiny like this, from a mining pool. I want to transfer everything over to an exchange (Kraken) but the fees will be greater than 50% of the total! Best case if I opt for the slowest confirmation is about 1/3 of the total in fees. I really don't understand this answer enough to know what to do with it, I'm on Mac but don't know if there is actually an easy way to solve this issue. Does this warrant a new question? Concerned it would just get closed as a dupe.
    – JVC
    Commented May 5, 2017 at 16:48
  • I haven't kept up to date on all these details. Since this information is nearing 5 years old, I would suggest asking a new question. It looks like Eligius is still around and mining low-fee transactions. But a lot of things could have changed that I'm not aware of. Commented May 6, 2017 at 17:25
2

It is not directly answer for what the question asked but I wanted to give a tip for reducing bitcoin sending fees.

Electrum allows to send bitcoin by selecting the inputs separately.

Edit:

Electrum offers "Coins" tab which list all the inputs and their amounts separately.

So, when I will send bitcoin, I try to select and spend minimum number of inputs for the transaction.

2
  • This is a late answer but with still current value, if you will please elaborate on how this can help reducing the fees. As it is now, the answer is nearly useless. Commented May 23, 2017 at 4:29
  • Electrum offers "Coins" tab which list all the inputs and their amounts separately. So, when I will send bitcoin, I try to select minimum number of inputs for the transaction. As you know, if input count increased in a transaction also the fees.
    – podcast
    Commented May 23, 2017 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.