<blockquote>
  <p>I would like my simple wallet app to automatically select UTXOs for inputs. I realize that I can't accomplish this with just bitcoinjs</p>
</blockquote>

<p>I assume that you are not creating a SPV wallet. In this case,</p>

<blockquote>
  <p>is there something I can add to it to keep track of unspents?</p>
</blockquote>

<p>No. You have to check if there are UTXOs on your address to be spent even if you store them on your app. Because these UTXOs you stored on your app might be spent by another wallet.</p>

<blockquote>
  <p>is there a way to use some sort of API to automatically select unspents?</p>
</blockquote>

<p>Yes. <a href="https://chain.so/api#networks-supported" rel="nofollow noreferrer">This website</a> offers some APIs to select UTXOs with different cyptos( Bitcoin, Litecoin, Dogecoin, and Dash).</p>

CC BY-SA 3.0
2018-01-17T01:28:29.327Z
2018-01-17T01:28:29.327Z
ogw_yuya
<p>I would like my simple wallet app to automatically select UTXOs for inputs. I realize that I can't accomplish this with just bitcoinjs, but is there something I can add to it to keep track of unspents? Or is there a way to use some sort of API to automatically select unspents? I do see that it is fairly easily done with btc.com, but I would like to be able to do this with altcoins as well. Thanks in advance!</p>

<utxo><bitcoinjs><coin-selection>
How to get unspents for inputs using bitcoinjs-lib?
Setheroni
# How to get unspents for inputs using bitcoinjs-lib?

(Asked by: username_0 on 2018-01-16)

I would like my simple wallet app to automatically select UTXOs for inputs. I realize that I can't accomplish this with just bitcoinjs, but is there something I can add to it to keep track of unspents? Or is there a way to use some sort of API to automatically select unspents? I do see that it is fairly easily done with btc.com, but I would like to be able to do this with altcoins as well. Thanks in advance!

**Tags:** utxo, bitcoinjs, coin-selection


---

## 1 answers

### Answer by username_1 on 2018-01-17. Score: 0

> I would like my simple wallet app to automatically select UTXOs for inputs. I realize that I can't accomplish this with just bitcoinjs

I assume that you are not creating a SPV wallet. In this case,

> is there something I can add to it to keep track of unspents?

No. You have to check if there are UTXOs on your address to be spent even if you store them on your app. Because these UTXOs you stored on your app might be spent by another wallet.

> is there a way to use some sort of API to automatically select unspents?

Yes. [This website](https://chain.so/api#networks-supported) offers some APIs to select UTXOs with different cyptos( Bitcoin, Litecoin, Dogecoin, and Dash).


---

