Try to change two different cryptocurrencies probably notice the high cost that involves.
If you want to trade token A in the Binance smart chain and token B in a polygon chain that way you need some deserved things.
- Whether the smart contract is not supported for the mechanism, the assets are locked and they are frozen in the blockchain and where they live using the smart contract.
- On receiving blockchain here the new tokens are created at an equal amount.
- The original assets are unlocked where the equivalent assets of the tokens are burned and the user wants to redeem the assets.
At that same time, both chains are used in any way and the process prevents the assets. This situation is less time-consuming and it has a less optimal state. In the decentralized world where the users can easily switch their crypto directly without using and trusting the 3rd party(intermediaries).
What is an Atomic Swap?
This atomic swap allows the users to trade their 2 cryptocurrencies directly without a 3rd party. This particular case allows me to exchange Token A(BSC) into a Token B(Polygon) directly to my wallet.
From computer science, the term atomic comes about when the operation is conducted or is not conducted. By using atomic swap we can easily exchange my coins with other parties.
How Does It Work?
The atomic swap is implemented by (HTLC) Hashed Time-Locked Contracts.
- In this Token A, they assume t6he owner, and the first pick out Token A or Token B.
- The hash value is calculated by the owner of Token A Hash-” Secret”.
- Token A is sent to the contract when the owner deploys on an HTLC of the Binance chain.
- The HTLC contact releases the Token A to the Token B holder when they know the secret at the stage of the secret yet. The sender transaction knows the secret of whether the hash value was calculated previously.
- Token B is sent to the contract where they deploy the HTLC using the polygon chain and they deploy.
- Both of the users can withdraw their bargain at the end, the amount is sent by the user and everything is checked out.