9

Atomic cross-chain trading describes a method where two parties, owning different crypto currencies, can safely exchange the crypto currencies without an intermediary. The method is described in the link below:

https://en.bitcoin.it/wiki/Atomic_cross-chain_trading

Are these method of exchange already possible with Bitcoin and popular alt-coins like Litecoin/Dogecoin? Or is it still a work in progress that requires changes to the core code? If atmoic cross chain trading is possible, are there any transactions in the blockchain where atomic cross chain trading has been used?

  • Are you asking about the first one or the second? – Nick ODell Nov 2 '14 at 0:04
  • Both, I have further clarified the question in response. – kaykurokawa Nov 2 '14 at 0:49
1

First method

Is this method of exchange already possible with Bitcoin and popular alt-coins like Litecoin/Dogecoin?

Yes.

Is it advisable, though? No. There are a lot of problems with this:

  • How do buyers and sellers match their trades up?
  • How do traders know what the current price is?
  • If it's decentralized, most of the participants won't have DDoS protection. I can knock my competitors off of the Internet.
  • If I want to jam things up, I can offer to trade, but abandon the trade after step 1. The other party's coins will be stuck for 2 days.
  • I can go through with the protocol, then perform a Finney attack and pull my coins back.
  • Both parties need to run clients for both chains.

P.S. There's an updated version of that here.

Second method

Is this method of exchange already possible with Bitcoin and popular alt-coins like Litecoin/Dogecoin?

I don't know of any altchain that implements this. I will note the following problems:

  • the altchain client needs to run a copy of Bitcoin to verify transactions
  • if the transaction on Bitcoin's blockchain becomes invalid, every block that included that transaction will be invalid.

If atmoic cross chain trading is possible, are there any transactions in the blockchain where atomic cross chain trading has been used?

Probably not.

  • 1
    Re your point about Finney attack: The whole point of atomic trading is that you can't double-spend and get the coins of both parties. At best you can reverse the whole trade if the price moves against you. I don't remember all the details ATM but if this attack works then the whole method is broken. – Meni Rosenfeld Nov 2 '14 at 9:20
  • 1
    @MeniRosenfeld Well, you could wait for some number of confirmations on both chains after step 2. – Nick ODell Nov 2 '14 at 15:06
  • 2
    'How do traders know what the current price is?' Doesn't really sound like much of a problem? It's whatever buyer and seller agree upon. Like in any other market. Not really a problem inherent to cross chain transactions. – Jannes Nov 6 '14 at 6:43
  • 1
    @Jannes Sure, for an individual transaction. But if you're trying to distort the market, there are a lot of things you can do. For example, you can advertise a price, but back out whenever someone tries to trade with you. – Nick ODell Nov 6 '14 at 6:50
  • @NickODell Other markets would have this problem, but they haven't all failed yet. What makes this special? – PyRulez Jul 5 '16 at 13:14
2

To exchange between Bitcoin and popular alt-coins like Litecoin/Dogecoin you will need to use the first solution ('using revealing secrets of contract').

The second solution is designed around a hypothetical custom altcoin which is designed specifically to support the described exchange algorithm. I don't think that such an altcoin actually exists, but there definitely isn't support for this in Litecoin or Dogecoin.

There is a problem with the refund transactions in the first solution, however, with the current Bitcoin version, due to transaction malleability.

The problem is that refund transactions need to be signed before submitting base transactions to the blockchain, but the base transactions can potentially be mutated before they get to the blockchain, which would invalidate the refund transactions and prevent coin being reclaimed in the event of aborted exchange.

I discuss this issue in some more detail in this blog post, where I also look at a generalised form of the 'pay on reveal secret' transaction semantics in this exchange algorithm, and discuss other ways in which this can be implemented.

Note that it's possible to make this work in an embedded protocol, and then perform trustless exchange between blockchains with the embedded value tokens as intermediary steps. I've made a working version of this setup in the form of SwapBill, and this is set up and can be used, currently, for trustless exchange between testnet Bitcoin and testnet Litcoin.

If atmoic cross chain trading is possible, are there any transactions in the blockchain where atomic cross chain trading has been used?

There are definitely SwapBill atomic exchange transactions on the Bitcoin and Litecoin testnet blockchains, but this is not really what you are asking. ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.