LI.FI Guest Post: Understanding Cross-Chain Bridging
Over time, we have seen an explosion in blockchain networks, all with their own unique designs and features. While Ethereum still dominates with over $44B locked in decentralized applications (dApps) across its ecosystem, other blockchains such as Solana, Tron, and Polygon are now attracting tremendous liquidity and users.
As these different blockchain ecosystems are gaining traction, infrastructure is needed to connect them. To fulfil this demand, we need bridges.
Our friends at LI.FI are experts in providing smart routing for the safest and cheapest routes for transactions and multi-asset swaps across multiple blockchains. We are delighted to have them write a guest post so that you can get a deeper understanding of one of crypto’s most important topics.
Here, we will talk about:
- What are bridges, and why do we need them?
- Different types of bridges and bridge designs
- Risks of using bridges
- The case for aggregating bridges with LI.FI
- Onboarding the masses into crypto with multi-chain onramps
What are Bridges and Why Do We Need Them?
Bridges in crypto work similar to the real bridges in the physical world. Instead of connecting two physical locations, bridges in crypto connect two different blockchain ecosystems and enable communication between them.
In an ideal world, blockchains could simply talk to each other. However, this is not possible because blockchains operate in an isolated environment with unique rules and language. This results in trust boundaries between blockchains, meaning that dApps on different chains cannot talk to each other.
Bridges are needed to establish communication channels between two blockchains. They facilitate communication between blockchains and allow the transfer of assets and information between them.
For instance, Alice has ETH on Ethereum Mainnet but needs funds on Avalanche to test a new dApp. It is not possible to simply send her funds from one blockchain to another. Something like a bridge in the middle has to facilitate her transaction. Thus, to move ETH from Ethereum to Avalanche, Alice uses a bridge (like Avalanche Bridge) and converts her ETH on Ethereum to wETH on Avalanche, which can now be used on the dApp.
Different Types of Bridges and Bridge Designs
- Native Bridges — Designed to support the movement of assets between two blockchains. The primary aim of building native bridges is to bootstrap liquidity on a blockchain. Example — Arbitrum Bridge, Harmony’s Horizon Bridge, Binance Bridge, Ronin.
- Liquidity Networks — Use liquidity pools to exchange assets on one chain for the desired assets on the other chain. An atomic swap mechanism exchanges assets. This is considered a very secure type of bridge because liquidity networks provide users with native assets and not wrapped assets. Example — Connext, Hop, Hyphen.
- Data Messaging Protocols — Enables the transfer of data and messages across chains in addition to assets. Given their ability to send messages between chains, these bridges can facilitate complex cross-chain strategies. Example — Nomad, LayerZero, Axelar, Wormhole.
Moreover, bridge designs are limited by the interoperability trilemma, which states that bridges or interoperability protocols can only have two of the following three properties:
- Trustlessness — the protocol does not add any new trust assumptions, and its security is equal to the underlying blockchain.
- Extensibility — the protocol’s ability to be supported by any blockchain.
- Generalizability — the protocol’s ability to handle arbitrary cross-chain data (aka message passing outside of tokens).
Based on the properties mentioned in the interoperability trilemma, there are roughly three bridge designs:
- Light clients and relays or natively verified bridges — These bridges optimize for trustlessness and generalizability. They verify the proof of work on other blockchains to confirm cross-chain transactions. Actors monitor events on the source chain, generate proof of work, and forward those proofs to light clients on the destination chain. Then, the validity of proofs for specific transactions on the destination chain is checked against the records kept by the light clients on the source chain. Example — Cosmos IBC, Near Rainbow Bridge.
- External validators or externally verified bridges — These bridges optimize for extensibility and generalizability. They rely on a federation or group of validators outside the source and destination chain to confirm transactions between blockchains. A trusted federation is responsible for communicating and moving assets between blockchains. Example — Multichain, Synapse.
- Atomic swaps or locally verified bridges — These bridges optimize for trustlessness and extensibility. They use self-executing smart contracts to exchange assets on the source chain for assets on the destination chain. Smart contracts replace third-party validators, which makes this mechanism trustless. Example — Connext, Hop.
Here’s how you can map some of the most popular bridges based on trustlessness, extensibility, and generalizability:
Risks of Using Bridges
Bridges have led to some of the biggest hacks in the history of DeF (4 in the top 10). Some of the notable bridge hacks include:
Bridges are in their nascent stages of development. Thus, when interacting with bridges, users must be aware of the following risks:
- Smart contract risk — Though most bridges have successfully completed audits (multiple for some) from well-reputed security firms, they are still susceptible to bugs in the code of smart contracts. This vulnerability was exposed during the Wormhole bridge hack.
- Technology risk — Given the digital nature of bridges’ operations, just like anything else in crypto, they are exposed to technology risks such as software failure, spam, buggy code, chain delays, etc.
- Exposure to wrapped tokens — Many bridges give users wrapped tokens post bridging, i.,e, representations of the original asset and not the original (or native) asset itself. This exposes the user to risks associated with the bridge and its tokens in case of any exploits. For instance, if a bridge is exploited, the bridge’s wrapped tokens will likely lose value. This vulnerability can currently be seen with the wrapped assets on Harmony’s Horizon bridge post hack as they have lost peg.
- Counterparty risks — Externally verified bridges that use validators in their bridge design add trust assumptions to the system. This forces users to trust third-party actors with their funds and thus exposes them to 1) censorship risks where someone can stop a user from transferring their funds, 2) custodial risks as validators can collude to steal user’s funds, and 3) rug pulls.
The Case for Aggregating Bridges With LI.FI
The bridging ecosystem is a complex world. There are over 100 bridges in live operation, all with their own unique strengths and weaknesses. Here’s a snapshot from a community worksheet with all the bridges and the blockchains they connect:
The image above shows how complicated things can get for users when they have to decide which bridge to choose. Bear in mind that the worksheet only has approximately 20 bridges and their routes, meaning things are even more complicated in reality for users trying to choose the best route.
Generally, having more options is good. However, in the case of bridges, it complicates things — as there are many bridges and a lack of knowledge and awareness among users about the trade-offs each bridge makes. Moreover, the fact that most bridges market themselves as trustless, decentralized, and secure, even if they are not, does not help users and makes things even more difficult.
So, how can we improve this complicated UX? By aggregation with LI.FI.
LI.FI is a cross-chain bridge aggregation protocol, aka the ultimate cross-chain money Lego. LI.FI aggregates DEXs and bridges and abstracts away decisions that would normally need to be made by the user or developer. LI.FI’s goal is to completely abstract away the complicated process of bridging assets for the user. We do this by aggregating the most secure bridges in the ecosystem.
Moreover, as bridges are mostly limited to stablecoins and native currencies, LI.FI connects them to all existing DEX/DEX aggregators on each chain. This enables the bridge-swap functionality, and users can swap from any asset (A) on any chain (X) to any asset (B) on any other chain (Y), in a single transaction with LI.FI.
In essence, LI.FI has built a product that combines the power of 20 DEXs, 10+ bridges (and counting), and 17+ smart contract blockchains into a single UX.
Many established projects like Alchemix, DeFi Saver, Superfluid, Perp, KlimaDAO, and others use LI.FI’s SDK/API/Widget under the hood to go cross-chain. Moreover, users can use transferto.xyz to bridge and swap across 17+ chains supported by LI.FI.
For further examples of how LI.FI works, please refer to:
- Alchemix — SDK Integration
- DeFi Saver — SDK Integration
- Transferto.xyz — LI.FI B2C interface
- Cross-Chain Klima Staking — Custom-built cross-chain staking product for Klima
Alchemy Pay Provides Multi-Chain On/Off Payment Ramps
Alchemy Pay is focused on making entering and exiting blockchain networks as easy and direct as possible. That means from the perspective of users as well as developers. Regardless of which blockchain a user wants to use, in order to be able to interact and send transactions, a user needs the right cryptocurrency.
We have developed on/off ramp plugins that can be integrated into a site on any blockchain protocol. These payment ramps allow people to participate in a dApp or a blockchain service directly with their fiat currency funds via credit or debit cards, bank transfers or even popular local mobile wallets. Newcomers and experienced users are able to sign up and use their local currency to purchase the correct cryptocurrency in under a minute. The purchased crypto is sent to their crypto wallet address so that they maintain custody. From that point on the user is able to use the infrastructure created by LI.FI to move those funds across different blockchains and participate quickly, securely, and fuss-free.
Our payment solutions connect fiat currency and cryptocurrency. They are ‘chain agnostic’, which means that they can operate on all chains. Developers can make their dApps more accessible than ever before for newcomers with these customisable payment ramps hosted directly on their platforms.
One of blockchain’s biggest problems has been onboarding new users, particularly those who are not tech savvy. These payment ramps change all that by dramatically reducing the overwhelming steps and improving first-time user experience. With the ramp, the user never has to leave the platform they are intending to use. True accessibility also comes with the ability to exchange crypto back to local currency for users who want, not only to enter, but to exit as well.
To get an idea of these crypto ramps in operation, take a look at a recent integration with BeFi’s secure multi-chain wallet for Web3.0 dApps, DeFi, and NFTs:
LI.Fi is an infrastructure protocol that aggregates cross-chain bridges and decentralized exchanges (DEXs) via an SDK and/or widget. LI.FI’s smart contracts have been audited twice (Code4rena — March ’22, Quantstamp — April ‘22), and the team consists of 25 people fully dedicated to the cross-chain space. LI.FI has aggregated 9 bridges across 15 EVM compatible chains, along with all available DEX aggregators & DEXs, on those chains into a single solution.
To learn more about LI.FI, you can:
- Read the SDK ‘quick start’ at docs.li.fi
- Join the official Discord
- Follow them on Twitter & LinkedIn
- Follow them on Telegram
- Subscribe to their Substack Newsletter
or try the any-2-any swaps NOW at transferto.xyz