scantxoutset does not identify UTXO origins #14503

issue matejcik opened this issue on October 17, 2018
  1. matejcik commented at 3:21 PM on October 17, 2018: none

    This is related to #14150 and possibly others, but it's actually a separate issue.

    For instance, when using the following query: bitcoin-cli scantxoutset start '[{"desc":"wpkh(xpubABCDEF/0/*)", "range":100}]' I can get a list of UTXOs, but no way to get back the index which derived that particular UTXO. So it's not much better than deriving on the user side and specifying addresses one by one, so that I already have a cache of addresses to match.

    Not sure what the solution looks like. One way is to repeat the full descriptor in the utxo. That might get verbose though.

  2. sipa commented at 6:09 PM on October 17, 2018: member

    That's a great point.

    With #14150 there is a way to include the fingerprint and path of listed public keys to descriptors.

    Then it would be easy to make scantxoutset report a descriptor "specialized" to what matched (but without repeating the full xpub; it would just show pkh(ab1234cd/0'/0'/44'/0/13:03bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) (where the sequence of b's is a hex pubkey).

    Would that be more useful?

  3. sipa cross-referenced this on Oct 17, 2018 from issue Add key origin support to descriptors by sipa
  4. fanquake added the label RPC/REST/ZMQ on Oct 18, 2018
  5. matejcik commented at 12:10 PM on October 18, 2018: none

    So in my example, I'd specify: "desc": "wpkh(ab1234cd:xpubABCDEF123456.../0/*) and get back something like: "desc": "wpkh(ab1234cd/0/17:03bbb...)" right?

    That's a reasonable sounding solution. I don't see why the pubkey needs to be listed though. Is it to conform to the descriptor format? Or is there a usecase when you need it? (you should be able to derive it from the path information though)

  6. sipa commented at 2:55 PM on October 18, 2018: member

    For someone who has the master pubkey, yes. But descriptors are standalone. Without the pubkey in there you can't compute the address or redeemscript/witnessscript.

  7. matejcik commented at 3:12 PM on October 18, 2018: none

    I'm confused now. I am talking about matching the resulting UTXOs in scantxoutset results to the appropriate query strings; when I'm submitting a query, I can do the same pubkey derivation that bitcoind would do on my behalf. (consider: what if I'm querying multiple addr() descriptors? in that case we can't get the public key. i could match addrs on scriptPubKey as it stands now, but if there's an additional field, it should contain something reasonable)

    You seem to be talking about more specific case of returning stand-alone descriptors, possibly in other scenarios too?

  8. sipa commented at 3:20 PM on October 18, 2018: member

    @matejcik I suppose the answer is "to conform with the descriptor format", which are expected to be used for a number of other things (including importing into wallets, where you need to know what to watch for without access to the xpubs involved).

  9. sipa cross-referenced this on Oct 26, 2018 from issue Add ability to convert solvability info to descriptor by sipa
  10. sipa closed this on Nov 27, 2018

  11. sipa referenced this in commit fdf146f329 on Nov 27, 2018
  12. Munkybooty referenced this in commit 169a7809cc on Jul 30, 2021
  13. Munkybooty referenced this in commit b939c0968a on Jul 30, 2021
  14. christiancfifi referenced this in commit a0852942d3 on Aug 25, 2021
  15. christiancfifi referenced this in commit 980183457f on Aug 25, 2021
  16. christiancfifi referenced this in commit f0725aebf1 on Aug 25, 2021
  17. bitcoin locked this on Sep 8, 2021
  18. vijaydasmp referenced this in commit ae721857bb on Oct 26, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:54 UTC