1

I am using Bitcoin Core bitcoin-cli with getdescriptorinfo like so:

curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdescriptorinfo", "params":["sh(multi(2,[3c60330a/1]03061b79f20d49790c15bdaf15ec8db6d75275f62f04a56eaac31f5c2db48736fc,[d54e4481/1]0396bd8d30f0128dcc67e143cf46efd686bf9e4dc8587facc07f81bb248d1b0209,[1e132a06/1]03c77aa842edc8af76b76f5c29a1133b45b78c8c26a170090184e500232abd15a4))#3qpdv9la"] }' -H 'content-type: text/plain;' http://bitcoin:password@127.0.0.1:18332/

But it returns Invalid descriptor (code -5)

What am I doing wrong?

  • 1
    If you are willing to compile Bitcoin Core from source, there is a change in the current master branch that will return more specific errors about descriptors (github.com/bitcoin/bitcoin/pull/16542). This change will be available in 0.19. – Andrew Chow Sep 28 at 16:29
0

Descriptors in Bitcoin Core can have a suffixed checksum.

sh(multi(2,
[3c60330a/1]03061b79f20d49790c15bdaf15ec8db6d75275f62f04a56eaac31f5c2db48736fc,
[d54e4481/1]0396bd8d30f0128dcc67e143cf46efd686bf9e4dc8587facc07f81bb248d1b0209,
[1e132a06/1]03c77aa842edc8af76b76f5c29a1133b45b78c8c26a170090184e500232abd15a4))
#3qpdv9la

You pass the checksum 3qpdv9la. However if I call getdescriptorinfo without the checksum (see below) a checksum of 539k404m is calculated for that descriptor.

bitcoin-cli getdescriptorinfo "sh(multi(2,[3c60330a/1]03061b79f20d49790c15bdaf15ec8db6d75275f62f04a56eaac31f5c2db48736fc,[d54e4481/1]0396bd8d30f0128dcc67e143cf46efd686bf9e4dc8587facc07f81bb248d1b0209,[1e132a06/1]03c77aa842edc8af76b76f5c29a1133b45b78c8c26a170090184e500232abd15a4))"
{
  "descriptor": "sh(multi(2,[3c60330a/1]03061b79f20d49790c15bdaf15ec8db6d75275f62f04a56eaac31f5c2db48736fc,[d54e4481/1]0396bd8d30f0128dcc67e143cf46efd686bf9e4dc8587facc07f81bb248d1b0209,[1e132a06/1]03c77aa842edc8af76b76f5c29a1133b45b78c8c26a170090184e500232abd15a4))#539k404m",
  "isrange": false,
  "issolvable": true,
  "hasprivatekeys": false
}

Invalid descriptor (code -5) is returned, because your descriptor doesn't match the checksum you provide.

Did you enter the descriptor by hand (i.e. not copy pasting)? Where did you get the descriptor from?

  • The descriptor came from the json result Bitcoin Core returned when calling bitcoin-cli getaddressinfo, I will try and replicate the whole process and edit the OP. – Fontaine Sep 28 at 12:50
  • would a descriptor in regtest create a different checksum then a descriptor in testnet or mainnet? Maybe that is it. – Fontaine Sep 28 at 12:59
  • No, descriptors are totally wallet/node/network independent. – 0xb10c Sep 28 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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