How do atomic swaps work when blockchains operate at different rates?

3

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?

marisbest2

Posted 2018-01-03T20:37:07.760

Reputation: 131

Answers

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.

noobWithAComputer

Posted 2018-01-03T20:37:07.760

Reputation: 79