W3C home > Mailing lists > Public > public-interledger@w3.org > April 2016

Re: Atomic cross-chain trading

From: Melvin Carvalho <melvincarvalho@gmail.com>
Date: Tue, 19 Apr 2016 10:30:46 +0200
Message-ID: <CAKaEYhL5iaDBuSa39jWb4kmO-43UOO29RoxgRZrvQzmNYwCksQ@mail.gmail.com>
To: Eric Wall <eric.wall.770@gmail.com>
Cc: Interledger Community Group <public-interledger@w3.org>
On 19 April 2016 at 04:40, Eric Wall <eric.wall.770@gmail.com> wrote:

> Hello!
> I was wondering why the example in
> https://en.bitcoin.it/wiki/Contract#Example_5:_Trading_across_chains
> would not be a better solution than an escrow service as proposed by
> Interledger for cross-chain transfers. Any feedback appreciated.

I've been interested in this for some time.

Here's my rough notes back from 2013 in a conversation with Adam Back:

Most electronic coins inherit the lock_time from bitcoin.  The way it's
implemented is that no peer will accept the tx until the time is greater
than lock time.

Alice wishes to buy 100 lite coins from Bob for 1 bitcoin.

There's no way to do this without a trusted third party.

But let's think of an improvement to the "you go first" type scam.

Alice's client sends a tx to Bob's locked for 1 hour.  It proves she has 1
bitcoin.  Bob immediately replies with a locked tx for 100 litecoins.

Both clients monitor the network for a double spend, which automatically
triggers a cancel (spend to self) for a small fee.

If an hour passes and there's no double spend detected the tx are
released.  It would be very hard to do a double spend in the time you have
left.  Additionally layer on an ebay style web of trust and good and bad
actors can build up a track record, should they wish to identify themselves.

An optimization could be that the clients once the handshake has taken
place, reduce the time to 30 minutes, then 15 minutes, then a few seconds

It may be possible to have effective decentralized exchanges with
reasonably good settlement this way ...

Adam Back's reply:

"Yes I believe this is how the proposed cross-chain atomic swap protocols
work.  They have to be secure against abort (cancel or disconnect because
the exchange rate moved in your disfavor) or extort (lock up the other guys
funds in a 2 of 2 multisig as part of the protocol but then demand a cut to
unlock the funds rather than completing the protocol).

Its in bitcoin talk somewhere if you search for cross-chain atomic swap or
something like that.  I never really analysed it in detail to double check
the claims or see if one could do better, but it seemed plausible.  It may
have been by TierNolan from memory."


Would love to explore this concept in more detail, and it's relationship to
inter ledger trading / ILP etc. ...

> Regards,
> Eric Wall
> https://www.linkedin.com/in/ercwl
Received on Tuesday, 19 April 2016 08:31:16 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 19 April 2016 08:31:17 UTC