Over the last three years, in particular, people have been thinking about how to solve the two weaknesses of the blockchain: scalability and interoperability between protocols. Considering the increasingly rapid and massive growth of users within the ecosystem, it was difficult to offer the right capacity to sustain the demand for the offered assets and products in a sustainable fashion.
Before the development of atomic swaps, the degree of interoperability between projects based on different protocols was very low. Those who wanted to trade cryptocurrencies belonging to different blockchains had to turn to an intermediary, usually a centralized exchange, thus removing any degree of decentralization.
CEXs (Centralized Exchanges), in order to perform the trading activity, transferred some of the typical risks of their management directly to the end-users, who in some particular cases had to fight against liquidity risks and being vulnerable to hacker attacks. These problems reflect the characteristics of these activities from a technical and operational point of view which, in addition to being the responsibility of the platform in question that manages the upstream transactions, in some cases fall back on the user, as mentioned above.
Through the use of this new technology, all these obstacles have no reason to exist. More specifically, the atomic swap is a technology based on smart contracts that enables the exchange between different cryptocurrencies existing on separate blockchains. The exchange takes place through a peer-to-peer network without the need for an intermediary to rely on.
Basically, the process that was previously triggered on-chain, now, thanks to atomic swaps, usually occurs off-chain through the creation of a payment channel that is called state channel, purposely opened by the two counterparties who want to exchange assets. Once opened, the state channel uses a special form of payment during the interaction process between the two parties that is called HTLC, which stands for Hash Time Locked Contract.
This allows enabling the transfer of funds, initially deposited by the two users at the time the channel is opened, only when the expiration date decided in advance is reached or once certain conditions in the contract are met. If the transfer does not take place, the balances return to their respective owners and the channel closes. All this makes exchanges much faster, cheaper and safer, as it is the users who have full control over their funds without an intermediary managing them instead.
Several projects have been born that support the progress of this technology that still has ample room for expansion ahead of it, including Lightning Network and AtomicDEX. The latter was developed by Komodo, a platform that facilitates and allows users to create an infinite number of smart chains that can be fully customized according to the business solution they want to implement in their project.
AtomicDEX is a DEX that enables users to use atomic swaps within their application. The difference between the two is that AtomicDEX offers probably the highest degree of interoperability out there, as it supports exchanges between cryptocurrencies and ERC20 tokens derived respectively from the Bitcoin and Ethereum blockchains, including also tokens belonging to the Komodo ecosystem.
Lightning Network, on the other hand, is a network developed on the Bitcoin blockchain specifically created to improve the scalability of BTC exchanges and the interoperability of the protocol thanks to the use of atomic swaps, allowing BTC to communicate efficiently with other blockchains.
The difference between the two is that Lightning Network supports the exchange only between blockchains that have the same cryptographic key as Bitcoin and which originate from forks, such as litecoin, dogecoin, Zcash. As a matter of fact, this has been designed mainly to improve scalability.
As far as interoperability is concerned, only blockchains that integrate LN in their protocol can support it, as did Ripple to improve interoperability between the two ledgers. Ethereum has obviously not adopted this type of solution because it has no problem competing with the use of the blockchains themselves since more than 90% of decentralized applications are born using the Ethereum protocol.
However, a network has been created that is conceptually similar to the Lightning Network that uses state channel technology to increase the scalability and efficiency of transactions. The network is called Raiden Network and the substantial difference with bitcoin is that it is compatible only with ERC20 tokens.
At the time of writing the most performing is AtomicDEX which since the beginning of the month has already registered 126,939 atomic swaps.