<h3>First method</h3>
<blockquote>
<p>Is this method of exchange already possible with Bitcoin and popular alt-coins like Litecoin/Dogecoin?</p>
</blockquote>
<p>Yes.</p>
<p>Is it advisable, though? No. There are a lot of problems with this:</p>
<ul>
<li>How do buyers and sellers match their trades up?</li>
<li>How do traders know what the current price is?</li>
<li>If it's decentralized, most of the participants won't have DDoS protection. I can knock my competitors off of the Internet.</li>
<li>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.</li>
<li>I can go through with the protocol, then perform a <a href="https://bitcoin.stackexchange.com/questions/4942/what-is-a-finney-attack">Finney attack</a> and pull my coins back.</li>
<li>Both parties need to run clients for both chains.</li>
</ul>
<p>P.S. There's an updated version of that <a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Third_Party_Arbitration" rel="nofollow noreferrer">here</a>.</p>
<h3>Second method</h3>
<blockquote>
<p>Is this method of exchange already possible with Bitcoin and popular alt-coins like Litecoin/Dogecoin?</p>
</blockquote>
<p>I don't know of any altchain that implements this. I will note the following problems:</p>
<ul>
<li>the altchain client needs to run a copy of Bitcoin to verify transactions</li>
<li>if the transaction on Bitcoin's blockchain becomes invalid, every block that included that transaction will be invalid.</li>
</ul>
<blockquote>
<p>If atmoic cross chain trading is possible, are there any transactions in the blockchain where atomic cross chain trading has been used?</p>
</blockquote>
<p>Probably not.</p>

CC BY-SA 3.0
2014-11-02T09:20:51.963Z
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
CC BY-SA 3.0
2014-11-02T15:06:37.427Z
@MeniRosenfeld Well, you could wait for some number of confirmations on both chains after step 2.
Nick ODell
CC BY-SA 3.0
2014-11-06T06:43:10.630Z
'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
CC BY-SA 3.0
2014-11-06T06:50:27.373Z
@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
CC BY-SA 3.0
2016-07-05T13:14:57.623Z
@NickODell Other markets would have this problem, but they haven't all failed yet. What makes this special?
Christopher King
CC BY-SA 3.0
2014-11-02T01:24:43.370Z
2015-09-30T19:46:24.223Z
2020-06-16T11:10:03.350Z
Nick ODell
<p>To exchange between Bitcoin and popular alt-coins like Litecoin/Dogecoin you will need to use the first solution ('using revealing secrets of contract'). </p>

<p>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.</p>

<p>There is a problem with the refund transactions in the first solution, however, with the current Bitcoin version, due to <a href="http://www.righto.com/2014/02/bitcoin-transaction-malleability.html" rel="nofollow">transaction malleability</a>.</p>

<p>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.</p>

<p>I discuss this issue in some more detail in <a href="http://upcoder.com/11/atomic-cross-chain-exchange/" rel="nofollow">this blog post</a>, 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.</p>

<p>Note that it's possible to make this work in <em>an embedded protocol</em>, 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 <a href="https://github.com/crispweed/swapbill" rel="nofollow">SwapBill</a>, and this is set up and can be used, currently, for trustless exchange between testnet Bitcoin and testnet Litcoin.</p>

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

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

CC BY-SA 3.0
2014-11-21T10:13:10.353Z
2014-11-21T10:13:10.353Z
Thomas Young
<p>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: </p>

<p><a href="https://en.bitcoin.it/wiki/Atomic_cross-chain_trading">https://en.bitcoin.it/wiki/Atomic_cross-chain_trading</a></p>

<p>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?  </p>

CC BY-SA 3.0
2014-11-02T00:04:10.887Z
Are you asking about the first one or the second?
Nick ODell
CC BY-SA 3.0
2014-11-02T00:49:09.950Z
Both, I have further clarified the question in response.
k kurokawa
<protocol><altcoin><contracts>
Atomic cross-chain trading
k kurokawa
# Atomic cross-chain trading

(Asked by: username_0 on 2014-11-01)

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?

**Tags:** protocol, altcoin, contracts

> **Comments:**
> **username_1**: Are you asking about the first one or the second?  
> **username_0**: Both, I have further clarified the question in response.  

---

## 2 answers

### Answer by username_1 on 2014-11-02. Score: 1 | Accepted answer

### 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](https://bitcoin.stackexchange.com/questions/4942/what-is-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](https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Third_Party_Arbitration).

### 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.

> **Comments:**
> **username_2**: 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.  
> **username_1**: @username_2 Well, you could wait for some number of confirmations on both chains after step 2.  
> **username_3**: '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.  
> **username_1**: @username_3 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.  
> **username_4**: @username_1 Other markets would have this problem, but they haven't all failed yet. What makes this special?  

---

### Answer by username_5 on 2014-11-21. Score: 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](http://www.righto.com/2014/02/bitcoin-transaction-malleability.html).

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](http://upcoder.com/11/atomic-cross-chain-exchange/), 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](https://github.com/crispweed/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. ;)


---

