How to sign from a multisig when making an exchange using raw transactions?

+2 votes

With relation to https://www.multichain.com/developers/atomic-exchange-transactions/

If a multisig address prepares the transaction, how does the following step change:

 signrawtransaction [paste-hex-blob] '[]' '["V..."]' SINGLE|ANYONECANPAY

If I try to add the SINGLE|ANYONECANPAY parameter to any of the multisig signing stages, the hex output is the same as the input (decoding shows that no signature was added)

If it matters, I am not passing the private keys in the 3rd parameter; the multisig signatories have their private keys stored in the nodes:

signrawtransaction <hex-blob> '[]' '[]' SINGLE|ANYONECANPAY

If I remove the SINGLE|ANYONECANPAY parameter, the raw transaction can be signed and completed (IDK what happens if I send it)

asked Aug 29, 2018 by sphearman
I will ask the team about this and get back to you.

1 Answer

+1 vote

The problem is that if you pass an array for the third parameter to signrawtransaction, only private keys from that array are used. In this case you passed an empty array, so no private keys could be used.

In your case what you really want to do is omit this parameter, and sign using the wallet's private keys automatically. To do this, pass null instead of an empty array. We've also updated the on-site documentation to make this clear, so thanks for bringing it to our attention.

answered Sep 3, 2018 by MultiChain
...