Bitcoin Forum

Bitcoin => Electrum => Topic started by: bomberb17 on January 18, 2021, 01:27:20 AM



Title: Consolidate multiple output points into one
Post by: bomberb17 on January 18, 2021, 01:27:20 AM
My electrum wallet holds a segwit address beginning with bc1..
Under the "coins" tab I see it has many output points for the same address. Now the fees are low I think I can take advantage of it and consolidate all points into a single one, so I won't have to make larger transactions in the future (with multiple inputs).
My questions are:

a) How can I consolidate multiple output points?

b) I have a non-segwit wallet which always maintains a single output point. How do I prevent this from happening in my segwit wallet in the future? (i.e. maintain a single output point as well?)


Title: Re: Consolidate multiple output points into one
Post by: nc50lc on January 18, 2021, 02:22:52 AM
a) How can I consolidate multiple output points?
In the "Coins" tab, either:
  • Hold CTRL and left-click the coins you want to spend, right-click and select "spend", now go to "Send" tab
  • Select the first coin then hold SHIFT and left-click the last coin you want to spend, that will select all the coins between the first and last coin you've clicked, then "spend"
  • Right-click and select "freeze coin" on all the coins you don't want to spend, then use "max" in the send tab, that way, "max amount" wont spend the frozen coins.

Quote from: bomberb17
b) I have a non-segwit wallet which always maintains a single output point. How do I prevent this from happening in my segwit wallet in the future? (i.e. maintain a single output point as well?)
If you're frequently receiving multiple small inputs that's not dust (https://bitcoin.stackexchange.com/a/41082), consolidate them from time to time.
Sending them in the same address won't work since each transaction's outputs will create multiple "coins".
Eg.: If you're a miner who's receiving auto-withdrawals, you should increase your minimum auto-withdrawal amount to minimize your number of UTXO.


Title: Re: Consolidate multiple output points into one
Post by: DireWolfM14 on January 18, 2021, 03:18:01 AM
If all the unspent outputs (UTXOs) were sent to one address you can go the "addresses" tab, select that address, right-click and select "spend from."  You can then send the max available from that address.  If the UTXOs are collected in multiple addresses you can hold the CTRL button down and select multiple address to do the same thing.

If you want more control over the specific UTXOs, you can do like nc50lc suggested on the "coins" tab.


Title: Re: Consolidate multiple output points into one
Post by: bomberb17 on January 18, 2021, 04:15:14 AM
Got it, thank you for your answers


Title: Re: Consolidate multiple output points into one
Post by: HCP on January 18, 2021, 05:15:50 AM
You don't need to do anything complicated like coin control and selecting UTXOs or Addresses if you don't care about linking all of your UTXOs together.

To consolidate, simply goto the "Send" tab in Electrum, Enter the address from your wallet that you want to consolidate all of the coins to, then click the "max" button... then click "Pay" and sign/broadcast the transaction. All of your UTXOs will be consolidated into one.


b) I have a non-segwit wallet which always maintains a single output point. How do I prevent this from happening in my segwit wallet in the future? (i.e. maintain a single output point as well?)
I'm not sure what you mean by a "single output point"... do you mean a single address that all coins are sent to? Or a single "UTXO" that is created whenever you spend coins and get change? ???

Every time you receive coins, it creates a new UTXO... even if they're all in the same "address", they are all separate and unique UTXOs. The only way to maintain a single UTXO is to spend "everything", every single time you create a transaction, and receive the change back as a single UTXO. However, as soon as you receive any more coins, you're going to have multiple UTXOs again until you create another transaction that consolidates everything again.

You can do the same thing in Electrum, but it's somewhat "manual". We can simply (ab)use the "pay2many" functionally... on the "Send" tab, you simply enter the external address you are wanting to send coins to and the amount to send to that address... and then you create an entry on the 2nd line with the address from your wallet you want all the "change" to go to (as a single UTXO), and then you use ! as the payment amount, like this:
https://talkimg.com/images/2023/11/15/z3HIl.png

In this example, we're sending 0.1 BTC to "addressYouAreSendingCoinsTo"... and our wallet address "yourAddressForChangeUTXO" is going to receive the leftover balance (- transaction fee) as a single UTXO. After we send the transaction, we'll only have one UTXO in the wallet.


Title: Re: Consolidate multiple output points into one
Post by: NotATether on January 18, 2021, 02:12:51 PM
b) I have a non-segwit wallet which always maintains a single output point. How do I prevent this from happening in my segwit wallet in the future? (i.e. maintain a single output point as well?)
I'm not sure what you mean by a "single output point"... do you mean a single address that all coins are sent to? Or a single "UTXO" that is created whenever you spend coins and get change? ???

In the hidden "Coins" tab in Electrum there are a bunch of output points listed on the first column with their transaction ID, followed by a colon and then the index of the UTXO in the transaction. That is probably what OP was referring to when he said output points. OP can just use nc50lc's solution for selecting all of these output points and spending them all at once.