ChainSwap's Cross Chain Swap Architecture
How does the Cross Chain Swap Work?
The user will first be asked to approve the tokens to send from the source blockchain. Approving is simply telling the smart contract that you allow it to use your tokens for the transfer.
Once the tokens are approved, the DApp prompts the user with another transaction that executes a function called sendMessagePayFirstStep()
. This function receives all the information so the smart contract has all the necessary data and components to execute the swap. As the swap commences you'll be able to track your transaction on Chainlink's CCIP portal and the DApp will generate that link. (https://ccip.chain.link/)
First users, can select the "source blockchain" and the "receiving blockchain" for the cross chain swap they'd like to submit. Then the user can select or input a tokens contract on the "source blockchain" followed by inputting the desired token one the receiving blockchain. You'll then see a simulation of the token values and fees for the transfer. The user then can select "SWAP" to begin the cross chain transaction.
The user will first be asked to approve the tokens to send from the source blockchain. Approving is simply telling the smart contract that you allow it to use your tokens for the transfer.
Once the tokens are approved, the DApp prompts the user with another transaction that executes a function called sendMessagePayFirstStep().
This function receives all the information so the smart contract has all the necessary data and components to execute the swap. As the swap commences you'll be able to track your transaction on Chainlink's CCIP portal and the DApp will generate that link. (https://ccip.chain.link/)
After the message is received on the source blockchain, it then enters Chainlink's CCIP transfer system where it will be transmitted to the other blockchain. This process usually takes about 15 to 25 minutes as of now due to the high security guarantees implemented by Chainlink. This allows tokens to be transferred safely with level 5 security in a completely decentralized way. As CCIP advances, this process will be much quicker. As CCIP implements single block transactions, ChainSwap will as well.
During this transaction the funds will be swapped for USDC utilizing Circle's Cross Chain Transfer Protocol as a medium to swap between chains and maintain value. USDC was the obvious token intermediary due to high security implemented into the protocol, all implemented blockchains having USDC so that value is maintained throughout the swap. In the future, more routes will be implemented that allow users to transfer different tokens directly without having to swap them first for USDC thus lowering fees even more.
After the cross chain transfer is completed through Circle's CCTP, the user will receive the funds in the target blockchain in the form of USDC and then that USDC is subsequently swapped into the target token and sent to the user.
If the user chooses to send USDC on the target or origin blockchain, the user will have a cheaper transaction because the tokens will have less swaps and gas fees required.
Listing Form and Direct Trading Links Enabled: Now communities can apply to be directly listed on ChainSwap for easy access for cross-chain or intra-chain trading. Communities can also share a direct buy link that will have their contract preloaded when accessing.
Last updated