<p>Atomic swaps work with so-called hashed timelock contracts. These lock the value for a specific time except the other party can provide a secret which hashes to the given hash. In Bitcoin (and most clones) the timelock can be set either to be a specific block or a specific timestamp. After reaching this block or this time, the first party can claim back their funds.</p>

<p>When you know which chains you want to use for your atomic swap, you know how to set the locktimes to be sufficient for your purpose.</p>

<p>The locktimes can also be different on both chains.
And when you know, a chain reaches finality after a day, you can easily set the locktime to be in a week.</p>

CC BY-SA 4.0
2018-07-16T14:05:17.947Z
2018-10-19T02:01:08.380Z
2018-10-19T02:01:08.380Z
noobWithAComputer
<p>If two cryptocurrencies work on blockchains that have very different confirmation / finality rates, or blocks are mined / minted / created at very different rates, how do atomic swaps match up? What if the prices change during the swap?</p>

<atomic-swap>
How do atomic swaps work when blockchains operate at different rates?
marisbest2
# How do atomic swaps work when blockchains operate at different rates?

(Asked by: username_0 on 2018-01-03)

If two cryptocurrencies work on blockchains that have very different confirmation / finality rates, or blocks are mined / minted / created at very different rates, how do atomic swaps match up? What if the prices change during the swap?

**Tags:** atomic-swap


---

## 1 answers

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

Atomic swaps work with so-called hashed timelock contracts. These lock the value for a specific time except the other party can provide a secret which hashes to the given hash. In Bitcoin (and most clones) the timelock can be set either to be a specific block or a specific timestamp. After reaching this block or this time, the first party can claim back their funds.

When you know which chains you want to use for your atomic swap, you know how to set the locktimes to be sufficient for your purpose.

The locktimes can also be different on both chains.
And when you know, a chain reaches finality after a day, you can easily set the locktime to be in a week.


---

