Atomic Cross Chain Swaps

I have been working on getting atomic cross chain swaps fully working for quite a while. The protocol details are described in:  https://bitcointalk.org/index.php?topic=1364951

With help and inspiration from Tier Nolan, today was the first automated atomic swap including redeems via the following transactions triggered by:

curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"request\",\"vals\":{\"source\":\"BTCD\",\"amount\":0.1,\"dest\":\"BTC\",\"minprice\":0.004}}"

alicefee: https://www.blockexperts.com/btcd/tx/867775f455c22930fa9bc0a48cd41d56fbdf043cd735f3d34a6f8dbdcfed200b

bobfee: https://blockchain.info/tx/b4d1d3eab856547209f950ca36ac5c0f3c6b8791036962200c784b9dcea660be

bobdeposit: https://blockchain.info/tx/f4aa6a34f07cb2bad90aca79f2fc8e51b55c23d78d53e3035f156de1a7faf2a3

alicepayment: https://www.blockexperts.com/btcd/tx/a7e27e540b19a1225796c89de75955279e06600c2cf04462c786d158fdc269c8

bobpayment(*): txid 87b6a1e9896c1da28c1e20f421cdac1ad5233f7925962bee107147ed621a12d2

alicespend of bobpayment(*): txid 69f690d5201e1d7dabf69ea6c1bc810df843bac3a5092738a60d0410d921c9e6

bobspend of alicepayment: https://www.blockexperts.com/btcd/tx/4575c92c93459738543918ecc1871f8c27348b2006354c699401304c08ec816b

bobrefund of bobdeposit: https://blockchain.info/tx/52a3bf49eca2b49346812458ee96b242e643ae2a59080fde4b52e06d110a97df

(*)The bobpayment and alicespend of it was from a different test run

Now there are still the timeout cases to get working, but the hardest part has been to get all the mainstream spends of the custom transactions working. Now it is ready for a GUI to be made for it so end users can submit conversion requests to the LP nodes from the browser.

On the Liquidity Provider side, there is more work to do but the framework is in place for any node to signup to be an LP node with a customizable profit margin for each coin.
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"amlp\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"liquidity\",\"targetcoin\":\"BTCD\",\"vals\":{\"profit\":0.005}}"

A cool thing is all during this “weekend’s” testing of the atomic swaps, I didnt have to reset the notary nodes at all. They ran all the time and properly handled all the comms.


Bitcointalk Topic Entry

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

20 − one =