missing information about redeem script and addresses using createmultisig

+1 vote

Dear multichain team,

I have the following question using multisignature in MC ver "2.0.1". I am going in detail about 1-to-m multisig address and differences between <createmultisig> and <addmultisigaddress> command. 
Here is my procedure to create multisig and have it in my wallet:

createmultisig 1 '["pubk_A","pubk_B"]'

{
    "address" : "multisig_address",
    "redeemScript" : "valid_redeem_script"
}

importaddress "multisig_address" '' false

Now I can read the <multisig_address> in my wallet with <listaddresses>. If I want to retrieve the redeem script with:

listaddresses "multisig_address" true

[
    {
        "address" : "33XzVbY2s6j7Ut2iXBtcXGoiri6wWbM7xU",
        "ismine" : false,
        "iswatchonly" : true,
        "isscript" : true,
        "script" : "nonstandard",
        "hex" : "",
        "addresses" : [
        ],

        "account" : "",
        "synchronized" : false,
        "startblock" : 1943
    }
]

I have no information about reedem script and originating addresses.
I can solve using <addmultisig> instead, which shows me the full information I need:

[
    {
        "address" : "3KR9JFJ5CjMRjQJsXoNXBuED68eyWX8zMr",
        "ismine" : false,
        "iswatchonly" : true,
        "isscript" : true,
        "script" : "multisig",
        "hex" : "512103bf5a878c40467b4b0e09a0742eafd7a74d17f494d3416e06b9835c9f9debf6cb210376cc0ada728631d0fab9df3a133e1894b164684de17aac1fee149e00387d822d52ae",
        "addresses" : [
            "19sa3g2ezwi7TTKeLSKZrdpCd4hAKkYdCa",
            "15eun78hTc3mZucCkAwptpp6e7Txs9FYtR"
        ],
        "sigsrequired" : 1,

        "account" : "",
        "synchronized" : false,
        "startblock" : 1943
    }
]

I was thinking that <addmultisig> is fully equivalent to <createmultisig> + <importaddress> but in the end it is not.

Could you comment and clarify if I missing something.

Thanks for your support,

  Fabio

asked Jan 5, 2020 by fabio

1 Answer

0 votes

Indeed, addmultisig is different from createmultisig + importaddress. When you use importaddress with a multisig address, there is no way for the node to recover the original addresses, because a multisig address is really just a hash of the the script containing the original addresses. So those addresses cannot be shown by your wallet.

answered Jan 6, 2020 by MultiChain
From createmultisig to addmultisig
...