<p>I created a multisignature address in regtest:</p>
<pre class="lang-sh prettyprint-override"><code>ADDR_1=`bitcoin-cli getnewaddress &quot;&quot; &quot;bech32&quot;`
ADDR_2=`bitcoin-cli getnewaddress &quot;&quot; &quot;bech32&quot;`
PB1=$(bitcoin-cli -named getaddressinfo address=$ADDR_1 | jq -r '.pubkey')
PB2=$(bitcoin-cli -named getaddressinfo address=$ADDR_2 | jq -r '.pubkey')
ADDR_P2SH_P2WPKH_NATIVE_2=`bitcoin-cli -named createmultisig nrequired=1 keys='''[&quot;'$PB1'&quot;,&quot;'$PB2'&quot;]''' address_type=&quot;bech32&quot; | jq -r '.address'`
</code></pre>
<p>After that, I generated 101 blocks:</p>
<p><code>bitcoin-cli generatetoaddress 101 $ADDR_P2SH_P2WPKH_NATIVE_2</code></p>
<p>Then, I wanted to retrieve the listunspent:</p>
<p><code>bitcoin-cli listunspent 1 101 '[&quot;'$ADDR_P2SH_P2WPKH_NATIVE_2'&quot;]'</code></p>
<p>However, it returned an empty result. So, I attempted to import the new address using addr():</p>
<pre><code>CHECKSUM=$(bitcoin-cli getdescriptorinfo &quot;addr($ADDR_P2SH_P2WPKH_NATIVE_2)&quot; | jq -r .checksum)
bitcoin-cli importdescriptors '[{ &quot;desc&quot;: &quot;addr('$ADDR_P2SH_P2WPKH_NATIVE_2')#'&quot;$CHECKSUM&quot;'&quot;, &quot;timestamp&quot;: &quot;now&quot;, &quot;internal&quot;: true }]'
</code></pre>
<p>This resulted in an error:</p>
<pre class="lang-json prettyprint-override"><code>[
  {
    &quot;success&quot;: false,
    &quot;error&quot;: {
      &quot;code&quot;: -4,
      &quot;message&quot;: &quot;Cannot import descriptor without private keys to a wallet with private keys enabled&quot;
    }
  }
]
</code></pre>
<p>I also tried:</p>
<pre class="lang-sh prettyprint-override"><code>CHECKSUM=$(bitcoin-cli getdescriptorinfo &quot;wsh(multi(1,$PB1,$PB2))&quot; | jq -r .checksum)
bitcoin-cli importdescriptors '[{ &quot;desc&quot;: &quot;wsh(multi(1,'$PB1','$PB2'))#'&quot;$CHECKSUM&quot;'&quot;, &quot;timestamp&quot;: &quot;now&quot;, &quot;internal&quot;: true }]'
</code></pre>
<p>But encountered the same result.</p>
<p>Another attempt is</p>
<pre><code>bitcoin-cli -named createwallet wallet_name=&quot;bia&quot; disable_private_keys=true
CHECKSUM=$(bitcoin-cli getdescriptorinfo &quot;wsh(multi(1,$PB1,$PB2))&quot; | jq -r .checksum)
bitcoin-cli -rpcwallet=bia importdescriptors '[{ &quot;desc&quot;: &quot;wsh(multi(1,'$PB1','$PB2'))#'&quot;$CHECKSUM&quot;'&quot;, &quot;timestamp&quot;: &quot;now&quot;, &quot;internal&quot;: true }]'
bitcoin-cli -rpcwallet=bia listunspent 1 101 '[&quot;'$ADDR_P2SH_P2WPKH_NATIVE_2'&quot;]'
</code></pre>
<p>it's still empty</p>

CC BY-SA 4.0
2023-12-10T14:43:47.800Z
You're passing `"timestamp": "now"`, implying that the address was only created now, so no rescanning of history will take place. You need to either explicitly rescan, or set the timestamp to a value before the first transaction to that address took place.
Pieter Wuille
CC BY-SA 4.0
2023-12-10T15:20:59.810Z
thanks for the reply, I need to create a new wallet and use -rpcwallet ? Because with other method I get the error about private keys
monkeyUser
CC BY-SA 4.0
2023-12-10T15:30:14.300Z
With descriptor wallets there doesn't exist a distinction between watch-only addresses and full addresses in the wallet anymore. Instead, the whole wallet is either watch-only or full.
Pieter Wuille
CC BY-SA 4.0
2023-12-10T18:50:38.270Z
you are right I can scan before mine the blocks and I can find UTXO available, but I need to create a new wallet with `disable_private_keys=true`? Only my last attempt work. in that way I will have a problem during the `signrawtransactionwithwallet`
monkeyUser
CC BY-SA 4.0
2023-12-10T21:12:24.677Z
If you want to be able to sign you'll need to have the descriptor with private keys imported.
Pieter Wuille
CC BY-SA 4.0
2023-12-11T07:01:38.833Z
yes, but I can retrieve the Private key if I use `getnewaddress`? I can't use `dumpprivkey` anymore. I'd like to use only Bitcoin-cli not an external tool
monkeyUser
CC BY-SA 4.0
2023-12-11T12:09:11.687Z
You can use `listdescriptors` to get the xprv of a wallet (set the flag to get private keys) and use those. You shouldn't need `createmultisig` anymore. Descriptor wallets generally don't have/use WIF keys anymore, unless you import them.
Pieter Wuille
CC BY-SA 4.0
2023-12-11T12:16:27.920Z
"You shouldn't need createmultisig anymore" because I should use `wsh(multi)` descriptor after retrieving the Xpriv -> Private key?
monkeyUser
CC BY-SA 4.0
2023-12-11T12:21:22.323Z
Yes, descriptors can do everything `createmultisig` can (and far more).
Pieter Wuille
CC BY-SA 4.0
2023-12-11T16:38:57.883Z
Okay, thanks. So, if I want to use a multi-signature address, I need to create the multi using private keys and descriptor instead of using createmultisig if I also want to sign the transaction.
monkeyUser
CC BY-SA 4.0
2023-12-11T16:40:51.860Z
There is even documentation on that topic: https://github.com/bitcoin/bitcoin/blob/master/doc/multisig-tutorial.md
Pieter Wuille
CC BY-SA 4.0
2023-12-14T07:51:51.313Z
Thanks Pieter, I followed the tutorial and it works. Understand a lot of new things. Thanks again for your time
monkeyUser
<bitcoin-core><wallet><multi-signature><bitcoin-cli><output-script-descriptors>
Cannot import multisignature descriptor in Bitcoin Core
monkeyUser
# Cannot import multisignature descriptor in Bitcoin Core

(Asked by: username_0 on 2023-12-10)

I created a multisignature address in regtest:
ADDR_1=`bitcoin-cli getnewaddress "" "bech32"`
ADDR_2=`bitcoin-cli getnewaddress "" "bech32"`
PB1=$(bitcoin-cli -named getaddressinfo address=$ADDR_1 | jq -r '.pubkey')
PB2=$(bitcoin-cli -named getaddressinfo address=$ADDR_2 | jq -r '.pubkey')
ADDR_P2SH_P2WPKH_NATIVE_2=`bitcoin-cli -named createmultisig nrequired=1 keys='''["'$PB1'","'$PB2'"]''' address_type="bech32" | jq -r '.address'`

After that, I generated 101 blocks:
bitcoin-cli generatetoaddress 101 $ADDR_P2SH_P2WPKH_NATIVE_2
Then, I wanted to retrieve the listunspent:
bitcoin-cli listunspent 1 101 '["'$ADDR_P2SH_P2WPKH_NATIVE_2'"]'
However, it returned an empty result. So, I attempted to import the new address using addr():
CHECKSUM=$(bitcoin-cli getdescriptorinfo "addr($ADDR_P2SH_P2WPKH_NATIVE_2)" | jq -r .checksum)
bitcoin-cli importdescriptors '[{ "desc": "addr('$ADDR_P2SH_P2WPKH_NATIVE_2')#'"$CHECKSUM"'", "timestamp": "now", "internal": true }]'

This resulted in an error:
[
  {
    "success": false,
    "error": {
      "code": -4,
      "message": "Cannot import descriptor without private keys to a wallet with private keys enabled"
    }
  }
]

I also tried:
CHECKSUM=$(bitcoin-cli getdescriptorinfo "wsh(multi(1,$PB1,$PB2))" | jq -r .checksum)
bitcoin-cli importdescriptors '[{ "desc": "wsh(multi(1,'$PB1','$PB2'))#'"$CHECKSUM"'", "timestamp": "now", "internal": true }]'

But encountered the same result.
Another attempt is
bitcoin-cli -named createwallet wallet_name="bia" disable_private_keys=true
CHECKSUM=$(bitcoin-cli getdescriptorinfo "wsh(multi(1,$PB1,$PB2))" | jq -r .checksum)
bitcoin-cli -rpcwallet=bia importdescriptors '[{ "desc": "wsh(multi(1,'$PB1','$PB2'))#'"$CHECKSUM"'", "timestamp": "now", "internal": true }]'
bitcoin-cli -rpcwallet=bia listunspent 1 101 '["'$ADDR_P2SH_P2WPKH_NATIVE_2'"]'

it's still empty

**Tags:** bitcoin-core, wallet, multi-signature, bitcoin-cli, output-script-descriptors

> **Comments:**
> **username_1**: You're passing `"timestamp": "now"`, implying that the address was only created now, so no rescanning of history will take place. You need to either explicitly rescan, or set the timestamp to a value before the first transaction to that address took place.  
> **username_0**: thanks for the reply, I need to create a new wallet and use -rpcwallet ? Because with other method I get the error about private keys  
> **username_1**: With descriptor wallets there doesn't exist a distinction between watch-only addresses and full addresses in the wallet anymore. Instead, the whole wallet is either watch-only or full.  
> **username_0**: you are right I can scan before mine the blocks and I can find UTXO available, but I need to create a new wallet with `disable_private_keys=true`? Only my last attempt work. in that way I will have a problem during the `signrawtransactionwithwallet`  
> **username_1**: If you want to be able to sign you'll need to have the descriptor with private keys imported.  
> **username_0**: yes, but I can retrieve the Private key if I use `getnewaddress`? I can't use `dumpprivkey` anymore. I'd like to use only Bitcoin-cli not an external tool  
> **username_1**: You can use `listdescriptors` to get the xprv of a wallet (set the flag to get private keys) and use those. You shouldn't need `createmultisig` anymore. Descriptor wallets generally don't have/use WIF keys anymore, unless you import them.  
> **username_0**: "You shouldn't need createmultisig anymore" because I should use `wsh(multi)` descriptor after retrieving the Xpriv -> Private key?  
> **username_1**: Yes, descriptors can do everything `createmultisig` can (and far more).  
> **username_0**: Okay, thanks. So, if I want to use a multi-signature address, I need to create the multi using private keys and descriptor instead of using createmultisig if I also want to sign the transaction.  
> **username_1**: There is even documentation on that topic: https://github.com/bitcoin/bitcoin/blob/master/doc/multisig-tutorial.md  
> **username_0**: Thanks Pieter, I followed the tutorial and it works. Understand a lot of new things. Thanks again for your time  

---

## 0 answers

