Bitcoin Forum
June 03, 2023, 09:27:10 PM *
News: Latest Bitcoin Core release: 25.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Discussion] Best algorithm for utxo selection for sending.  (Read 702 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
1685827630
Hero Member
*
Offline Offline

Posts: 1685827630

View Profile Personal Message (Offline)

Ignore
1685827630
Reply with quote  #2

1685827630
Report to moderator
1685827630
Hero Member
*
Offline Offline

Posts: 1685827630

View Profile Personal Message (Offline)

Ignore
1685827630
Reply with quote  #2

1685827630
Report to moderator
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1685827630
Hero Member
*
Offline Offline

Posts: 1685827630

View Profile Personal Message (Offline)

Ignore
1685827630
Reply with quote  #2

1685827630
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 3122
Merit: 3915



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: 1017


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!