Bitcoin Forum
January 18, 2018, 04:52:41 AM *
News: Electrum users must upgrade to 3.0.5 if they haven't already. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Smart inputs?  (Read 447 times)
Thekool1s
Hero Member
*****
Offline Offline

Activity: 812



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.

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

▄████▄                  ███████   
██████                 ▄██████     
▀████▀                ▄█████▀     
▄▄▄▄▄▄▄▄▄▄▄▄      ▄    ▄█████▀       
▄██████████████████▄  ██▄ █████▀         
████████████████████  ██████▀▀           
████████████████████  ██████▄             
███ ████████████ ███                     
███ ████████████ ███                     
███ ████████████ ███                       
  [    |    ████████████████████████
████████████████████████
███            ▀████████
███  ███████  ▄  ▀██████
███           ██▄  ▀████
███  ███████  ████▄  ███
███                  ███
███  ██████████████  ███
███                  ███
███  ██████████████  ███
███                  ███
████████████████████████
████████████████████████
  ] 
FACEBOOK  )   (  TWITTER  )
  .SUBSCRIBE NOW!!!. 
INSTAGRAM  )  (  LINKEDIN  )
1516251161
Hero Member
*
Offline Offline

Posts: 1516251161

View Profile Personal Message (Offline)

Ignore
1516251161
Reply with quote  #2

1516251161
Report to moderator
1516251161
Hero Member
*
Offline Offline

Posts: 1516251161

View Profile Personal Message (Offline)

Ignore
1516251161
Reply with quote  #2

1516251161
Report to moderator
1516251161
Hero Member
*
Offline Offline

Posts: 1516251161

View Profile Personal Message (Offline)

Ignore
1516251161
Reply with quote  #2

1516251161
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1516251161
Hero Member
*
Offline Offline

Posts: 1516251161

View Profile Personal Message (Offline)

Ignore
1516251161
Reply with quote  #2

1516251161
Report to moderator
1516251161
Hero Member
*
Offline Offline

Posts: 1516251161

View Profile Personal Message (Offline)

Ignore
1516251161
Reply with quote  #2

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

Activity: 686


Large scale, green crypto mining ICO


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.

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


███████████████████  WHITEPAPER  ████
█ █ ██  ANN THREAD  █████████████████ █ █

.
FACEBOOK      TWITTER      LINKEDIN
.
mocacinno
Legendary
*
Offline Offline

Activity: 1106


http://www.mocacinno.com


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)

ranochigo
Legendary
*
Offline Offline

Activity: 1330


View Profile WWW
September 15, 2017, 12:38:32 PM
 #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.














 

 

█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
BitBlender 

 













 















 












 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
buwaytress
Hero Member
*****
Offline Offline

Activity: 504


I bit, therefore I am


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.

HCP
Hero Member
*****
Offline Offline

Activity: 490

<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!

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!