Cross-Chain Communication
Just as critical as access to external data is the ability for different networks to communicate with one another. Just like there are existing development standards for the Internet that ensure websites can be supported across all browsers and devices, blockchain needs systems in place that allow dApps and cryptocurrencies to be supported across different networks. While the standards for cross-chain communication are currently not very standardized, multiple mediums exist and new ones are being constantly developed.
Wrapped Tokens
Traditionally, cryptocurrencies that are available on one chain but not on another are represented as wrapped tokens. These wrapped tokens are tokens that mimic the price of the original asset but are available on chains that the original asset is not. A wrapped token is usually denoted with a ‘W’ prefix, which signifies that it’s not the real asset but a representation of that asset on another chain. Some of the most popular wrapped tokens include WBTC (wrapped BTC) and WETH (wrapped ETH), where chains that don’t support BTC or ETH directly can create wrapped versions pegged to the original token price.
Source: Tangem Wallet
💡 How does bridging work?
Bridges are dApps that are designed to be able to send assets between chains. These bridges act as decentralized exchanges with the capability of transferring an asset from one chain to another. Most bridges support multiple different networks and will let you bridge an asset directly from one to another. They contain liquidity pools similar to normal decentralized exchanges, with the only difference being that those pools are spread across multiple networks.
If you were to bridge WETH from the Ethereum network to the Avalanche network, your WETH on the Ethereum network would be burned (removed from circulation) on Ethereum and a matching amount of WETH on the Avalanche network will be minted (created) and added to your wallet.
One popular bridge is Stargate, although some DEXes, such as Sushiswap, began directly integrating cross chain bridging capabilities. This can eliminate the need of using a DEX and then a bridge by simply combining them and allowing users to conduct cross chain transfers directly through an exchange.
Cross Chain Protocols
A more modern way of establishing cross chain communication is through the use of cross-chain protocols (CCPs). These protocols can effectively pass data between chains and are not restricted solely to tokens. They are critical to cross-chain operations because they act as a middleware solution - if it weren’t for these protocols, any dApp that would want to work on multiple chains would have to build out their own system, which would be time-consuming, expensive, and complicated.
Source: DCFT
Circle, the company behind the USDC stablecoin, also has their own CCP called the Cross-Chain Transfer Protocol (CCTP). The USDC stablecoin is available across almost 70 different chains, making it widely compatible for cross-chain transfers. CCTP allows users to transfer any amount of USDC from one blockchain to another by rebalancing the amount of USDC on each chain after every transfer. This protocol is particularly useful for decentralized exchanges, which can use USDC as the transfer token to transfer assets across chains for a smooth user experience.
💡 The Sushiswap Example
Sushiswap is a popular DEX that uses CCTP to conduct cross chain trades. This integration allows users to trade any token for any other token on a different network. Unlike with most bridges that require a specific token (usually a wrapped token like WETH) to conduct the transfer, a user can exchange any token for a different token on a different network.
Let’s say you had $1,000 worth of AAVE tokens on the Ethereum network that you wanted to convert to the DAI token on the Base network. Using a normal bridge you’d likely have to: convert your AAVE into a wrapped token like WETH > bridge the WETH from Ethereum to Base > convert your WETH to DAI.
With the CCTP integration on Sushiswap, you skip this entire process and can directly swap your AAVE to DAI across chains. Here’s how the process would look on the back-end:
- The exchange would automatically convert your $1,000 of AAVE tokens into USDC tokens
- The CCTP mechanism would then burn $1,000 worth of USDC on the Ethereum network and mint $1,000 worth of USDC on the Base network
- The exchange would automatically convert your $1,000 of USDC to DAI and deposit it into your wallet
Feel free to take a look at Sushiswap’s documentation as well as Circle’s documentation for more information on how these systems operate.
BYOB - Build Your Own Bridge
Since blockchain is a constantly evolving technology, many developers choose to build their own cross-chain communication methods for their apps. One popular method is to utilize Wormhole, a platform that has its own Software Development Kit (SDK) for building bridges directly into your own application. Wormhole’s SDK works on similar principles as the cross chain protocols do, but building your own bridge gives you much more customization capabilities than using a pre-built one.
Wormhole offers both automatic relaying, which is done fully on-chain, as well as specialized relaying, which may require some off-chain code.
Automatic relaying: handled entirely by Wormhole - you create a smart contract that sends all the data to a Wormhole relayer contract, which then transfers that data to the relayer contract on the receiving chain.
Specialized relaying: gives you more control and lets you create a custom relayer contract instead of using Wormhole’s standard one, which lets you add in any additional logic you’d like to use.
For more information on how these systems work, check out Wormhole’s documentation.
Using a wrapped token can make it easier to bridge, or cross, cryptocurrencies between chains since the same wrapped token can be used across both chains.
For example, let’s say you have $1,000 worth of ETH on the Ethereum network which you want to bridge to the Avalanche network. Avalanche doesn’t support ETH directly because this chain does not follow the ERC token standard Ethereum does (discussed in Section 3 in the role of cryptocurrency). Instead, the Avalanche network uses WETH that is compatible with the chain.
You would therefore be able to convert your ETH into WETH and bridge that WETH from the Ethereum network to the Avalanche network. You’ve successfully brought your $1,000 over from the Ethereum network to Avalanche in the form of WETH which you can now use on the Avalanche network.
For some further reading how how wrapped tokens are custodied and created, check out this article by Coin Telegraph.
In addition to its role as a data oracle provider, Chainlink offers its own CCP solution called the Cross-Chain Interoperability Protocol (CCIP). CCIP lets developers embed an interface directly into their dApps, giving them a secure way to access other chains. CCIP has 3 main capabilities:
- Arbitrary messaging - allows you to send any encoded data to another chain to be received by a smart contract on that chain
- Token transfer - lets you directly transfer tokens to a smart contract or wallet on another chain
- Programmable token transfer - lets you send both tokens and encoded data to another chain at the same time
For a more in-depth look at how CCIP works, check out Chainlink’s CCIP documentation that covers how the protocol is used and how to embed it into your own dApp.
📋 Practice Question