<p>I have tested setting watch-only to true and it gets rid of the errors and the node can still sign.</p>

CC BY-SA 4.0
2020-03-31T00:40:46.530Z
2020-03-31T00:40:46.530Z
Fontaine
<p>I am importing a "warm" multi-sig quorum into bitcoind using <code>importmulti</code> like so:</p>

<pre><code>{"jsonrpc":"1.0","id":"curltest","method":"importmulti","params":[[{ "desc": "sh(multi(2,[eb2d2f9e/44'/1'/0']tprv8g5heqz5AnCKdYQHsHyYvyDvWFdp5RN8Z5uhvb1FrzgPmeuYseQNsknt1KFf1b1Y9dtNaNMbxkaNdkP7FLbhP9a4UosbV5rWLAMFPhUcMVT/0/*,[e19b3701/44'/1'/0']tpubDCkUBfVNYjzdX37ARqSFWNAA5WvQRGy3Y5PA13ve1dSVtBLr7tEf6c7C2sYtnRazFfsfAdCfuv9JG62BnUVvofvvvs9iyDreQhTRJJ6Mp8u/0/*,[65b2e5d3/44'/1'/0']tpubDCFM6STEuVkkh6qCCooJw4TXHRzyq6R6tBeigSQSgf4xY6ZwAeoSQH2ZTTfcsZTrJ7wJF2bixpn38XcKj3KihxH5LzMraCLwsbt3bnkAHrU/0/*))#2pztwc0s", "timestamp": "now", "range": [2500,5000], "watchonly": false, "label": "StandUp", "keypool": false, "internal": false }], {"rescan": false}]}
</code></pre>

<p>And <em>occasionally</em> getting the following response (sometimes it works without returning an error and sometimes not):</p>

<pre><code>response = {
    error = "&lt;null&gt;";
    id = curltest;
    result =     (
                {
            error =             {
                code = "-4";
                message = "Error adding key to wallet";
            };
            success = 0;
            warnings =             (
                "Some private keys are missing, outputs will be considered watchonly. If this is intentional, specify the watchonly flag."
            );
        }
    );
}
</code></pre>

<p>I do not want to specify the watch-only flag to <code>true</code> as I am importing private keys into the node and want the node to be able to sign. It is very odd that this seems to happen randomly. It feels like a bug. </p>

<p>If I set watch-only to true will it still import the descriptors private keys?</p>

<p>Just to prove my point here is the exact same command attempted a second time which returns <code>success</code> as <code>true</code>:</p>

<pre><code>{"jsonrpc":"1.0","id":"curltest","method":"importmulti","params":[[{ "desc": "sh(multi(2,[eb2d2f9e/44'/1'/0']tprv8g5heqz5AnCKdYQHsHyYvyDvWFdp5RN8Z5uhvb1FrzgPmeuYseQNsknt1KFf1b1Y9dtNaNMbxkaNdkP7FLbhP9a4UosbV5rWLAMFPhUcMVT/0/*,[e19b3701/44'/1'/0']tpubDCkUBfVNYjzdX37ARqSFWNAA5WvQRGy3Y5PA13ve1dSVtBLr7tEf6c7C2sYtnRazFfsfAdCfuv9JG62BnUVvofvvvs9iyDreQhTRJJ6Mp8u/0/*,[65b2e5d3/44'/1'/0']tpubDCFM6STEuVkkh6qCCooJw4TXHRzyq6R6tBeigSQSgf4xY6ZwAeoSQH2ZTTfcsZTrJ7wJF2bixpn38XcKj3KihxH5LzMraCLwsbt3bnkAHrU/0/*))#2pztwc0s", "timestamp": "now", "range": [2500,5000], "watchonly": false, "label": "StandUp", "keypool": false, "internal": false }], {"rescan": false}]}
</code></pre>

<pre><code>response = {
    error = "&lt;null&gt;";
    id = curltest;
    result =     (
                {
            success = 1;
            warnings =             (
                "Some private keys are missing, outputs will be considered watchonly. If this is intentional, specify the watchonly flag."
            );
        }
    );
}
</code></pre>

<bitcoin-core><json-rpc><bitcoin-cli><output-script-descriptors><importmulti>
Will bitcoind import private keys for multi-sig descriptor with watch-only flag set to true?
Fontaine
# Will bitcoind import private keys for multi-sig descriptor with watch-only flag set to true?

(Asked by: username_0 on 2020-03-30)

I am importing a "warm" multi-sig quorum into bitcoind using `importmulti` like so:

```
{"jsonrpc":"1.0","id":"curltest","method":"importmulti","params":[[{ "desc": "sh(multi(2,[eb2d2f9e/44'/1'/0']tprv8g5heqz5AnCKdYQHsHyYvyDvWFdp5RN8Z5uhvb1FrzgPmeuYseQNsknt1KFf1b1Y9dtNaNMbxkaNdkP7FLbhP9a4UosbV5rWLAMFPhUcMVT/0/*,[e19b3701/44'/1'/0']tpubDCkUBfVNYjzdX37ARqSFWNAA5WvQRGy3Y5PA13ve1dSVtBLr7tEf6c7C2sYtnRazFfsfAdCfuv9JG62BnUVvofvvvs9iyDreQhTRJJ6Mp8u/0/*,[65b2e5d3/44'/1'/0']tpubDCFM6STEuVkkh6qCCooJw4TXHRzyq6R6tBeigSQSgf4xY6ZwAeoSQH2ZTTfcsZTrJ7wJF2bixpn38XcKj3KihxH5LzMraCLwsbt3bnkAHrU/0/*))#2pztwc0s", "timestamp": "now", "range": [2500,5000], "watchonly": false, "label": "StandUp", "keypool": false, "internal": false }], {"rescan": false}]}

```

And *occasionally* getting the following response (sometimes it works without returning an error and sometimes not):

```
response = {
    error = "<null>";
    id = curltest;
    result =     (
                {
            error =             {
                code = "-4";
                message = "Error adding key to wallet";
            };
            success = 0;
            warnings =             (
                "Some private keys are missing, outputs will be considered watchonly. If this is intentional, specify the watchonly flag."
            );
        }
    );
}

```

I do not want to specify the watch-only flag to `true` as I am importing private keys into the node and want the node to be able to sign. It is very odd that this seems to happen randomly. It feels like a bug.

If I set watch-only to true will it still import the descriptors private keys?

Just to prove my point here is the exact same command attempted a second time which returns `success` as `true`:

```
{"jsonrpc":"1.0","id":"curltest","method":"importmulti","params":[[{ "desc": "sh(multi(2,[eb2d2f9e/44'/1'/0']tprv8g5heqz5AnCKdYQHsHyYvyDvWFdp5RN8Z5uhvb1FrzgPmeuYseQNsknt1KFf1b1Y9dtNaNMbxkaNdkP7FLbhP9a4UosbV5rWLAMFPhUcMVT/0/*,[e19b3701/44'/1'/0']tpubDCkUBfVNYjzdX37ARqSFWNAA5WvQRGy3Y5PA13ve1dSVtBLr7tEf6c7C2sYtnRazFfsfAdCfuv9JG62BnUVvofvvvs9iyDreQhTRJJ6Mp8u/0/*,[65b2e5d3/44'/1'/0']tpubDCFM6STEuVkkh6qCCooJw4TXHRzyq6R6tBeigSQSgf4xY6ZwAeoSQH2ZTTfcsZTrJ7wJF2bixpn38XcKj3KihxH5LzMraCLwsbt3bnkAHrU/0/*))#2pztwc0s", "timestamp": "now", "range": [2500,5000], "watchonly": false, "label": "StandUp", "keypool": false, "internal": false }], {"rescan": false}]}

```

```
response = {
    error = "<null>";
    id = curltest;
    result =     (
                {
            success = 1;
            warnings =             (
                "Some private keys are missing, outputs will be considered watchonly. If this is intentional, specify the watchonly flag."
            );
        }
    );
}

```

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


---

## 1 answers

### Answer by username_0 on 2020-03-31. Score: 0

I have tested setting watch-only to true and it gets rid of the errors and the node can still sign.


---

