Bitcoin Forum
July 07, 2025, 03:08:43 AM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoind listunspent() & createrawtransaction()  (Read 585 times)
randomuser543 (OP)
Newbie
*
Offline Offline

Activity: 23
Merit: 0


View Profile
May 14, 2016, 01:48:32 PM
 #1

Imagine I have 20 different unspent outputs, ranging in value from 0.0001 BTC - 1.0 BTC.

Now, supposing I need to create and send 0.01 BTC in a raw transaction. I'm wondering how you guys choose what unspent outputs to use.

Obviously any unspent output >= 0.01 can be used, but is there a preferred way of doing this?

listunspent -> pick an unspent output that has the most confirmations and is >= 0.01.
listunspent -> pick any unspent output as long as it's >=0.01.
etc.
ranochigo
Legendary
*
Offline Offline

Activity: 3164
Merit: 4504



View Profile
May 14, 2016, 02:32:07 PM
 #2

Bitcoin Core uses the oldest inputs first since it has the most confirmations and thus a higher priority, I believe there are more than this.

If I were to choose inputs, I would use the oldest inputs first to have a higher priority when I am making a free transaction. Next, I would prefer to spend the UXTOs which can be spent completely, i.e. there will be no change. This reduces the size occupied by the one additional output.

░░░░▄▄████████████▄
▄████████████████▀
▄████████████████▀▄█▄
▄██████▀▀░░▄███▀▄████▄
▄██████▀░░░▄███▀▀██████▄
██████▀░░▄████▄░░░▀██████
██████░░▀▀▀▀▄▄▄▄░░██████
██████▄░░░▀████▀░░▄██████
▀██████▄▄███▀░░░▄██████▀
▀████▀▄████░░▄▄███████▀
▀█▀▄████████████████▀
▄████████████████▀
▀████████████▀▀░░░░
 
 CCECASH 
 
    ANN THREAD    
 
      TUTORIAL      
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!