<!-- Describe the issue -->
Issue:
The Checksum generated by getdescriptorinfo is not accepted when I use it in importdescriptors. The two RPC calls calculate a different checksum for the same descriptor.
<!--- What behavior did you expect? -->
I ran the following commands on MacOS with bitcoind v0.21.1 installed. Since my descriptor lacked a checksum, I used getdescriptorinfo to generate one, as I read here: https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#checksums
The checksum for a descriptor without one can be computed using the getdescriptorinfo RPC.
I expected the checksum generated by getdescriptorinfo to be accepted by importdescriptors. It was not.
<!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->
The actual behavior is below. I am redacting the actual descriptors/hashes for personal privacy.
$ bitcoin-cli --version
Bitcoin Core RPC client version v0.21.1
# getdescriptorinfo generates a checksum beginning with 3a.
$ bitcoin-cli getdescriptorinfo "<DESCRIPTOR>"
{
"descriptor": "<DESCRIPTOR>#3a...",
"checksum": "3a...",
"isrange": false,
"issolvable": true,
"hasprivatekeys": false
}
# importdescriptors rejects the checksum generated by getdescriptorinfo and calculates its own different one
$ bitcoin-cli -rpcwallet=my_wallet importdescriptors '[{ "desc": "<DESCRIPTOR>#3a...", "timestamp": "now" }]'
[
{
"success": false,
"error": {
"code": -5,
"message": "Provided checksum '3a...' does not match computed checksum '6z...'"
}
}
]
# importdescriptors properly accepts the checksum provided by itself.
$ bitcoin-cli -rpcwallet=my_wallet importdescriptors '[{ "desc": "<DESCRIPTOR>#6z...", "timestamp": "now" }]'
[
{
"success": true
}
]
# Using checksum expected by importdescriptors throws an error when used in getdescriptorinfo cmd
$ bitcoin-cli getdescriptorinfo "<DESCRIPTOR>#6z..."
error code: -5
error message:
Provided checksum '6z40f68x' does not match computed checksum '3av8evsc'
System information
<!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->
Bitcoin Core info: Bitcoin Core RPC client version v0.21.1 Downloaded from Bitcoin.org binary. Not compiled from source.
<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->
Machine/OS: MacOS Catalina 10.15.6 Memory 16GB