Multisigned transaction with external keys

+1 vote
Greetings,

I've tried to process a multi signed transaction linked to 2 external addresses.

I've followed the two tutorials - external keys management and Multisignatures

Unfortunately after the second signature the transaction is still in the state : complete = false

The process :

- Create external keys (on each node)

- Import address (on each node)

- Create a multi sign address (using the pub keys of each addresses) on both nodes

- Issue asset for the multi sign address

- create a raw transaction (createrawsendfrom) to send asset amount to another address

- sign hexblob on first node with first external privkey

- sign output of previous op on second node with second external privacy

--> at this point the statut should be completed = yes but is not

I've tried  createrawsendfrom with and without sign parameter

Can't figure out what I did wrong. Any clue ?

Thank you
asked Jan 11 by samset

1 Answer

0 votes
The most common problem in these cases is that the second signing operation is not performed on the hex blob that is given as the output for the first signing operation. It sounds like you are not making that mistake but it is worth checking again.

Apart from that it sounds like you are doing everything right. So we would need to see a more fully worked example with API requests and responses in order to pinpoint the problem.
answered Jan 13 by MultiChain
May I suggest to inspect the signing procedure at the following stage:

- sign hexblob on first node with first external privkey

In my first I made the mistake to sign from a multisign address without specifying the redeem script and scriptpubkey.
There is specific answer about it:
https://www.multichain.com/qa/13163/able-complete-signing-transaction-multisignature-address?show=13163#q13163
Thank for replying.
Please find below the signing operations.
It seems that the output hexblob are identical which is very strange. I have also noticed that adding a multisignaddress always returns the same address value.

    mcc addmultisigaddress 2 '["03cc6d56ab3a875a8e6b4747f8b7f355f21dcbc40f4b86c44c12ce51580410e9b2", "036a45ce92b65c27b5c849e78355491c26e8af9b52220ca9f8b3b6da0946c55b13"]'

On each node returns the same output.
   
47ayv8B9uAFUfbxuuZ2V1u7fjG34X8nAzcktcU

mcc createrawsendfrom 47ayv8B9uAFUfbxuuZ2V1u7fjG34X8nAzcktcU '{"1Y4c8CSNsbPAnfJgoLZzf8XaECwpcP9T9cZRPe":{"asset9":1000}}' '[]'

0100000001c69bc2102f8e2cb80da2b263fa535547b965db8e9ce57934815abe59185dacd80000000000ffffffff0200000000000000003776a914e5d39fae78e7977c17f75f88ce48df3f839e5d9188ac1c73706b71b965db8e9ce57934815abe59185dacd8a08601000000000075000000000000000035a91438243cf66da1aff29564eb5a8e6982b7ca6b4920871c73706b71b965db8e9ce57934815abe59185dacd8a0bb0d00000000007500000000

Node 1

mcc signrawtransaction "0100000001c69bc2102f8e2cb80da2b263fa535547b965db8e9ce57934815abe59185dacd80000000000ffffffff0200000000000000003776a914e5d39fae78e7977c17f75f88ce48df3f839e5d9188ac1c73706b71b965db8e9ce57934815abe59185dacd8a08601000000000075000000000000000035a91438243cf66da1aff29564eb5a8e6982b7ca6b4920871c73706b71b965db8e9ce57934815abe59185dacd8a0bb0d00000000007500000000" '[]' '["VFqvZuxQn3VJxJY8HrA3fYF6cPe6voQzWhrmnHkxxS1nJaPFpjiu7K8g"]'

Output
{
    "hex" : "0100000001c69bc2102f8e2cb80da2b263fa535547b965db8e9ce57934815abe59185dacd80000000000ffffffff0200000000000000003776a914e5d39fae78e7977c17f75f88ce48df3f839e5d9188ac1c73706b71b965db8e9ce57934815abe59185dacd8a08601000000000075000000000000000035a91438243cf66da1aff29564eb5a8e6982b7ca6b4920871c73706b71b965db8e9ce57934815abe59185dacd8a0bb0d00000000007500000000",
    "complete" : false
}


Node 2

mcc signrawtransaction "0100000001c69bc2102f8e2cb80da2b263fa535547b965db8e9ce57934815abe59185dacd80000000000ffffffff0200000000000000003776a914e5d39fae78e7977c17f75f88ce48df3f839e5d9188ac1c73706b71b965db8e9ce57934815abe59185dacd8a08601000000000075000000000000000035a91438243cf66da1aff29564eb5a8e6982b7ca6b4920871c73706b71b965db8e9ce57934815abe59185dacd8a0bb0d00000000007500000000" '[]' '["VEC3cf5JJPUWe2JkZQDqvsbpEES9yLL8cTLpPFNCeGz9bJW3XdDaVWLG"]'

Output
{
    "hex" : "0100000001c69bc2102f8e2cb80da2b263fa535547b965db8e9ce57934815abe59185dacd80000000000ffffffff0200000000000000003776a914e5d39fae78e7977c17f75f88ce48df3f839e5d9188ac1c73706b71b965db8e9ce57934815abe59185dacd8a08601000000000075000000000000000035a91438243cf66da1aff29564eb5a8e6982b7ca6b4920871c73706b71b965db8e9ce57934815abe59185dacd8a0bb0d00000000007500000000",
    "complete" : false
}
Thanks for that. The problem is that when you are using multisignatures AND external private keys, you need to provide additional information to signrawtransaction. See this answer: https://www.multichain.com/qa/9808/signrawtransaction-is-not-signining?show=9821#a9821
Greetings,
Thank you for your reply.
I can't figure our which of the attributes txid, vout and scriptPubKey to choose from the decoded transaction. Would you mind point out the right ones, please ?
Some combinaisons generate error code: -3
error message:
Missing redeemScript.
What does this error mean ?


{
    "txid" : "ffb053a1df1529fe895b450ba07c53f7fc198db63e3b0501d57a2cc50b928ffd",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "defde3cb525ef08de84fd16248e63485b476166c6df29d5cd80f79f564a168ec",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "",
                "hex" : ""
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 0f48086b14f3b3e8c864e4b1467114d1f66004bf OP_EQUALVERIFY OP_CHECKSIG 73706b718534e64862d14fe88df05e52cbe3fddea086010000000000 OP_DROP",
                "hex" : "76a9140f48086b14f3b3e8c864e4b1467114d1f66004bf88ac1c73706b718534e64862d14fe88df05e52cbe3fddea08601000000000075",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "134nqkuCJTQwo4ivvGHNETQvsmvzuWDwDWCfwa"
                ]
            },
            "assets" : [
                {
                    "name" : "asset7",
                    "issuetxid" : "defde3cb525ef08de84fd16248e63485b476166c6df29d5cd80f79f564a168ec",
                    "assetref" : "64-266-64990",
                    "qty" : 1000,
                    "raw" : 100000,
                    "type" : "transfer"
                }
            ]
        },
        {
            "value" : 0,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_HASH160 d3ca746e8f9f6165bab88d66f7babe26d509e9ef OP_EQUAL 73706b718534e64862d14fe88df05e52cbe3fddea0bb0d0000000000 OP_DROP",
                "hex" : "a914d3ca746e8f9f6165bab88d66f7babe26d509e9ef871c73706b718534e64862d14fe88df05e52cbe3fddea0bb0d000000000075",
                "reqSigs" : 1,
                "type" : "scripthash",
                "addresses" : [
                    "4Ud7WhmXGP7ovDijk62BPp94pmgbYTWtzgVbZb"
                ]
            },
            "assets" : [
                {
                    "name" : "asset7",
                    "issuetxid" : "defde3cb525ef08de84fd16248e63485b476166c6df29d5cd80f79f564a168ec",
                    "assetref" : "64-266-64990",
                    "qty" : 9000,
                    "raw" : 900000,
                    "type" : "transfer"
                }
            ]
        }
    ]
}
...