While only a few days away from the Scorum crowdsale, the team at Scorum HQ is pushing the progress of cryptocurrency innovation.
Atomic swaps have seen a bit of publicity since they were first discussed several years ago and have been furthered by @SatoshiLite 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.
Atomic Swaps Primer:
Also called atomic cross-chain swapping, 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’s Barterdex as a promising decentralized exchange that could bring atomic swaps into the mainstream in the next year.
What do Scorum’s users stand to gain?
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.
How does it work?
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.
- Alice initiates the swap from her Litecoin wallet by creating a secret, a secret hash, and a contract that says she will transfer her 15 LTC from her Litecoin address to Bob’s.
- Alice sends contract via the secret hash to Bob through any messaging service.
- Bob audits the contract to make sure that everything matches the correct rates.
- Meanwhile, Bob creates a participation contract from his Scorum wallet that says he will send 10 SCR from his Scorum address to Alice’s.
- Bob sends his contract to Alice to let her audit it.
- Once both sides have audited the contracts that are associated with the secret hash, Alice will have 24 hours to redeem Bob’s contract and receive her 10 SCR.
- Once this is done, the secret will be revealed to Bob and he will have to redeem his 15 LTC within the 48 hour time window.
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.
Potential for Atomic Swaps
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.