Understanding Cross-Chain Smart Contracts: Advantages, Challenges, and Cases

Chainlink
2022-03-03 18:56:03
Collection
Today, the multi-chain ecosystem is full of innovative opportunities, and more and more developers are deploying applications in multi-chain environments to attract more users and traffic.

Original link: https://blog.chain.link/cross-chain-smart-contracts-zh/

Cross-chain smart contracts are decentralized applications composed of multiple smart contracts deployed on different blockchain networks. These smart contracts can achieve interoperability and together form a complete application. This innovative design paradigm plays a key role in the development of the multi-chain ecosystem and has the potential to leverage the unique advantages of different blockchains, sidechains, and layer 2 networks to create entirely new use cases for smart contracts.

This article will explore the development history of the multi-chain ecosystem, summarize the advantages and challenges of current multi-chain smart contract development, and deeply analyze how multi-chain smart contracts will disrupt the development model of blockchain dApps.

Afterward, we will also list the innovative use cases unlocked by cross-chain smart contracts, as well as how the Cross-Chain Interoperability Protocol (CCIP) will enable cross-chain communication between various blockchains and promote the advancement of cross-chain smart contracts.

The Rise of the Multi-Chain Ecosystem

Previously, most smart contract applications were deployed on the Ethereum mainnet, as Ethereum was the first network to support fully programmable smart contracts. Ethereum became the mainstream smart contract network not only due to its first-mover advantage but also because it created a growing network effect, decentralized infrastructure, mature development tools, and a large Solidity developer community.

However, as the demand for Ethereum smart contracts continued to rise, the Ethereum block space (i.e., computational resources) became insufficient, leading to skyrocketing transaction fees on the Ethereum network. Although the Ethereum mainnet remains the safest choice for deploying smart contracts, many end users have begun to seek more cost-effective alternatives.

As a result, over the past year, an increasing number of smart contracts have started to be deployed on other layer 1 blockchains, sidechains, and layer 2 rollups to meet the needs of users and developers. The multi-chain ecosystem was once just a concept, but it has now become a reality. The increasing diversity of blockchains where DeFi applications are deployed is a testament to this.

Moreover, various on-chain metrics such as daily active wallet addresses, transaction counts, and network loan amounts undoubtedly prove that the multi-chain ecosystem is thriving.

image The development history of the multi-chain DeFi ecosystem

As new blockchains continue to emerge, the total volume of the smart contract economy is soaring, attracting more new users to engage in transactions at lower costs.

Additionally, each sidechain and layer 2 has its own unique scaling and decentralization solutions, each with distinct characteristics in mechanism design, consensus, transaction execution, data availability, and privacy. In the multi-chain ecosystem, all these different models can run in parallel, be tested in practice, and ultimately drive the ecosystem forward.

The Ethereum community has also embraced this multi-chain strategy, adopting a rollup-centric development path to enhance the throughput of the Ethereum ecosystem by deploying multiple layer 2 scaling solutions. Layer 2 networks increase the transaction throughput of Ethereum smart contracts, thereby reducing the cost of individual transactions while maintaining the security advantages of the Ethereum mainnet.

The specific solution involves using fraud proofs or validity proofs to verify off-chain computations on the Ethereum blockchain. Data sharding technology will then be utilized to enhance the performance of rollup calldata.

Today, more and more developers are deploying smart contract codebases across multiple blockchains to fully leverage the advantages of the multi-chain ecosystem. Projects developing multi-chain smart contracts can expand their user base and experiment with new features on lower-cost blockchains, thus mitigating cost risks. This multi-chain strategy is gradually gaining momentum in various DeFi verticals.

For example, SushiSwap DEX has deployed on 15 different blockchains; Beefy Finance's yield aggregator has deployed on 12 chains; and Aave's money market has deployed on 3 chains. Bottlenecks of Multi-Chain Smart Contracts Although the multi-chain ecosystem brings many benefits to users and developers, deploying the same smart contract code across multiple blockchains presents a series of unique challenges and trade-offs.

First, each time the code of a multi-chain smart contract is deployed on a new blockchain, a copy of the original application must be created, which means the application no longer has uniqueness.

In contrast, the smart contracts deployed on each chain manage their own internal states (such as tracking account balances), and contracts on different blockchains can hardly or even completely cannot interact directly. While users can access copies of the application on any chain, the user experience across different chains cannot be guaranteed to be identical. image Multi-chain smart contracts are essentially isolated dApp copies on different chains

This phenomenon is particularly pronounced on decentralized trading platforms, especially multi-chain automated market makers (AMMs). Since user assets can only exist on one blockchain at a time, the liquidity of the application is dispersed across different blockchains. As a result, the total locked value of applications on each chain decreases, leading to increased trading slippage and reduced transaction fee income.

Additionally, each time an AMM application is deployed on a new blockchain, it must create liquidity from scratch. If yield farming is also adopted on the new chain for cold starts, this will lead to the continuous dilution of the protocol's native tokens.

If an application needs to maintain a single source of truth for its state, such as a unified registered on-chain domain name system, it becomes challenging to achieve multi-chain deployment. If registration is deployed separately on each chain, different individuals may register the same domain name on different chains, leading to confusion. Therefore, if an application wants to ensure global state consistency, it typically only deploys on one blockchain network.

In addition to application-level challenges, multi-chain systems can also cause trouble for end users. Users may need to learn how to interact with other blockchains, as assets on one blockchain can only be used within dApps on that chain.

Thus, users must manually use token bridges to send tokens to dApps on other blockchains. Users not only need to reconfigure their wallets, familiarize themselves with the operational processes on the new chain, and hold native blockchain tokens to pay gas fees, but they also have to sacrifice security to some extent, as many cross-chain token bridges currently have security issues.

In summary, the biggest bottleneck of multi-chain smart contracts is that interoperability between smart contracts deployed on different blockchains, sidechains, and layer 2s is almost or even completely non-existent. While token bridges can currently facilitate multi-chain deployment, securely transmitting data across chains requires a completely new approach to designing the infrastructure of smart contracts.

Cross-Chain Smart Contracts

Secure cross-chain communication (i.e., transmitting any data, tokens, and instructions between various chain environments) is a key element in realizing cross-chain smart contracts. Cross-chain smart contracts are decentralized applications composed of multiple smart contracts deployed on different blockchain networks. These smart contracts can communicate with each other and together form a complete application.

image Cross-chain smart contracts are essentially a complete dApp with logic deployed across different blockchains

Although this deployment can be achieved in various ways, at the lowest level, cross-chain smart contracts need to be designed to allow developers to split applications into different modules. In other words, smart contracts on different chains can perform different tasks, while all smart contracts remain synchronized and collectively achieve the same application scenario.

This way, developers can leverage the advantages of different blockchains to realize unique value. For example: decentralized applications can use the manipulation resistance of the first blockchain to track asset ownership; utilize the high throughput of the second blockchain for low-latency transactions; leverage the privacy of the third blockchain to identify user identities; and use the decentralized storage capabilities of the fourth blockchain to store metadata.

Additionally, this design paradigm of cross-chain smart contracts can facilitate smoother interactions between copies of the same smart contract deployed on multiple blockchains. This will help unify the user experience of multi-chain applications across different blockchains.

Therefore, cross-chain smart contracts can address many of the bottlenecks faced by existing multi-chain smart contracts and create entirely new application scenarios. To further showcase the limitless potential of cross-chain smart contracts, here are a few use cases. Cross-Chain Trading Platforms Users executing trades on cross-chain decentralized exchanges (DEXs) can access liquidity from token pools across various blockchains to solve the problem of liquidity fragmentation in multi-chain DEXs. For instance, when a user trades, their deposited tokens can be split and bridged to different blockchains to obtain the best execution price; then, the tokens after the trade can be bridged back to the original blockchain and deposited into the user's wallet.

This way, liquidity across all blockchains will be activated, allowing users to enjoy lower trading slippage, and liquidity providers on each chain can earn higher transaction fee income.

Moreover, users of cross-chain DEXs can also swap native tokens from one chain for native tokens on another chain. For example, users can exchange ETH on Ethereum for Bitcoin on the Bitcoin blockchain. This allows users to trade native tokens across different blockchains flexibly without going through wrapped tokens or centralized exchanges. Cross-Chain Yield Aggregation

Cross-chain yield aggregation can place users' deposited funds into DeFi protocols on various chains. This way, users do not need to manually bridge token assets to other chains to maximize yields and can easily obtain higher returns. Therefore, this will greatly improve the experience of multi-chain yield farming, simplifying all cumbersome processes.

In addition, this mechanism can expand the total value locked (TVL) of DeFi applications on emerging blockchains and thus activate liquidity in the multi-chain ecosystem. Cross-Chain Lending Cross-chain money markets can promote the development of cross-chain lending markets, allowing users to deposit collateral assets (ETH) on one chain and borrow token assets (such as USDC) on another chain. This way, users can keep their collateral assets on a more secure blockchain while borrowing token assets on a higher throughput blockchain and generating returns in applications on that chain.

Users of cross-chain money markets can also borrow token assets on another blockchain with lower interest rates and then bridge the assets back to the second blockchain to repay the loan. This will help unify yields across different blockchains and reduce borrowing costs for low liquidity, high-interest money markets. Cross-Chain DAOs Decentralized autonomous organizations (DAOs) can utilize cross-chain interoperability to conduct on-chain voting in one or more high-throughput blockchain networks and send the voting results back to the core governance contract on a more costly blockchain. This not only reduces transaction costs for DAO participants but also achieves on-chain transparency and resistance to manipulation, encouraging more participation.

Additionally, cross-chain DAOs can seamlessly govern and modify smart contract parameters across different blockchains, broadening the governance scope for token holders in one or more on-chain environments. Cross-Chain NFTs Users in cross-chain NFT markets can publish or bid on NFTs on any blockchain. This will enhance the liquidity of NFTs, and NFTs can be seamlessly transferred between different blockchains after the bidding ends.

Moreover, games on a certain blockchain can also utilize cross-chain interoperability to track NFT ownership on another blockchain. Therefore, users can securely store NFTs on any blockchain while using these NFTs in games on other blockchains.

These use cases are just the tip of the iceberg; cross-chain smart contracts will ultimately realize infinite possibilities. In addition to splitting decentralized applications into different modules, cross-chain smart contracts can also fully leverage the advantages of the multi-chain ecosystem in other ways.

"Storefront" Smart Contracts

Existing single-chain or multi-chain smart contracts can deploy "storefront" smart contracts to fully leverage the advantages of the multi-chain ecosystem. Storefront smart contracts provide users with an entry point, allowing them to access smart contract applications on other chains. Users can use these smart contracts to store assets in decentralized applications on another chain without leaving their original blockchain environment.

Users do not need to manually bridge assets to smart contracts on other blockchains; they do not even need to know which blockchain, sidechain, or layer 2 the smart contract is running on. For users, applications on other blockchains function just like native applications.

All existing decentralized applications, such as derivatives trading platforms or money markets, can add storefront smart contracts in a backward-compatible manner. Since smart contracts themselves are composable, existing protocols can add cross-chain interoperability in a permissionless way. A smooth user experience and higher interoperability will greatly promote the development of the multi-chain economy.

How CCIP Will Safeguard the Cross-Chain Ecosystem

Although cross-chain smart contracts fundamentally disrupt the development model of decentralized applications, most blockchain networks today remain essentially isolated from one another. This means that these blockchains cannot directly send and receive data. To realize cross-chain smart contracts, cross-chain bridges need to be built between chains.

So far, cross-chain bridges have mainly focused on transferring tokens between different blockchains, commonly by minting wrapped assets on one chain based on native assets from another chain. However, cross-chain smart contracts require a more generalized bridge to transmit data packets, tokens, and instructions.

This type of infrastructure must ensure security and reliability, and the codebase must undergo rigorous audits to ensure that transmitted messages are not manipulated, can be delivered to the target chain in a timely manner, and can withstand external factors such as blockchain reorganizations.

Decentralized oracle networks (DONs) effectively solve the oracle problem for blockchains (i.e., blockchains cannot access off-chain resources); similarly, DONs can securely achieve blockchain interoperability.

The Chainlink network can integrate with protocols on any blockchain and has currently been integrated into a range of blockchains, sidechains, and layer 2s. Therefore, Chainlink has sufficient capability to drive the multi-chain ecosystem towards cross-chain smart contracts. To achieve this goal, Chainlink is currently developing a global open-source standard for cross-chain communication, namely the Cross-Chain Interoperability Protocol (CCIP).

Unlike ordinary cross-chain bridges, CCIP allows smart contracts to securely transmit data and tokens across all blockchains. Smart contracts can encrypt or decrypt data messages in any way, providing high flexibility.

It is worth mentioning that CCIP will utilize the Chainlink oracle nodes that are already operational. These nodes not only possess high reliability and tamper-resistance but can also be compatible with any blockchain, currently securing hundreds of billions of dollars in value for the multi-chain DeFi economy.

CCIP not only has a high-quality codebase but also plans to adopt an innovative risk control system called the "Anti-Fraud Network" to further ensure security. The Anti-Fraud Network consists of multiple decentralized oracle networks, which in turn are composed of several independent node committees.

These nodes do not participate in the operation of the CCIP cross-chain bridge but are specifically responsible for monitoring potential malicious attacks or network emergencies such as blockchain reorganizations that may occur in CCIP services. This additional verification layer has the authority to urgently shut down the cross-chain bridge, pausing data and token transmissions to protect cross-chain smart contracts and users from black swan events.

image The Cross-Chain Interoperability Protocol (CCIP) will transmit messages between various blockchains

Currently, hundreds of single-chain or multi-chain smart contract applications are using Chainlink oracles to obtain off-chain data and trust-minimized computing resources. These protocols can use the same decentralized infrastructure in the future to achieve cross-chain interoperability.

CCIP can provide the infrastructure for cross-chain smart contracts and support the development of various cross-chain token bridges, allowing users to directly bridge tokens into different blockchains while simultaneously sending instructions to deploy these tokens.

Although the development of cross-chain infrastructure faces some challenges, the focus must be placed on code auditing and establishing defense mechanisms to ensure security to the greatest extent possible, which is the key to establishing the CCIP standard.

Conclusion

Today, the multi-chain ecosystem is full of innovative opportunities, with more and more developers deploying applications in multi-chain environments to attract more users and traffic. Although the design paradigm of multi-chain smart contracts faces some bottlenecks, the emergence of cross-chain smart contracts will bring tremendous opportunities, not only eliminating these bottlenecks but also unlocking a series of innovative use cases.

CCIP aims to create a secure and reliable cross-chain infrastructure to help decentralized applications safely transmit any data to smart contracts on any blockchain, accelerating this transformation. In the 1990s, no one could predict all the application scenarios of the internet today; similarly, we cannot accurately predict the future application scenarios of cross-chain smart contracts.

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
ChainCatcher Building the Web3 world with innovators