<p>A bit late, but maybe someone wants to know nevertheless.</p>

<p>In order for an atomic swap to take place, both(/all) parties have to be able to watch the blockchain and all transactions which happen there. That is because when the first party claims his part of the trade, the second one has to be able to get the secret from the transaction of the first party.</p>

<p>When you now look at a monero explorer, you don't see anything. So the second party cannot get the secret and therefore cannot claim his part of the trade.</p>

<p>That's why atomic swaps (in their current form) cannot take place on monero.</p>

CC BY-SA 4.0
2018-07-16T14:28:23.920Z
2018-07-16T14:28:23.920Z
noobWithAComputer
<p>To do an atomic swap, you essentially need two things:</p>

<ol>
<li>The ability to do 2-of-2 multisignatures. Basically every cryptocurrency supports this, including Bitcoin and Monero, though with varying degrees of ease-of-use. In Bitcoin you can use CHECKMULTISIG opcode; in Monero (and eventually Bitcoin, I hope) you can do 2-party Schnorr signatures which are more private and compact but require interaction. In Ethereum you can do 2-party ECDSA signatures which are complex and annoying but perfectly doable (or maybe you can use a multisig contract, but these are non-atomic and have super weird semantics, so caveat emptor).</li>
<li>The ability to have timeout refund transactions, so that if one party disappears halfway through the protocol, the other party will get their funds back. This is done using Bitcoin locktimed transactions or OP_CSV.</li>
</ol>

<p>Unfortunately Monero currently does not have a way to do refunds. I believe it has locktimed transactions, but these aren't usable since Monero does not let you spend unconfirmed coins, meaning you'd have to put your coins up <em>before</em> making a refund transaction, leaving a window for your coins to get stuck. I don't expect Monero to ever support spending unconfirmed transactions, unfortunately, because these interact poorly with their ring signatures.</p>

<p>On the other hand, something like OP_CSV, where coins' spending conditions change after a timeout without the need for explicit locktime transactions, naively seems impossible in Monero since their ring signatures require outputs be labelled with public keys rather than scripts. Further, every output can have at most <em>one</em> public key since it must have at most <em>one</em> key image to prevent double-spending.</p>

<p><strong>Fortunately</strong>, there is a third solution, proposed by Pedro Moreno-Sanchez, and AFAIK, not written up anywhere. (I'd welcome comments linking me to a writeup, I heard of this through the grapevine so maybe I'm just out of the loop.) The way this works is that outputs may be labelled with <em>two</em> public keys, each with the same key image. How can two keys have the same image? Essentially, key images are computed by hashing public keys into other public keys and then multiplying the result by the original secret key. <strong>If each key's "hash" is defined to be the other key, the result of this process will be the same thing no matter which key is used</strong> (specifically, the Diffie-Hellman secret associated with the two keys). This means that one key can belong to the original party and have a locktime on it, while the other key is a 2-of-2 multisig key used for the swap in the cooperative case. When spending, it is impossible to tell which key is actually being used.</p>

<p>(OK, if the locktime has expired it's almost certainly the locktime key being used, and otherwise it must be the non-locktime key. Pedro had a solution to that using rangeproofs on the locktimes but my feeling is that the complexity-to-privacy ratio is too high, and in any case it distracts from the essential point.)</p>

<p>This is not supported in Monero today but expect to see it in a hardfork down the road, because the ability to do atomic swaps, and eventually payment channels, is something its developers and community are very interested in. </p>

CC BY-SA 4.0
2020-02-07T11:59:06.130Z
DLSAG paper came out in 29 May 2019: https://eprint.iacr.org/2019/595. There is also a video from MoneroKon 2019 explaining it: https://www.youtube.com/watch?v=x4q38ndnQnw
Fernando N.
CC BY-SA 4.0
2018-07-17T17:45:29.233Z
2018-07-17T17:45:29.233Z
Andrew Poelstra
<p>Litecoin and Vertcoin is currently testing out atomic swaps with Bitcoin as of 2017-08. Would atomic swaps be possible with Monero?</p>

<litecoin><sidechains><monero><vertcoin><atomic-swap>
Would it be possible to do atomic swaps with Monero and Bitcoin?
Patoshi パトシ
# Would it be possible to do atomic swaps with Monero and Bitcoin?

(Asked by: username_0 on 2017-08-24)

Litecoin and Vertcoin is currently testing out atomic swaps with Bitcoin as of 2017-08. Would atomic swaps be possible with Monero?

**Tags:** litecoin, sidechains, monero, vertcoin, atomic-swap


---

## 2 answers

### Answer by username_2 on 2018-07-17. Score: 5 | Accepted answer

To do an atomic swap, you essentially need two things:

1. The ability to do 2-of-2 multisignatures. Basically every cryptocurrency supports this, including Bitcoin and Monero, though with varying degrees of ease-of-use. In Bitcoin you can use CHECKMULTISIG opcode; in Monero (and eventually Bitcoin, I hope) you can do 2-party Schnorr signatures which are more private and compact but require interaction. In Ethereum you can do 2-party ECDSA signatures which are complex and annoying but perfectly doable (or maybe you can use a multisig contract, but these are non-atomic and have super weird semantics, so caveat emptor).
2. The ability to have timeout refund transactions, so that if one party disappears halfway through the protocol, the other party will get their funds back. This is done using Bitcoin locktimed transactions or OP\_CSV.

Unfortunately Monero currently does not have a way to do refunds. I believe it has locktimed transactions, but these aren't usable since Monero does not let you spend unconfirmed coins, meaning you'd have to put your coins up *before* making a refund transaction, leaving a window for your coins to get stuck. I don't expect Monero to ever support spending unconfirmed transactions, unfortunately, because these interact poorly with their ring signatures.

On the other hand, something like OP\_CSV, where coins' spending conditions change after a timeout without the need for explicit locktime transactions, naively seems impossible in Monero since their ring signatures require outputs be labelled with public keys rather than scripts. Further, every output can have at most *one* public key since it must have at most *one* key image to prevent double-spending.

**Fortunately**, there is a third solution, proposed by Pedro Moreno-Sanchez, and AFAIK, not written up anywhere. (I'd welcome comments linking me to a writeup, I heard of this through the grapevine so maybe I'm just out of the loop.) The way this works is that outputs may be labelled with *two* public keys, each with the same key image. How can two keys have the same image? Essentially, key images are computed by hashing public keys into other public keys and then multiplying the result by the original secret key. **If each key's "hash" is defined to be the other key, the result of this process will be the same thing no matter which key is used** (specifically, the Diffie-Hellman secret associated with the two keys). This means that one key can belong to the original party and have a locktime on it, while the other key is a 2-of-2 multisig key used for the swap in the cooperative case. When spending, it is impossible to tell which key is actually being used.

(OK, if the locktime has expired it's almost certainly the locktime key being used, and otherwise it must be the non-locktime key. Pedro had a solution to that using rangeproofs on the locktimes but my feeling is that the complexity-to-privacy ratio is too high, and in any case it distracts from the essential point.)

This is not supported in Monero today but expect to see it in a hardfork down the road, because the ability to do atomic swaps, and eventually payment channels, is something its developers and community are very interested in.

> **Comments:**
> **username_3**: DLSAG paper came out in 29 May 2019: https://eprint.iacr.org/2019/595. There is also a video from MoneroKon 2019 explaining it: https://www.youtube.com/watch?v=x4q38ndnQnw  

---

### Answer by username_1 on 2018-07-16. Score: 0

A bit late, but maybe someone wants to know nevertheless.

In order for an atomic swap to take place, both(/all) parties have to be able to watch the blockchain and all transactions which happen there. That is because when the first party claims his part of the trade, the second one has to be able to get the secret from the transaction of the first party.

When you now look at a monero explorer, you don't see anything. So the second party cannot get the secret and therefore cannot claim his part of the trade.

That's why atomic swaps (in their current form) cannot take place on monero.


---

