<p>This will be mostly possible in the upcoming Bitcoin Core 0.18 release.</p>

<p>First you need to understand that the sequence of such paired multisig addresses (with public keys generated from 2 xpubs in lockstep) can be described in the new descriptor language.</p>

<p>The syntax is <code>sh(multi(2,XPUB/*,XPUB/*))</code>. The <code>sh</code> indicates P2SH embedding, <code>multi</code> refers to multisig, the <code>2</code> means 2 signatures are required, and the two XPUB arguments are what the public keys are drawn from.</p>

<p>As descriptors are intended to be safe for human communication, they need a checksum in some cases. This checksum can be computed using the <code>getdescriptorinfo</code> RPC command, which will append a <code>#CHECKSUM</code> suffix.</p>

<p>Once you have the descriptor, you can do multiple things with it. One is determining the corresponding addresses using <code>deriveaddresses</code>.</p>

<pre><code>bitcoin-cli deriveaddresses "DESC" [0,1000]
</code></pre>

<p>Will give you the first 1001 addresses (using keys with indexed 0 through 1000) for your descriptor.</p>

<p>You can also import them into a wallet, all at once using the flexible <code>importmulti</code> RPC, which in 0.18 is extended to support descriptors.</p>

<pre><code>bitcoin-cli importmulti [{"desc" : "DESC", "range" : [0, 1000], "watchonly" : true, "timestamp" : "now"}]
</code></pre>

<p>Will import the first 1000 addresses, together will all information necessary to recognize payments to them, and sign for spending them (excluding the private keys, of course).</p>

<ul>
<li>The <code>watchonly</code> indicates you're aware private keys are missing, but want to import as watched anyway.</li>
<li>The <code>timestamp</code> indicates the first time these keys may have been used. <code>"now"</code> means you know the keys haven't been used yet (or you don't care about their history); alternatively you can give a timestamp as the number of seconds since UNIX epoch to specify a birth time.</li>
</ul>

<p>Note that this will not automatically watch for more than the first 1000 addresses as they get consumed - you'll need a new import command for that (for now).</p>

CC BY-SA 4.0
2019-09-05T02:40:16.410Z
Ive finally put this to test and it is really handy. Any idea when importing an xprv in this manner will allow private key importing? It would be really nice to have an offline node that I can import xprv into to be the final signer of my HD musig transactions.
Fontaine
CC BY-SA 4.0
2019-04-16T00:29:14.243Z
2019-04-16T19:36:16.217Z
2019-04-16T19:36:16.217Z
Pieter Wuille
<p>I can create multisignature wallet in Electrum from two xpub keys.</p>
<p>How can I use Bitcoin Core to do that?</p>
<p>Standard use:
Add a multisig address from 2 addresses</p>
<blockquote>
<p>bitcoin-cli addmultisigaddress 2 &quot;[&quot;16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5&quot;,&quot;171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV&quot;]&quot;</p>
</blockquote>
<p>Is there way to do like:</p>
<blockquote>
<p>bitcoin-cli addmultisigaddress 2 &quot;[&quot;tpubDAenfwNu5GyCJWv8oqRAckdKMSUoZjgVF5p8WvQwHQeXjDhAHmGrPa4a4y2Fn7HF2nfCLefJanHV3ny1UY25MRVogizB2zRUdAo7Tr9XAjm&quot;,&quot;tprv8erNzbjXdtYpKbKF4HeZpBCQj2W64MS2SAJCcWxgqLueSZ9KLTPZGoDTu8NugecLLqeS2RYan2f6qcexUTjp3m2HGxmpAiP48BaUz7XHxzQ&quot;]&quot;</p>
</blockquote>

<wallet><bitcoind><multi-signature><xpub><output-script-descriptors>
Create multisignature wallet from xpub keys in Bitcoin Core
Saim Neftci
# Create multisignature wallet from xpub keys in Bitcoin Core

(Asked by: username_0 on 2019-04-15)

I can create multisignature wallet in Electrum from two xpub keys.

How can I use Bitcoin Core to do that?

Standard use:
Add a multisig address from 2 addresses

> bitcoin-cli addmultisigaddress 2 "["16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5","171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV"]"

Is there way to do like:

> bitcoin-cli addmultisigaddress 2 "["tpubDAenfwNu5GyCJWv8oqRAckdKMSUoZjgVF5p8WvQwHQeXjDhAHmGrPa4a4y2Fn7HF2nfCLefJanHV3ny1UY25MRVogizB2zRUdAo7Tr9XAjm","tprv8erNzbjXdtYpKbKF4HeZpBCQj2W64MS2SAJCcWxgqLueSZ9KLTPZGoDTu8NugecLLqeS2RYan2f6qcexUTjp3m2HGxmpAiP48BaUz7XHxzQ"]"

**Tags:** wallet, bitcoind, multi-signature, xpub, output-script-descriptors


---

## 1 answers

### Answer by username_1 on 2019-04-16. Score: 4 | Accepted answer

This will be mostly possible in the upcoming Bitcoin Core 0.18 release.

First you need to understand that the sequence of such paired multisig addresses (with public keys generated from 2 xpubs in lockstep) can be described in the new descriptor language.

The syntax is `sh(multi(2,XPUB/*,XPUB/*))`. The `sh` indicates P2SH embedding, `multi` refers to multisig, the `2` means 2 signatures are required, and the two XPUB arguments are what the public keys are drawn from.

As descriptors are intended to be safe for human communication, they need a checksum in some cases. This checksum can be computed using the `getdescriptorinfo` RPC command, which will append a `#CHECKSUM` suffix.

Once you have the descriptor, you can do multiple things with it. One is determining the corresponding addresses using `deriveaddresses`.

```
bitcoin-cli deriveaddresses "DESC" [0,1000]

```

Will give you the first 1001 addresses (using keys with indexed 0 through 1000) for your descriptor.

You can also import them into a wallet, all at once using the flexible `importmulti` RPC, which in 0.18 is extended to support descriptors.

```
bitcoin-cli importmulti [{"desc" : "DESC", "range" : [0, 1000], "watchonly" : true, "timestamp" : "now"}]

```

Will import the first 1000 addresses, together will all information necessary to recognize payments to them, and sign for spending them (excluding the private keys, of course).

* The `watchonly` indicates you're aware private keys are missing, but want to import as watched anyway.
* The `timestamp` indicates the first time these keys may have been used. `"now"` means you know the keys haven't been used yet (or you don't care about their history); alternatively you can give a timestamp as the number of seconds since UNIX epoch to specify a birth time.

Note that this will not automatically watch for more than the first 1000 addresses as they get consumed - you'll need a new import command for that (for now).

> **Comments:**
> **username_2**: Ive finally put this to test and it is really handy. Any idea when importing an xprv in this manner will allow private key importing? It would be really nice to have an offline node that I can import xprv into to be the final signer of my HD musig transactions.  

---

