4

I created a transaction that creates a taproot output that can be spent using the private key (KEY) corresponding to the taproot output key. Then I imported the WIF formatted private key into Bitcoin Core with importdescriptors '[{"desc: rawtr(KEY), "timestamp":"now" ..."}]', which was successful. With listdescriptors I can see that it is in the wallet but with listunspent the taproot output does not show up.

How can I tell the wallet to recognize the taproot output as spendable?

I've also tried setting the descriptor to active but then it tells me only ranged descriptors can be active and I'm unsure how to add a range to a rawtr(KEY) descriptor.

raphjaph
  • 61
  • 5
  • Can you retrieve the transaction using `gettransaction`? If not, try rescanning the blockchain first. – Andrew Chow Dec 06 '22 at 23:37
  • Yes, I can retrieve it with `bitcoin-cli -chain=signet gettransaction 26651571eb31f9ea4f400615bd5fb834a2b0aa120a03074eac889651ffefbd0d `. The wallet I'm doing this with contains multiple descriptors and the rawtr descriptor looks like this: `{ "desc": "rawtr(83462993476e9310eda5cd58c3597f64aa25c68c03ef37dfd69cf46a7bfb26b8)#m8wpngyu", "timestamp": 1670360788, "active": false }` – raphjaph Dec 07 '22 at 17:14
  • Is that what you used to import or what `listdescriptors` returns? – Andrew Chow Dec 07 '22 at 17:45
  • This is what `listdescriptors` returns – raphjaph Dec 07 '22 at 18:08
  • I think it always returns the public key in canonical form (hex) instead of the private key which is bas58 (WIF). – raphjaph Dec 07 '22 at 18:09
  • Everything works now. I added an EDIT to the question but am unsure if this is the proper etiquette. Should I delete the question instead? – raphjaph Dec 07 '22 at 20:16
  • 2
    If you solved your own question, please add an answer to describe how :) – Murch Dec 07 '22 at 21:02

1 Answers1

2

The problem was that the wallet couldn't recognize the utxo with listunspent because I put the wrong private key into the descriptor. rawtr(KEY) takes a tweaked private key and I accidentally put the untweaked private key into it. After I corrected the wallet was able to recognize and spend the utxo.

raphjaph
  • 61
  • 5