2

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:[email protected]: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.

1 Answer 1

2

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 usingdecodescript.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.

2
  • 1
    Or even better, use the descriptor based importmulti. Jul 19, 2019 at 4:22
  • Thanks to you both. I will try the descriptor based approach.
    – Fontaine
    Jul 19, 2019 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.