It is well-known that Bitcoin’s upcoming lightning network promises instant confirmations and low fees. What is not as well-known is that this highly anticipated scaling layer is actually not limited to Bitcoin. The very same peer-to-peer protocol can potentially be extended to, and made interoperable with, many altcoins. This could allow for trustless altcoin payment processors, decentralized altcoin exchanges and perhaps even cheaper bitcoin-to-bitcoin payments and more.
Let’s say Alice has 200 litecoins, but prefers 1 bitcoin. And Bob has 1 bitcoin, but prefers 200 litecoins. So Alice and Bob agree to trade. But neither Alice nor Bob trust each other, so neither wants to be the first to send over the coins. The other may not return the favor.
That’s why Alice and Bob set up an atomic swap.
Atomic swaps utilize a clever trick known as a hash time-locked contract, which in turn leverages the potential of multisignature addresses and time-locks. All this is enabled by the basic scripting language found in