Bitcoin Forum
May 09, 2024, 05:17:57 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Smart inputs?  (Read 529 times)
Thekool1s (OP)
Legendary
*
Offline Offline

Activity: 1512
Merit: 1218


Change is in your hands


View Profile
September 15, 2017, 11: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.
If you see garbage posts (off-topic, trolling, spam, no point, etc.), use the "report to moderator" links. All reports are investigated, though you will rarely be contacted about your reports.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715275077
Hero Member
*
Offline Offline

Posts: 1715275077

View Profile Personal Message (Offline)

Ignore
1715275077
Reply with quote  #2

1715275077
Report to moderator
onnz423
Hero Member
*****
Offline Offline

Activity: 840
Merit: 508


Make winning bets on sports with Sportsbet.io!


View Profile
September 15, 2017, 12:30:48 PM
 #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.

   ▄▄██████▄▄
  ████████████
███▄▄
 ██████████████▀▀▀██▄
████████████████   ▀██▄
████████████████     ▀██
██████████████       ██▌
██████████████        ▐██
██▌▀▀██████▀▀         ▐██
▐██                   ██▌
 ██▄                 ▄██
  ▀██▄             ▄██▀
    ▀██▄▄▄     ▄▄▄██▀
      ▀▀█████████▀▀





███████████████████████████
████████▀▀       ▀▀████████
█████▀   ▄ ▀███▀ ▄   ▀█████
████  ▄████▄ ▀ ▄████▄  ████
███  ▄ ▀███▀ ▄ ▀███▀ ▄  ███
██  ▄██ ▀▀ ▄███▄ ▀▀ ██▄  ██
██  █▀ ▄█ ███████ █▄ ▀█  ██
██   ▄███▄ █████ ▄███▄   ██
███  ████▀ ▄▄▄▄▄ ▀████  ███
████  ▀ ▄ ▀█████▀ ▄ ▀  ████
█████▄  ▀▀▄ ███ ▄▀▀  ▄█████
████████▄▄       ▄▄████████
███████████████████████████





█▀▀











█▄▄
▀▀█











▄▄█
█▀▀











█▄▄
▀▀█











▄▄█
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4922


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
September 15, 2017, 12:35:57 PM
 #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)

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4177



View Profile
September 15, 2017, 12:38:32 PM
Last edit: September 16, 2017, 12:41:38 AM by ranochigo
 #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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
buwaytress
Legendary
*
Online Online

Activity: 2800
Merit: 3443


Join the world-leading crypto sportsbook NOW!


View Profile
September 15, 2017, 04:31:43 PM
 #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.

██
██
██
██
██
██
██
██
██
██
██
██
██
... LIVECASINO.io    Play Live Games with up to 20% cashback!...██
██
██
██
██
██
██
██
██
██
██
██
██
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
September 16, 2017, 05: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!

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!