Blockchain is a technology that has the potential to expand and improve the use of the technology. We understand that blockchain technology could revolutionize many industries, such as finance, trading and gaming, but the non-cumulative nature its ecosystem continues to hinder the widespread adoption of blockchain technology. There are many blockchain platforms currently available. They range from the first-generation blockchain, like Bitcoin, to the third-generation, like Avalanche. Each of these blockchains has its own, isolated chains. These chains cannot cross or facilitate token exchanges or trades that belong to different blockchain protocols. Many projects built on Ethereum protocol can interoperable with each other, such as Uniswap and Dave. They can exchange cryptocurrencies, swap assets, and perform trades. Cardano also launched a sidechain protocol that allows users to safely move value between two blockchains that support the Cardano protocol. Even with these features, blockchains were unable to allow users freedom of movement between different protocols.
Users have been searching for solutions to the problems of exchanging and swapping across multiple blockchain platforms since then. Cross-chain swap was the solution. It plays an important role in the improvement of the blockchain ecosystem. This article will detail cross-chain swap to show its importance in the developing blockchain ecosystem.
What was the limitation of the Siloed Decentralized System?
Even the most demanding platforms like Ethereum and Bitcoin have their own ecosystem. They are independent and decentralized, but they require a separate ecosystem for token exchange. This means that one cannot exchange Ethereum’s native tokens with another protocol like Avalanche.
This limitation became a significant problem for both individuals and businesses that use blockchain. However, with the increasing decentralization trend and the introduction of advanced blockchains, it is now possible to overcome this issue. Take Avalanche, which was launched in September 2020. It has over 225 projects. AVAX tokens can also be traded in large volumes.
People began to invest in different blockchains and eventually realized the need for cross-chain token trading technology. Cross-chain swap makes this possible. How can token holders on a specific blockchain use those tokens in different ecosystems? Let’s dig deeper into the technology.
What is cross-chain swap?
Cross-chain swap, also known as Atomic Swap, is a smart contract that allows the exchange of tokens between two distinct blockchains. This allows users to swap tokens on any other blockchain directly without the need for intermediary or central authority. You can exchange ERC-20 tokens for BSC tokens, for example. Cross-chain swaps allow individuals to trade tokens with other members of the blockchain network. The swap can also be done directly from your wallet, which makes it faster.
Tier Nolan first proposed the idea of peer to peer swaps between blockchains. Charlie Lee, a well-known computer scientist and creator of Litecoin, implemented the technology in 2017. He traded LTC for BTC, and so explained the mechanism of cross chain swap.
Cross-chain swap is an atomic process that completes transactions between participants (nodes). Computer science is the source of the term “atomic”, which refers to indivisible transactions. This means that the transaction is executed as agreed or that the entire transaction is invalid.
Let’s break it down.
Non-atomic crosschain swap is where you send a token (say AVAX), to someone on the blockchain network in hopes of receiving a different token (say Ethereum) in return. Spray and pray can result in fraud as the receiver has the option to exit the process at any time. The atomic swap, on the other hand, confirms that both parties received valid tokens within a specified timeframe or the transaction will be declared null. The sender receives back the exact amount of the token he used to swap. This is how cross-chain Swap eliminates fraud and manipulation.
What is the process of cross-chain swaps?
Cross-chain Swaps make use of smart contracts to allow token exchange between two parties using two different blockchains. These smart contracts use a technology called Hash Time Lock Contracts, (HTCLs), that locks transactions with unique combinations in order to verify verification on both sides. These security features are included in the HTCL technology:
Hashlock
Hashlock technology allows smart contract to lock coins with a secret key (the combination data). This secret key can only be accessed by the swap initiator. After he has verified the deposit, he will reveal the secret combination. The receiver will also be able to see the secret combination that unlocks the deposit after the revelation.
Timelock
The Timelock mechanism uses time constraints to protect transactions on the blockchain network. It speeds up the transaction. It stipulates that the transaction must be completed within a specified time or the funds will return to the depositor.
Example:
- Jack deposits his ADA tokens to an HTCL address. The HTCL functions as a strong virtual safe. It can only be opened with the secret combination Jack generated and kept secret.
- Lara will inspect the deposit once it reaches her. She will then determine if the deposit contains enough tokens to swap. The cryptographic hash of Jack’s unique combination is then used by Lara. It allows her to deposit her tokens (Ether), to the same address at HTCL.
- Jack gets the deposit from Lara and checks it. Then he gives the secret combination to open the deposit. Lara can see the combination immediately after Jack has revealed it and can use it to open the deposit.
- Cross-chain swaps are complete when each token is received by the recipient.
Read More : https://www.leewayhertz.com/what-are-cross-chain-swaps/