In my application the private keys are created and stored on a HSM. When a new private key is created on the HSM, it returns the corresponding public key. With this public key I create a bitcoin address. Since these externally generated addresses are not part of a wallet, I'm unable to get the UTXOs of this address. Now my big questions is: How can I get the UTXOs of this address without importing it into a wallet?
Bitcoin Core has a scantxoutset
command. You give it output script descriptors (which specify scriptPubKey
s) and it will scan the UTXO set and return the UTXOs that have scriptPubKey
s that match the given descriptors.
-
-
Yes. I found it: curl --data-binary '{"id":"1","jsonrpc":"1.0","method":"scantxoutset","params":["start", [{"desc":"addr(msJaKN7KCGARZrKWyy169GzztFLx7aTRBf)"}] ] }' -H 'content-type: text/plain;' user:password@127.0.0.1:8332 – Bumblebee Apr 27 '20 at 17:12