multiple Multisig address with different addresses in the same wallet

+1 vote
I have created two wallets. The first one has one address (a1). The second one has two addresses (b1,b2), the second was created manually with getNewAddress command.

I create a multisig address that requires 1 signature from a1 and b1. I can perform transaction from both wallets.

Then I create a multisg address that requires 1 signature from a1 and b2. I can only sign transactions from the first wallet. The second wallet gives me an incomplete transaction.

I assume that the signrawtransaction uses by default the b1 address to sign the transaction. Is this correct? If yes what can I do to sign the transactions with any of the addresses that the wallet owns?
asked Feb 4, 2016 by ealkalai

2 Answers

+1 vote
Best answer
I think it's a simple problem of send permissions. You cannot sign the transaction with b2 because it has not been granted send permissions on the blockchain.
answered Feb 8, 2016 by MultiChain
selected Feb 9, 2016 by ealkalai
It worked!
However, I was expecting to be able to sign a transaction and then fail to transmit the transaction over the network, since I wouldn't have the send permission.
In MultiChain, when signing a multisig with signrawtransaction, it only attempts to use addresses which have send permission.
0 votes
It should definitely use any of the addresses in the wallet, as appropriate. Do you mind pasting the full transcript of what you're doing as a comment, so we can test this out for ourselves and understand what's happening?
answered Feb 4, 2016 by MultiChain
I will use wallet 1 and wallet 2

Wallet 1: has 2 address
a1: 1PBsbBwPcWWziJiwNJpwgFXg4qTcLbXeyeDq35
and a multisig based on a1 and b1

Wallet 2: has 3 addresses
b1: 1BB6hwSd9jhdy11iRBfM9yCVrun9uaS3uzP27G
b2: I am generating it with the following commands
and a multisig based on a1 and b1

On Wallet 2
multichain-cli testbc getnewaddress

multichain-cli testbc getaddresses true
        "address" : "1AjGoykMmJdpioGTYRASc6sJGYy57XDtGp63kE",
        "ismine" : true,
        "iswatchonly" : false,
        "isscript" : false,
        "pubkey" : "028a49628809c18eefe5ec72fe21faf090a9a47da6fcc816d914cb3bf0cb6efd9f",
        "iscompressed" : true,
        "account" : ""

On both Wallet 1 and Wallet 2:
multichain-cli testbc createmultisig 1 '["03eef62494c8aab2082565c52cdffa1916b214b759769600fad1c32455dc519c9e","028a49628809c18eefe5ec72fe21faf090a9a47da6fcc816d914cb3bf0cb6efd9f"]'

    "address" : "43jRfnSKUGHFqYLLMDZkffbLBCwkHbqwFVXR7C",
    "redeemScript" : "512103eef62494c8aab2082565c52cdffa1916b214b759769600fad1c32455dc519c9e21028a49628809c18eefe5ec72fe21faf090a9a47da6fcc816d914cb3bf0cb6efd9f52ae"

Where 03eef62494c8aab2082565c52cdffa1916b214b759769600fad1c32455dc519c9e is the Public key of wallet 1 a1

multichain-cli testbc importaddress 43jRfnSKUGHFqYLLMDZkffbLBCwkHbqwFVXR7C

multichain-cli testbc addmultisigaddress 1 '["03eef62494c8aab2082565c52cdffa1916b214b759769600fad1c32455dc519c9e","028a49628809c18eefe5ec72fe21faf090a9a47da6fcc816d914cb3bf0cb6efd9f"]'

I am creating, importing and adding since i have noticed that some times i get an incomplete address (missing addresses attributes) in the wallet (maybe another post for this)

For reference the address details from both wallets
        "address" : "43jRfnSKUGHFqYLLMDZkffbLBCwkHbqwFVXR7C",
        "ismine" : false,
        "iswatchonly" : true,
        "isscript" : true,
        "script" : "multisig",
        "hex" : "512103eef62494c8aab2082565c52cdffa1916b214b759769600fad1c32455dc519c9e21028a49628809c18eefe5ec72fe21faf090a9a47da6fcc816d914cb3bf0cb6efd9f52ae",
        "addresses" : [
        "sigsrequired" : 1,
        "account" : ""

On Wallet 1 (admin)
multichain-cli testbc grant 43jRfnSKUGHFqYLLMDZkffbLBCwkHbqwFVXR7C receive

Transfer funds from a first multisig address to the new one
multichain-cli testbc createrawtransaction '[{"txid":"f1a7911ec05d3ef2980a4fd93d4e2c4b40f603d9b185fb10aebc046be89c5ac4","vout":0, "scriptPubKey":"a914f4527a200418e8a87abc894e5bbdd961b602aba7871673706b716c00000009010000b596320000000000000075"}]' '{"43jRfnSKUGHFqYLLMDZkffbLBCwkHbqwFVXR7C":{"eur":50}}'

multichain-cli testbc signrawtransaction 0100000001c45a9ce86b04bcae10fb85b1d903f6404b2c4e3dd94f0a98f23e5dc01e91a7f10000000000ffffffff0100000000000000002fa9141b9f7f3e6dc3641cc9390e8a1cb1912161cbe563871673706b716c00000009010000b59632000000000000007500000000

multichain-cli testbc sendrawtransaction 0100000001c45a9ce86b04bcae10fb85b1d903f6404b2c4e3dd94f0a98f23e5dc01e91a7f100000000910047304402200e031c0971c10e2f0cc4f6808c8991c189f6b18965cf0f77c0cc49fa3023b15e0220114c959028a5f8f5ad8b381bc4f3de8493f92e21c6c058aed38607ec152ac0a20147512103eef62494c8aab2082565c52cdffa1916b214b759769600fad1c32455dc519c9e2103f80332cb9c75ab22e88ed5c10a67a4deacaf1ba5c140c0d3400b3648c7a2256552aeffffffff0100000000000000002fa9141b9f7f3e6dc3641cc9390e8a1cb1912161cbe563871673706b716c00000009010000b59632000000000000007500000000

On either wallet 1 or wallet 2
I check that the new multisig address has the new balance
multichain-cli testbc getaddressbalances 43jRfnSKUGHFqYLLMDZkffbLBCwkHbqwFVXR7C

On wallet 2
I check the unspent
multichain-cli testbc listunspent '[43jRfnSKUGHFqYLLMDZkffbLBCwkHbqwFVXR7C]'
        "txid" : "cbdda99164747c1723aa238933a35fcdcf48511bb68b066ab5b131772144c14b",
        "vout" : 0,
        "address" : "43jRfnSKUGHFqYLLMDZkffbLBCwkHbqwFVXR7C",
        "account" : "",
        "scriptPubKey" : "a9141b9f7f3e6dc3641cc9390e8a1cb1912161cbe563871673706b716c00000009010000b596320000000000000075",
        "amount" : 0.00000000,
        "confirmations" : 2,
        "cansend" : false,
        "spendable" : false,
        "assets" : [
                "name" : "eur",
                "assetref" : "108-265-38581",
                "qty" : 50.00000000
        "permissions" : [
Now I am using the above data to create a raw transaction towards another address 1R45...
multichain-cli testbc createrawtransaction '[{"txid":"cbdda99164747c1723aa238933a35fcdcf48511bb68b066ab5b131772144c14b","vout":0}]' '{"1R45KnqC3VuGGHCTC6UDSkhFPCexJoTvoxsQ38":{"eur":10}, "43jRfnSKUGHFqYLLMDZkffbLBCwkHbqwFVXR7C":{"eur":40}}'

And now signing the transaction fails:
multichain-cli testbc signrawtransaction 01000000014bc144217731b1b56a068bb61b5148cfcd5fa3338923aa23177c746491a9ddcb0000000000ffffffff0200000000000000003176a914b1f768134b120056690b09f2b3d1f71be86e715e88ac1673706b716c00000009010000b5960a000000000000007500000000000000002fa9141b9f7f3e6dc3641cc9390e8a1cb1912161cbe563871673706b716c00000009010000b59628000000000000007500000000
I have tried also to dump the private key of b2 so i can manually sign the transaction with this private key but it fails again
I updated a mistake on the last transaction (the second address) but it doesn't change the result
Thanks - I will ask the team to look at it, and get back to you.
See the separate answer above.