0

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?

1

Bitcoin Core has a scantxoutset command. You give it output script descriptors (which specify scriptPubKeys) and it will scan the UTXO set and return the UTXOs that have scriptPubKeys that match the given descriptors.

  • Is there also an rpc endpoint for scantxoutset? – Bumblebee Apr 27 '20 at 16:57
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.