Atomic transaction

+2 votes

Is there a way to create atomic transaction when using "createkeypairs" instead of "getnewaddress" and handle all key outside MultiChain?


asked Mar 16, 2017 by Roger

1 Answer

+1 vote

I'm afraid there isn't yet an easy way to do this.

The first participant would need to reproduce the atomic exchange APIs by using createrawtransaction to manually build a transaction with the first input and output, then use signrawtransaction with a fourth (undocumented) parameter value of SINGLE|ANYONECANPAY – consult the documentation for Bitcoin Core to see some examples of this.

If subsequent participants also need to use external keys, their job is a little more complicated. They would need to use an external bitcoin-compatible library to pick apart the partial transaction representing the offer of exchange, then add the extra input and output as appropriate. At that point it can be signed again using signrawtransaction in the same way as the first participant.

It goes without saying that we're aware this situation isn't ideal, and plan to improve on it in a future version.

answered Mar 17, 2017 by MultiChain