<p>Descriptors in Bitcoin Core can have a suffixed <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#checksums" rel="nofollow noreferrer">checksum</a>. </p>

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

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

<pre><code>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
}
</code></pre>

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

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

CC BY-SA 4.0
2019-09-28T12:50:29.053Z
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
CC BY-SA 4.0
2019-09-28T12:59:44.863Z
would a descriptor in regtest create a different checksum then a descriptor in testnet or mainnet? Maybe that is it.
Fontaine
CC BY-SA 4.0
2021-07-21T19:33:24.697Z
The xpub/xprv and address format used inside descriptors is network dependent.
Pieter Wuille
CC BY-SA 4.0
2019-09-28T08:42:32.877Z
2019-09-28T08:42:32.877Z
0xb10c
<p>I am using Bitcoin Core <code>bitcoin-cli</code> with <code>getdescriptorinfo</code> like so:</p>

<pre><code>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/
</code></pre>

<p>But it returns <code>Invalid descriptor (code -5)</code></p>

<p>What am I doing wrong?</p>

CC BY-SA 4.0
2019-09-28T16:29:12.750Z
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 (https://github.com/bitcoin/bitcoin/pull/16542). This change will be available in 0.19.
Ava Chow
<bitcoin-core><json-rpc><bitcoin-cli><output-script-descriptors><checksum>
Why is getdescriptorinfo returning an error "Invalid descriptor (code -5)"
Fontaine
# Why is getdescriptorinfo returning an error "Invalid descriptor (code -5)"

(Asked by: username_0 on 2019-09-27)

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?

**Tags:** bitcoin-core, json-rpc, bitcoin-cli, output-script-descriptors, checksum

> **Comments:**
> **username_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 (https://github.com/bitcoin/bitcoin/pull/16542). This change will be available in 0.19.  

---

## 1 answers

### Answer by username_2 on 2019-09-28. Score: 1

Descriptors in Bitcoin Core can have a suffixed [checksum](https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#checksums).

```
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?

> **Comments:**
> **username_0**: 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.  
> **username_0**: would a descriptor in regtest create a different checksum then a descriptor in testnet or mainnet? Maybe that is it.  
> **username_3**: The xpub/xprv and address format used inside descriptors is network dependent.  

---

