0

I am sure the answer to this is trivial to someone who already knows the answer, but not to me.

I recently wanted to spend some received bitcoin for the first time and discovered that the associated transaction fee was huge (more than I wanted to spend!), for two reasons:

  1. Fees are presently naturally high due to network congestion.
  2. The address has small amounts of bitcoin from many sources, which apparently is problematic.

I spent some time researching the problem and learned that all money in an address must be spent at once. I read about the analogies to not being able to split a coin. Hence the need for change addresses and such. I learned about "consolidation" and how to consolidate transactions during times of low fees.

Experimentally, I consolidated the 3 inputs of a different address into 1 new address, using a low fee. It took a few weeks for the transaction to confirm, but now has successfully made that money more spendable, because the consolidation reduces future fees. Okay, fair enough.

Now I want to do that to my main bitcoin address which has 22 received inputs. So I will consolidate them all with a (relatively) low fee, into 1 new address, which, when it finally confirms, I will finally be able to spend.

But entirely by accident I discovered something weird in Electrum:

  • If I right-click an address, there is a secret feature "Spend from" which lets me select the source address. (This is useful, because previously the only way I knew to select the source address was to fudge the spending and fees numbers until they exactly matched the total of a particular address, which tricked the program into using that address.)

  • On the "Send" tab, Electrum then lists each individual received input to that source address. If I right-click the individual inputs, I can remove them. WHHHAAT?!?!?

This contradicts everything I spent days reading about, which was that I had to spend the entirety of inputs at once.

Is this configuration valid? Or will there be an error when I try to commit the transaction? Or will all the other inputs to the address be permanently lost? I am too scared to try it.

Perhaps, for example, the design purpose of being able to remove specific inputs from a transaction is a way to purge "dust", to prevent an attack whereby somebody could DoS a bitcoin address by sending it many 1-satoshi inputs, causing the address to become practically unspendable without incurring a fortune in fees. But this design would discard the unused inputs forever, or gift them to miners as fees.

If it is valid to spend only part of an address, and I won't lose the rest, then why did I wait 3 weeks for this silly consolidation lark? And why was Electrum moronically trying to force me to spend all of the address at once, phenomenally increasing the fee when I was perfectly happy leaving the rest of the damn money exactly where it was. And why are there so many articles online explaining why you have to spend inputs all at once?

I am terrified I will lose all my bitcoin if I try this, so I would appreciate links to example transactions on the blockchain to satisfy myself that this partial inputs thingie is valid.

1

I spent some time researching the problem and learned that all money in an address must be spent at once.

This is incorrect. The concept of an address does not even exist at the protocol level.

A transaction has inputs and outputs. Every output constructs a "coin" which has an amount and a locking script (encoding the conditions for spending it, which is often - but not necessarily - representable as an address). Inputs consume coins (in their entirety - every coin can be spent exactly once). Transactions can be seen as melting down old coins, and reforging new ones with them.

There are no rules about the locking scripts of coins you're spending. They can all be the same, they can all be different, and there may be other coins with the same locking scripts that aren't spent by the same transaction. Simply put, the Bitcoin protocol has no concept of "all coins associated with the same locking script" - this is only added by wallet software and block explorers for human consumption.

Is this configuration valid? Or will there be an error when I try to commit the transaction? Or will all the other inputs to the address be permanently lost? I am too scared to try it.

It is valid.

And why was Electrum moronically trying to force me to spend all of the address at once, phenomenally increasing the fee when I was perfectly happy leaving the rest of the damn money exactly where it was. And why are there so many articles online explaining why you have to spend inputs all at once?

I can only speculate here, but one reason may be privacy. By definition, multiple coins associated with the same address/locking script can be spent by the same people. Thus if you spend in multiple distinct transactions, you're revealing to the network that those two transactions are related to the same entity (you). Because of that, it is preferable to always spend all these coins simultaneously, the minimize how much you reveal.

Of course, in an ideal world you don't reuse addresses, and you never have multiple coins associated with the same address in the first place (except perhaps dust spam).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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