Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: TracaChang on April 06, 2022, 10:24:14 PM



Title: How to upgrade wallet for taproot support in versions <23?
Post by: TracaChang on April 06, 2022, 10:24:14 PM
I am trying Bitcoin Core v 23.0 RC3,

I create a new wallet and in receiving tab I can choose Bech32m(taproot).

Using a wallet created with descriptors=true with the precedent version 22.0 does not allow me to receive Bech32taproot (which is normal, since by that time "desc": "tr was not present), so I was wondering how could I upgrade the wallet.

I have tried to upgrade with
Code:
upgradewallet

But it is already updated:
Code:
{
  "wallet_name": "wallet_22.0",
  "previous_version": 169900,
  "current_version": 169900,
  "result": "Already at latest version. Wallet version unchanged."
}

Thank you


Title: Re: How to upgrade wallet for taproot support in versions <23?
Post by: nc50lc on April 07, 2022, 05:21:49 AM
I can't find any PR that added any "taproot upgrade" wallet command or GUI feature, it's only added by default for newly created descriptor wallets.

For now, you can manually import a new tr() parent descriptor for it to be able to create Bech32m addresses.
The steps are similar to this post: bitcoin.stackexchange.com/questions/108006/how-to-make-a-taproot-transaction-with-bitcoin-cli (https://bitcoin.stackexchange.com/questions/108006/how-to-make-a-taproot-transaction-with-bitcoin-cli/108013)
But instead of xpub, use xprv.

That version is still in development so it's still open for updates.
Try to open a new issue - feature request: something like "add an option to create taproot descriptor for old descriptor wallets".


Title: Re: How to upgrade wallet for taproot support in versions <23?
Post by: TracaChang on April 07, 2022, 05:50:55 PM
Try to open a new issue - feature request: something like "add an option to create taproot descriptor for old descriptor wallets".

Thank you. I've just opened a new issue-feature request: https://github.com/bitcoin/bitcoin/issues/24801


Title: Re: How to upgrade wallet for taproot support in versions <23?
Post by: achow101 on April 11, 2022, 02:04:44 AM
That's expected behavior. The feature is not yet implemented as there is a prerequisite refactor that has not been merged yet.


Title: Re: How to upgrade wallet for taproot support in versions <23?
Post by: TracaChang on April 11, 2022, 06:21:06 PM
That's expected behavior. The feature is not yet implemented as there is a prerequisite refactor that has not been merged yet.

Thanks for the answer, I will close the github issue.

Reading the pull request you mention https://github.com/bitcoin/bitcoin/pull/23417

Quote
This allows us to have a concept of a wallet HD key for descriptor wallets. This makes it easier to add new single key descriptors that use the same HD master key as the rest of the autogenerated descriptors (e.g. for taproot). Multisigs will also be easier as an xpub belonging to the wallet can be exported without needing to do weird things like descriptor introspection and guessing about which descriptor's key to use.

Does it means that when it will be implemented it will be also easier to create a watch only wallet to create unsigned transactions? For now what I do is create a wallet offline, get the descriptors info with "listdescriptors" and export to the watch only wallet as mentioned here: https://bitcointalk.org/index.php?topic=5392824.0 (https://bitcointalk.org/index.php?topic=5392824.0)

I was wondering that when taproot descriptors are added for old descriptor wallets I would just repeat the same steps, is that correct or another way to do it will be possible?



Title: Re: How to upgrade wallet for taproot support in versions <23?
Post by: achow101 on April 12, 2022, 02:14:22 AM
Does it means that when it will be implemented it will be also easier to create a watch only wallet to create unsigned transactions? For now what I do is create a wallet offline, get the descriptors info with "listdescriptors" and export to the watch only wallet as mentioned here: https://bitcointalk.org/index.php?topic=5392824.0 (https://bitcointalk.org/index.php?topic=5392824.0)
No, you will still need to get the descriptors explicitly to make a watch only wallet. It is not enough to just have a xpub.

I was wondering that when taproot descriptors are added for old descriptor wallets I would just repeat the same steps, is that correct or another way to do it will be possible?
There will be a new RPC rather than reusing upgradewallet.