Author

Topic: Smart inputs? (Read 543 times)

HCP
legendary
Activity: 2086
Merit: 4363
September 16, 2017, 12:09:02 AM
#6
Or you can actually just go to the "coins" tab and select the exact coins you want to use... Ctrl+click each UTXO you want to include, then right click and select "spend"...

Honestly, the coin control options (like the fee options) in Electrum are pretty comprehensive!
legendary
Activity: 3010
Merit: 3724
Join the world-leading crypto sportsbook NOW!
September 15, 2017, 11:31:43 AM
#5
I can't recall really testing how Electrum chooses inputs but I suspect that mocacinno's post describes it accurately. I can remember exact inputs being used when they equal the spend, but I haven't since very early on had a lot of inputs to see how their behaviour works. But if you want to ensure that smaller inputs are used up first (which I'm sure is something we all want to do to keep our wallets lean), you can always use the freeze feature in Electrum.

Just right click on the addresses in the list tab and choose freeze, you can use Ctrl+click to select multiples. The amount of coins available in balance will update automatically. Then when you make the spend, only inputs from addresses not frozen will be used. You can always unfreeze when you want to use them up later.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
September 15, 2017, 07:38:32 AM
#4
I have a question regarding inputs, let's say i have 3 inputs, two of them have 0.015 btc and one has 0.03 btc, let's say i have to send 0.03 btc, my question is are the wallets like electrum smart enough to use the single input or they will use the inputs randomly.
Most wallets treats inputs differently, they are smart enough to figure out which one should they use.

For the reference clients, they use an algorithm to determine it. If the reference client finds an input that matches the intended send plus transaction fees, they will use it. Otherwise, if there isn't such a UXTO that fits, they will attempt to find another set of UXTOs that can match the send amount. Otherwise, they will attempt to pair the UXTO up together till they can find a set of UXTO to use that will spend the least number of UXTOs.

For Electrum, they have the privacy and priority settings. Privacy means that all the inputs will be spent, increasing the privacy and reduces the UXTO bloat. This will result you in having to pay more fees in each transaction since you are using more UXTOs in every transaction. For priority, they sort out the UXTOs and use the oldest UXTOs first.
legendary
Activity: 3612
Merit: 5297
https://merel.mobi => buy facemasks with BTC/LTC
September 15, 2017, 07:35:57 AM
#3
If have no idear which algorithm electrum uses for the selection of suitable unspent outputs... I can only imagine it's comparable to bitcoin core's algorithm:
https://github.com/bitcoin/bitcoin/blob/c22a53cd6351b3f0e96de971b001ad712b83fc47/src/wallet/wallet.cpp#L2303

IIRC, core does the following steps

1) if it finds one unspent output with the exact value, it will be used
else
2) if the sum of all unspent outputs smaller than the target value is equal to the target value, they will all be used
else
3) if the sum of all unspent outputs < target, the smallest unspent output that is larget than the target is used
else
4) bitcoin just starts to randomly combine unspent outputs untill a combination is found that is bigger than the target (i think the exact value is also ok)
hero member
Activity: 840
Merit: 508
Make winning bets on sports with Sportsbet.io!
September 15, 2017, 07:30:48 AM
#2
I think that at least electrum spends one input at time, and also allows you to set custom fees as well. The transaction currently should not be too costly, since you can merge inputs at a very affordable fee currently. I usually pay around 5sat/byte on electrum as a fee, because recentlt the mempool has been pretty empty, and no matter how much you pay fee, you can expect confirmation time within few blocks.
legendary
Activity: 1512
Merit: 1218
Change is in your hands
September 15, 2017, 06:39:12 AM
#1
I have a question regarding inputs, let's say i have 3 inputs, two of them have 0.015 btc and one has 0.03 btc, let's say i have to send 0.03 btc, my question is are the wallets like electrum smart enough to use the single input or they will use the inputs randomly.
Jump to: