<p><code>createmultisig</code> is likely giving you the p2sh-segwit address, not the p2sh one. This means that the "redeemScript" you get from it is actually the <code>witnessScript</code> and the real <code>redeemScript</code> is the p2wsh script for your <code>witnessScript</code>. You can tell <code>createmultisig</code> to create just a p2sh address by setting the address type parameter to <code>legacy</code>.</p>

<p>Alternatively, you can get the <code>redeemScript</code> for your <code>witnessScript by using</code>decodescript<code>.</code>decodescript` will first decode your script, then it will give you the various possible addresses for it (for each address type available) along with the scripts for them.</p>

CC BY-SA 4.0
2019-07-19T04:22:16.920Z
Or even better, use the descriptor based importmulti.
Pieter Wuille
CC BY-SA 4.0
2019-07-19T05:54:15.563Z
Thanks to you both. I will try the descriptor based approach.
Fontaine
CC BY-SA 4.0
2019-07-19T04:03:40.437Z
2019-07-19T04:03:40.437Z
Ava Chow
<p>I create a 2 of 2 with <code>createmultisig</code> using <code>02254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f8613</code> and <code>02ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc9</code> pubkeys.</p>

<p>I then </p>

<pre><code>curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importmulti", "params":[[{ "scriptPubKey": { "address": "2NETfDLgh1VmER2RGRnEeWqx73Hn4xhJpU5" }, "label": "Imported MultiSig", "timestamp": "now", "keypool": false, "internal": false, "redeemscript": "522102254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f86132102ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc952ae", "pubkeys": ["02254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f8613", "02ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc9"] }], ''{"rescan": false}''] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:18332/

</code></pre>

<p>Which returns a warning:</p>

<pre><code>success = 1;
            warnings =             (
                "Importing as non-solvable: redeemScript does not match the scriptPubKey. If this is intentional, don't provide any keys, pubkeys, witnessscript, or redeemscript."
            );

</code></pre>

<p>I am using the address and redemption script <code>createmultisig</code> returns.</p>

<p>What am I doing wrong? Why is the redemption script incorrect?</p>

<p>My goal is to add the multi sig wallet to my node so that I can build transactions with the wallet without having to manually input the redemption script. </p>

<bitcoin-core><json-rpc><multi-signature><bitcoin-cli>
How to import multi sig using importmulti correctly?
Fontaine
# How to import multi sig using importmulti correctly?

(Asked by: username_0 on 2019-07-19)

I create a 2 of 2 with `createmultisig` using `02254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f8613` and `02ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc9` pubkeys.

I then

```
curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importmulti", "params":[[{ "scriptPubKey": { "address": "2NETfDLgh1VmER2RGRnEeWqx73Hn4xhJpU5" }, "label": "Imported MultiSig", "timestamp": "now", "keypool": false, "internal": false, "redeemscript": "522102254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f86132102ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc952ae", "pubkeys": ["02254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f8613", "02ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc9"] }], ''{"rescan": false}''] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:18332/

```

Which returns a warning:

```
success = 1;
            warnings =             (
                "Importing as non-solvable: redeemScript does not match the scriptPubKey. If this is intentional, don't provide any keys, pubkeys, witnessscript, or redeemscript."
            );

```

I am using the address and redemption script `createmultisig` returns.

What am I doing wrong? Why is the redemption script incorrect?

My goal is to add the multi sig wallet to my node so that I can build transactions with the wallet without having to manually input the redemption script.

**Tags:** bitcoin-core, json-rpc, multi-signature, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2019-07-19. Score: 2 | Accepted answer

`createmultisig` is likely giving you the p2sh-segwit address, not the p2sh one. This means that the "redeemScript" you get from it is actually the `witnessScript` and the real `redeemScript` is the p2wsh script for your `witnessScript`. You can tell `createmultisig` to create just a p2sh address by setting the address type parameter to `legacy`.

Alternatively, you can get the `redeemScript` for your `witnessScript by using`decodescript`.`decodescript` will first decode your script, then it will give you the various possible addresses for it (for each address type available) along with the scripts for them.

> **Comments:**
> **username_2**: Or even better, use the descriptor based importmulti.  
> **username_0**: Thanks to you both. I will try the descriptor based approach.  

---

