2

I used to tapscript to generate a taproot address thus I don't know what the related xpub key would be so I can't easily import a descriptor. I know that bitcoin-cli version 21 was able to watch a readonly address with the following command:

 bitcoin-cli importmulti '[{"scriptPubKey": {"address": "bcrt1pp375ce9lvxs8l9rlsl78u4szhqa7za748dfhtjj5ht05lufu4dwsshpxl6"},"timestamp":1662835676}]' '{"rescan":false}'
 

However, the same command for bitcoin version 23 returns the following error

"This type of wallet does not support this command"

How can I rewrite the command above to watch a read-only address in bitcoin version 23? just like in bitcoin version 21


getdescriptorinfo

createwallet

importdescriptors

after getting the correct descriptor, creating a wallet, and importing the descriptor we are still getting the following error.

1

1 Answer 1

5

The software version is unrelated to this error. You get this error because the target wallet is a Descriptor wallet (which exist prior to 23.0). importmulti is not allowed to be used with descriptor wallets. However you can use importdescriptors.

Not all descriptors must have xpubs. If you know the spending conditions for the address (internal key, tapscripts, and the tapscript tree), then you can create a tr() descriptor with normal pubkeys.

Otherwise you can create an addr() descriptor and import that instead. That would be addr(bcrt1pp375ce9lvxs8l9rlsl78u4szhqa7za748dfhtjj5ht05lufu4dwsshpxl6).

Note that you may need to create a new wallet with the "Disable Private Keys" option.


The full command that you should use is

bitcoin-cli -rpcwallet=mywallet importdescriptors '[{"desc":"addr(bcrt1pp375ce9lvxs8l9rlsl78u4szhqa7za748dfhtjj5ht05lufu4dwsshpxl6)#ngm593tu","timestamp":"now"}]'

You do not need to specify internal, watchonly, or active. You have currently specified "active": true which is incorrect as such a descriptor cannot be used as an active descriptor (i.e. it cannot be used to create new addresses).

6
  • bitcoin@backend1:/$ bitcoin-cli importdescriptors '[{ "desc": "addr(bcrt1pp375ce9lvxs8l9rlsl78u4szhqa7za748dfhtjj5ht05lufu4dwsshpxl6)", Commented Sep 13, 2022 at 4:42
  • "timestamp":1662835676, "internal": true }]' [ { "success": false, "error": { "code": -5, "message": "Missing checksum" } } ] Commented Sep 13, 2022 at 4:42
  • The first comment yields the result above what would be the checksum? that's missing Commented Sep 13, 2022 at 4:43
  • @AshleyHendricskon get complete descriptor with checksum using bitcoin-cli getdescriptorinfo "addr(bcrt1pp375ce9lvxs8l9rlsl78u4szhqa7za748dfhtjj5ht05lufu4dwsshpxl6)"
    – user133407
    Commented Sep 13, 2022 at 4:43
  • 2
    @AshleyHendricskon Please add additional information to your question rather than to a fake answer. Your question has an "Edit" link below it. It is also far better to add text rather than images of text. Commented Sep 13, 2022 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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