Atomic swaps have seen a bit of publicity since they were first discussed several years ago and have been furthered by Charlie Lee of Litecoin and the Komodo team behind BarterDEX. But for the most part they have flown under the radar as the cryptocurrency world grew through the explosion of ICOs in 2017 and the headlines centered on bitcoin’s rise in value.
So why does Scorum, a Graphene Framework-based blockchain, want to dabble in atomic swaps? For one thing, it has yet to be done. We all love a new challenge. As believers in blockchain technology and cryptocurrencies in general, we recognize that one of the major current flaws in the system is the reliance on centralized exchanges. It’s a weak point that exposes a large amount of funds to hacks and the occasional allegations of insider trading.
Also called atomic cross-chain transactions, they’re “atomic” because the transaction either happens fully or doesn’t happen at all. If either party in the swap stops the process while auditing the contracts, then both parties receive their original coins back.
Simple in concept, the implications of executing this quickly, at scale, while maintaining privacy will usher in a new era of cryptocurrency trading and, most importantly, utility. We see Komodo Platform’s Barterdex as a promising decentralized exchange that could bring atomic swaps into the mainstream in the next year.
Once accomplished, fine-tuned, and integrated into Scorum’s UI, atomic swaps will allow Scorum members to easily swap their SCR coins into other cryptocurrencies. Conversely, LTC holders can swap straight to SCR if they want to place a bet in Scorum’s commission-free betting exchange or buy-in to a zero-fee fantasy sports league. No third-party centralized exchanges to deal with, low transaction costs, and secure results.
In our example, we’ll outline an atomic swap between Alice and Bob. Both of them have addresses on both the Scorum blockchain and the Litecoin blockchain as this will be an on-chain atomic swap. Another key to the success of an atomic swap of this kind is that both blockchains use the same hashing algorithm for secrets that makes the swap possible (this is different from the block-signing hash algorithm).
So, let’s say Alice wants to swap her 15 LTC for 10 SCR and Bob is willing to trade 10 of his SCR for Alice’s 15 LTC. Both have an address on each blockchain. What follows is simplified (quite) a bit, see our full documentation here.
The above hashed time-lock contract has its benefits and drawbacks. On the plus side, there’s no third party to trust with either person’s coins. Downsides include the fact that the cryptocurrency can be tied up or frozen for up to 48 hours if participant refuses to participate after initiator’s contract is created.
It’s worth remembering that atomic swaps simply transfer the funds between two parties securely. Fast-forward in time a bit and we see a scenario where Alice wants to buy an item with her LTC but the merchant Bob only accepts SCR. Executed perfectly, Alice would send her funds to Bob through a decentralized exchange where Alice’s LTC would be swapped at an appropriate rate for SCR and then that SCR would end up with Bob and Alice would get her item.
What’s not to like about that? There will be instruments involved to aggregate exchange rates across all blockchains and store current orders, but the actual change of currencies will happen directly peer to peer.
Aside from reddit one-upmanship, nobody “wins” from needless competition between coins or blockchain protocols. With several thousand coins and tokens already in existence, there will be no one cryptocurrency to rule them all. And there doesn’t need to be.
The future of mass cryptocurrency adoption depends on many things, but high on the list is safely, securely, and quickly transferring funds between currencies without the need to trust third parties to execute the exchange. When end-users can take whichever currency they have and seamlessly pay for the goods and services they need in another, then we all win.