Bitcoin Forum
May 04, 2024, 05:20:03 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Discussion] Best algorithm for utxo selection for sending.  (Read 712 times)
dabura667 (OP)
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 12, 2015, 11:45:55 AM
 #1

Hi all.

I would like to ask the opinion of the dev community about utxo selection when sending.

I see a lot of wallets use the following method.

Code:
1st priority: block height - ascending
2nd priority: value - ascending

I am wondering what the benefits and drawbacks of this method are.

Also, I am wondering if there are alternative utxo selection methods that have different properties.

Using the kind of defacto standard utxo selection:

So if we had 8 BTC in block 4 and 1.5 AND 0.5 BTC utxos in block 6...

For any value (even 0.5 BTC) up to 8 BTC, it will always use the 8 BTC utxo first.
Then up to 8.5 BTC it will use the 8 BTC input and the 0.5 BTC input.
Then up to 10 BTC it will use all three utxos.

So as an alternative example:
Using the above example, up to 0.5 BTC should use the 0.5 BTC input, from > 0.5 to 1.5 should use only the 1.5 BTC input, and Something > 8.5 and up to 9.5 should only use 8 BTC and the 1.5 BTC utxo.


How would my selection method differ in benefits and demerits?

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
1714843203
Hero Member
*
Offline Offline

Posts: 1714843203

View Profile Personal Message (Offline)

Ignore
1714843203
Reply with quote  #2

1714843203
Report to moderator
1714843203
Hero Member
*
Offline Offline

Posts: 1714843203

View Profile Personal Message (Offline)

Ignore
1714843203
Reply with quote  #2

1714843203
Report to moderator
1714843203
Hero Member
*
Offline Offline

Posts: 1714843203

View Profile Personal Message (Offline)

Ignore
1714843203
Reply with quote  #2

1714843203
Report to moderator
BitcoinCleanup.com: Learn why Bitcoin isn't bad for the environment
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714843203
Hero Member
*
Offline Offline

Posts: 1714843203

View Profile Personal Message (Offline)

Ignore
1714843203
Reply with quote  #2

1714843203
Report to moderator
1714843203
Hero Member
*
Offline Offline

Posts: 1714843203

View Profile Personal Message (Offline)

Ignore
1714843203
Reply with quote  #2

1714843203
Report to moderator
1714843203
Hero Member
*
Offline Offline

Posts: 1714843203

View Profile Personal Message (Offline)

Ignore
1714843203
Reply with quote  #2

1714843203
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4616



View Profile
January 12, 2015, 12:58:11 PM
 #2

When choosing a UTXO selection method, it is probably a good idea to determine what the goal is?

Some possible goals (each that might have a different UTXO selection algorithm):
  • Minimize transaction fees for current transaction
  • Minimize estimated total transaction fees for future transactions
  • Maximize bitcoin days destroyed
  • Minimize bitcoin days destroyed
  • Minimize address connections as inputs to transactions
  • Minimize total unspent outputs
  • Minimize transaction change
grau
Hero Member
*****
Offline Offline

Activity: 836
Merit: 1021


bits of proof


View Profile WWW
January 12, 2015, 02:52:02 PM
 #3

I'd add one that comes up if dealing with HD wallets:
- compact key index range used

If wallet is busy, then you'd also aim to preserve optimal coin fragmentation, that is some logarithmic scale as if handling traditional cash.
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!