<blockquote>
<p>I spent some time researching the problem and learned that all money in an address must be spent at once.</p>
</blockquote>
<p>This is incorrect. The concept of an address does not even exist at the protocol level.</p>
<p>A transaction has inputs and outputs. Every output constructs a &quot;coin&quot; 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.</p>
<p>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 &quot;all coins associated with the same locking script&quot; - this is only added by wallet software and block explorers for human consumption.</p>
<blockquote>
<p>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.</p>
</blockquote>
<p>It is valid.</p>
<blockquote>
<p>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?</p>
</blockquote>
<p>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.</p>
<p>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).</p>

CC BY-SA 4.0
2021-03-06T20:25:42.923Z
2021-03-07T00:03:09.400Z
2021-03-07T00:03:09.400Z
Pieter Wuille
<p>I am sure the answer to this is trivial to someone who already knows the answer, but not to me.</p>
<p>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:</p>
<ol>
<li>Fees are presently naturally high due to network congestion.</li>
<li>The address has small amounts of bitcoin from many sources, which apparently is problematic.</li>
</ol>
<p>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 &quot;consolidation&quot; and how to consolidate transactions during times of low fees.</p>
<p>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.</p>
<p>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.</p>
<p>But entirely by accident I discovered something weird in Electrum:</p>
<ul>
<li><p>If I right-click an address, there is a secret feature &quot;Spend from&quot; 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.)</p>
</li>
<li><p>On the &quot;Send&quot; tab, Electrum <em>then</em> lists each individual received input to that source address. <strong>If I right-click the individual inputs, I can remove them.</strong> <em>WHHHAAT?!?!?</em></p>
</li>
</ul>
<p>This contradicts everything I spent days reading about, which was that I had to spend the entirety of inputs at once.</p>
<p>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.</p>
<p>Perhaps, for example, the design purpose of being able to remove specific inputs from a transaction is a way to purge &quot;dust&quot;, 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.</p>
<p>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 <em>moronically</em> trying to force me to spend all of the address at once, <em>phenomenally</em> 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?</p>
<p>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.</p>

<transactions><transaction-fees><electrum><transaction-input><consolidation>
Confused about input and output spending limitations and consolidation
Robonoob
# Confused about input and output spending limitations and consolidation

(Asked by: username_0 on 2021-03-06)

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.

**Tags:** transactions, transaction-fees, electrum, transaction-input, consolidation


---

## 1 answers

### Answer by username_1 on 2021-03-06. Score: 1 | Accepted answer

> 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).


---

