Atomic Swaps is the concept for trading between two different cryptocurrencies without a trusted third party. Developed in 2013, it was mostly theory until this fall. That’s when Charlie Lee enabled Atomic Swaps to be made between LTC-BTC, LTC-VTC, and LTC-DEC. The move required his technical know-how as well as some complicated code to get it to work. The end result proved that Atomic Swaps could be a feasible alternative to a traditional exchange. The technology continues to be developed and shows tremendous promise.
Keeping Transactions Trustless
The blockchain protects transactions between single cryptocurrencies from being altered. This is called a trustless transaction because no trust is needed. However, if Steve wants to trade 1 BTC for Kevin’s 25,654 XBY, he is still placing his trust in an exchange. And as can be seen on many crypto forums, traders appear to have very little trust in the majority of them. Obviously, this leaves the trader feeling somewhat vulnerable. With Atomic Swaps, a smart hash time locked contract allows the exchange of coins without the need for a trusted third party.
Atomic swaps employ Hash time locked contracts to secure each transaction. As an example, a trader named Steve setups a digital lockbox on the BTC blockchain. In the process, a code is generated that proves the coins were put into the box. That code plus Kevin’s address will give Kevin access to the BTC. And the code generated by Kevin plus Steve’s address enables Steve to access the XBY. If either party tries to pass along the wrong code (or if someone else tries to open up the lockbox) the contract won’t allow the coins to transfer. If no one opens the lockbox after a certain amount of time (or if anything at all goes wrong) the coins are transferred back into the owner’s wallet. This system allows for a completely trustless flow between two different coins. The bitcoin code will help you learn more about trading options.
Atomic Swap Limitations
As currently implemented, Atomic Swaps are still subject to certain limitations. In particular, coins must use the same hash algorithm. That makes the above example not possible at this time since BTC use SHA- 256 and XBY uses SHA-512. In the near future, developers expect to find a way to create contracts that bridge this gap. There also has to be a network that can communicate with both blockchains (the Lightning Network is the one most people have heard of). As Atomic Swaps gain wider adoption networks supporting more coins will be created. Indeed, its likely a new form of DEX will soon operate with Atomic Swaps at its core.
Hybrid Decentralized Exchanges As An Option
At present, decentralized exchanges (DEXs) depend upon an escrow system. In addition, most of them keep a centralized server to back up trading data. As such, these solutions do not qualify as trustless. Creating a DEX that is truly trustless will require implementing Atomic Swaps at its core. While similar in appearance to a traditional exchange, a user’s coins will remain within his/her wallet until a transaction is activated (thus, no need to transfer your currency to an exchange wallet or have a third party temporarily hold your coin in escrow).
Cryptocurrency traders will likely see hybrid DEXs at first, exchanges that allow for both Atomic Swaps and traditional escrow services. As additional coins become eligible for Atomic Swaps, traders will gradually begin to prefer this trustless method of exchange.
The X-CHANGE module set to launch on the XTRABYTES network will initially operate as an escrow based DEX. As the technology becomes more refined, users can expect to see Atomic Swap based pairs incorporated within the GUI. Indeed, the market will demand this as competition heats up and traditional exchanges expand into this area. Given XTRABYTES’ inherent flexibility, users should expect to see this transition occur quickly and smoothly.