Post
Topic
Board Electrum
Re: How to tell Electrum from which address(es) to send Bitcoins?
by
buwaytress
on 07/06/2018, 13:46:46 UTC
There used to be a "coin selection" policy setting in Electrum with the options "privacy" and "priority". However this was removed as the "priority" concept in Bitcoin was effectively removed when zero fee transactions were no longer a thing.

- "Priority" would spend your oldest coins, as there used to be a priority value in Bitcoin that would prioritise transactions for inclusion in a block based on the "age" of a UTXO... but this was removed at some point.
- "Privacy" would spend ALL the inputs within an address regardless of how much you were actually attempting to spend. The change would then be sent to a new change address. The idea was to prevent a leftover UTXO in AddressA from then being used in another transaction and then linking all the addresses in the two transactions together.

However, these options are no longer offered... (the concept of "Priority" in Bitcoin transactions isn't used anymore)

Currently, I "believe" that the strategy in Electrum is to use the smallest number of inputs as possible to make up the required sending amount... but not 100% sure what the actual UTXO selection algorithm is... I haven't looked at that part of the code recently.

Can users tell Electrum which strategy to use?
As far as I'm aware, the only way to tell Electrum what strategy to use is to do it yourself using the coin control methods of manually selecting UTXOs from the "coins" tab. There is no setting anywhere.


Is the default strategy for other Wallets the same?
From personal experience... no. Wallets all use different strategies. I've seen some that work simply on FIFO... they just used the oldest UTXOs first. I've seen some work the same and try and minimise the total number of UTXOs required... and I've used some that just seem a bit random.

Adding my own experience observed from 2.8x pre native Segwit update, when allowing Electrum to choose inputs, it has always taken the single input option when possible instead of combining multiple inputs, which meant I often had to perform consolidations myself or at times forcing spends from multiple inputs. I assumed this was just for smallest possible tx size.

Since updating 3x and bech32, incidentally, haven't allowed Electrum to choose, so not sure of behaviour.