<blockquote>
<p><code>Cannot import descriptor without private keys to a wallet with private keys enabled</code></p>
</blockquote>
<p>This error seems to indicate that you are trying to add a watch-only address to a wallet that has private key material and Bitcoin Core doesn’t allow mixing the two.</p>
<p>I would suggest that you try creating a watch-only wallet: according to <a href="https://bitcoin.stackexchange.com/a/121310/5406">How to use a watch-only wallet in Bitcoin Core?</a>, you can create a wallet with &quot;disabled private keys&quot; from the wallet creation menu, and the RPC documentation for <a href="https://bitcoincore.org/en/doc/27.0.0/rpc/wallet/createwallet/" rel="nofollow noreferrer"><code>createwallet</code></a> indicates that you can do it from the command line by calling</p>
<p>bitcoin-cli createwallet &quot;wallet_name&quot; true</p>
<p>where the second argument is <code>disable_private_keys</code>:</p>
<blockquote>
<ol start="2">
<li>disable_private_keys    (boolean, optional, default=false) Disable the possibility of private keys (only watchonlys are possible in this mode).</li>
</ol>
</blockquote>

CC BY-SA 4.0
2024-09-12T21:09:20.203Z
Thanks for clarifying this - i found the solution, thanks! Unfortunately i can still not implement an active descriptor for a wsh(multi)) descriptor (so multisig).

If i do delcare a range, it shows "Range should not be specified for an un-ranged descriptor" - if i do not declare a range it says "Active descriptors must be ranged".

Really struggling with it, ugh.
zbder
CC BY-SA 4.0
2024-09-13T02:52:02.453Z
@zbder: Sorry to hear that. Could you please start another topic for that one? I think it would be easiest addressed if it were a new question.
Murch
CC BY-SA 4.0
2024-09-12T14:08:48.007Z
2024-09-13T02:50:41.270Z
2024-09-13T02:50:41.270Z
Murch
<p>I'm stuck on this problem since yesterday and I don't get how to fix it. How do I import a multisig address to my bitcoin-cli wallet?</p>
<p>I am currently doing this:</p>
<pre class="lang-php prettyprint-override"><code>public function generateMultisigWallet($serverPubkey, $initiatorPubkey, $partnerPubkey) {
    $multisig = $this-&gt;request('createmultisig', [2, [$serverPubkey, $initiatorPubkey, $partnerPubkey], 'p2sh-segwit']);
    $multisig = json_decode($multisig)-&gt;result;

    if(!isset($multisig-&gt;address)) {
        return [false, '', ''];
    }

    $this-&gt;importMultisig($serverPubkey, $initiatorPubkey, $partnerPubkey);

    return [true, $multisig-&gt;address, $multisig-&gt;redeemScript];
}

public function importMultisig($key1, $key2, $key3) {
    $descriptor = 'sh(multi(2,'.$key1.','.$key2.','.$key3.'))';
    
    $descriptorInfo = $this-&gt;request('getdescriptorinfo', [$descriptor]);
    $descriptorWithChecksum = json_decode($descriptorInfo)-&gt;result-&gt;descriptor;

    $importData = [
        [
            'desc' =&gt; $descriptorWithChecksum,
            'timestamp' =&gt; 'now',
            &quot;label&quot; =&gt; &quot;my_multisig_wallet&quot;
        ]
    ];

    $result = $this-&gt;request('importdescriptors', [$importData]);

    var_dump(&quot;RESULT IS :&quot;);
    var_dump($result);
    return $result;
}
</code></pre>
<p>The problem is, I cannot get around the Error Message &quot;Cannot import descriptor without private keys to a wallet with private keys enabled&quot; for it, if I do not import the address I cannot get unspent UXTOs nor walletnotify works - does anybody have a solution for this? Would be extremely thankful if somebody could provide assistance.</p>

<bitcoin-core><watch-only><importaddress>
How can I import a multisig address to my wallet?
zbder
# How can I import a multisig address to my wallet?

(Asked by: username_0 on 2024-09-12)

I'm stuck on this problem since yesterday and I don't get how to fix it. How do I import a multisig address to my bitcoin-cli wallet?
I am currently doing this:
public function generateMultisigWallet($serverPubkey, $initiatorPubkey, $partnerPubkey) {
    $multisig = $this->request('createmultisig', [2, [$serverPubkey, $initiatorPubkey, $partnerPubkey], 'p2sh-segwit']);
    $multisig = json_decode($multisig)->result;

    if(!isset($multisig->address)) {
        return [false, '', ''];
    }

    $this->importMultisig($serverPubkey, $initiatorPubkey, $partnerPubkey);

    return [true, $multisig->address, $multisig->redeemScript];
}

public function importMultisig($key1, $key2, $key3) {
    $descriptor = 'sh(multi(2,'.$key1.','.$key2.','.$key3.'))';
    
    $descriptorInfo = $this->request('getdescriptorinfo', [$descriptor]);
    $descriptorWithChecksum = json_decode($descriptorInfo)->result->descriptor;

    $importData = [
        [
            'desc' => $descriptorWithChecksum,
            'timestamp' => 'now',
            "label" => "my_multisig_wallet"
        ]
    ];

    $result = $this->request('importdescriptors', [$importData]);

    var_dump("RESULT IS :");
    var_dump($result);
    return $result;
}

The problem is, I cannot get around the Error Message "Cannot import descriptor without private keys to a wallet with private keys enabled" for it, if I do not import the address I cannot get unspent UXTOs nor walletnotify works - does anybody have a solution for this? Would be extremely thankful if somebody could provide assistance.

**Tags:** bitcoin-core, watch-only, importaddress


---

## 1 answers

### Answer by username_1 on 2024-09-12. Score: 1 | Accepted answer

> `Cannot import descriptor without private keys to a wallet with private keys enabled`

This error seems to indicate that you are trying to add a watch-only address to a wallet that has private key material and Bitcoin Core doesn’t allow mixing the two.

I would suggest that you try creating a watch-only wallet: according to [How to use a watch-only wallet in Bitcoin Core?](https://bitcoin.stackexchange.com/a/121310/5406), you can create a wallet with "disabled private keys" from the wallet creation menu, and the RPC documentation for [`createwallet`](https://bitcoincore.org/en/doc/27.0.0/rpc/wallet/createwallet/) indicates that you can do it from the command line by calling

bitcoin-cli createwallet "wallet\_name" true

where the second argument is `disable_private_keys`:

> 2. disable\_private\_keys (boolean, optional, default=false) Disable the possibility of private keys (only watchonlys are possible in this mode).

> **Comments:**
> **username_0**: Thanks for clarifying this - i found the solution, thanks! Unfortunately i can still not implement an active descriptor for a wsh(multi)) descriptor (so multisig).  If i do delcare a range, it shows "Range should not be specified for an un-ranged descriptor" - if i do not declare a range it says "Active descriptors must be ranged".  Really struggling with it, ugh.  
> **username_1**: @username_0: Sorry to hear that. Could you please start another topic for that one? I think it would be easiest addressed if it were a new question.  

---

