Atomic Swap
Exchange BTC ad LTC
~~~
Alice Bob
BTC LTC
\ /
*
/ \
LTC BTC
Alice Bob
~~~
~~~
Alice pays first
Alice has a secret piece of information X
~~~
Alice make a tx that
~~~
\y -> if hash(y) == hash(X) and Bob's signature then send BTC to Bob or after a time refund to Alice
~~~
Bob make a tx that
~~~
\y -> if hash(y) == hash(X) and Alice's signature then send LTC to Alice or refund to Bob
OP_IF
2 2 OP_CHECKMULTISIGVERIFY
OP_ELSE
OP_HASH160 OP_EQUAL OP_CHECKSIGVERIFY
OP_ENDIF
~~~
~~~
Alice get LTC means Alice broadcast X to miners
~~~