Ottepedia

Atomic Swap

The basics

An atomic swap lets someone exchange OTTE for coins on another chain without a middleman. Both payments either go through or are refunded. Neither party can take the other party’s coins and leave.

Ottereus uses HTLCs for this. Their lock uses SHA-256, which is also the hash used by Bitcoin, Litecoin and Dogecoin scripts. This means a single secret can unlock both sides of a trade with those chains.

How it works

  1. Alice chooses a secret and locks her coins on one chain. Bob needs the secret to claim them.
  2. On the other chain, Bob locks his coins using the same lock.
  3. Alice claims Bob’s coins, revealing the secret on that chain.
  4. Bob reads the secret, then claims Alice’s coins.

If either person stops before the trade is complete, each lock expires and the coins return to their owner.