atomic exchange with multisignatures

+2 votes

Hi,

In general: Is it possible to build an atomic exchange between multisignatures?

If yes: I would have to use preparelockunspentfrom with from-address=multisigXY, and then create the atomic exchange as usual, right?

The approval mechanism of multisigs is applied when executing preparelockunspentfrom and the approval has to be finished before the creation of the atomic exchange, right?


Thanks for your answers. :)

-zolar-

asked Jun 25, 2018 by zolar

1 Answer

0 votes

Yes, there's no problem with atomic exchanges between multisignature addresses.

However you probably won't be able to use preparelockunspentfrom because that requires all private keys to sign the transaction on behalf of the multisignature to be in this node's wallet.

In this case, instead of:

preparelockunspentfrom <address> '{"<asset>":<qty>}'

you would use:

createrawsendfrom <address> '{"<address>":{"<asset>":<qty>}}' '[]' lock,sign

Then pass that partially signed raw transaction to other nodes for signing as appropriate before transmitting it with sendrawtransaction once all signatures required are there.

answered Jun 25, 2018 by MultiChain
Thanks for your answer!
If I use 'sendrawtransaction' wouldn't this just be a regular transaction and not an atomic exchange?

I wanted to include a signed and ready-for-send transaction from a multisig-address in an atomic exchange.

I used 'createrawsendfrom' as you suggested. To use 'appendrawexchange' I need the 'txid' (which is easy) and 'vout' which is an array in this case.
How can I get the right 'vout' from the raw transaction?

edit:
I just realized that I most likely have to use 'createrawexchange' with the txid from the atomic exchange...?

(btw: how can I format text in comments? :/)
First, an exchange transaction is just a more complex version of a regular transaction (more inputs/outputs) so it absolutely can be sent with sendrawtransaction.

Second, if you're using createrawsendfrom as a proxy for preparelockunspentfrom in the way described, the vout you want for the exchange will be 0.

You use createrawexchange with the txid given by sendrawtransaction on the transaction created with createrawsendfrom and signed by other nodes.
...