logo academy

Blockchain Bridges: Interoperability in DeFi

October 18, 2021
8 min
Blockchain Bridges: Interoperability in DeFi
Beginner
You will learn

    Interoperability is the ability for two or more blockchains to exchange information and value. DeFi (and non-DeFi) blockchains are developing solutions to bridge this gap in order to promote collaboration to accelerate blockchain adoption.

    Why do blockchains need to be interoperable?

    Today there are more than 100 blockchains. Imagine if none of these blockchains could dialogue with the other: the possibilities of use would be very limited.

    It would be like not being able to send an email from Gmail to Outlook, or a bank transfer from one bank to another. 

    If you can’t for example exchange bitcoin for Ether without going through a centralised exchange, DeFi has a problem, because you reduce the use cases of so many protocols and dapps. If there are few use cases, there will be low adoption.

    We often talk about blockchain applications to the supply chain in different sectors. A supply chain is made up of a number of companies, institutions, manufacturers that work together and depend on each other. However, each company will have different customers or suppliers, and not all of them will implement the same blockchain to support the management of their data.

    This is why it is essential that each blockchain develops the functionality to support interoperability, with as high a level of compatibility and flexibility as possible.

    Le soluzioni di interoperabilità: i bridge

    The main solution is the so-called bridge, which is a system that transfers information between two blockchains belonging to different ecosystems.

    At the time of writing, there are about 40 bridge projects out of 100 active blockchains.

    We can divide them into 4 categories, based on their purpose:

    • Asset-specific: these bridges are created solely to allow the use of a cryptocurrency on external blockchains. This is why they are the easiest to implement, but also the most limited in development and functionality.
      These are the bridges that use wrapped tokens, i.e. tokens ‘wrapped’ in the standard of the target blockchain.
      Bitcoin is the most wrapped cryptocurrency of all, with 7 bridges on Ethereum alone.
    • Chain-specific: a bridge between two blockchains dedicated to basic operations such as locking or unlocking tokens on the source blockchain and creating wrapped tokens on the target blockchain. They are practical, but not very scalable. 
      Example: PoS bridge between Polygon and Ethereum, where Polygon is a Layer 2 chain on Ethereum.
    • Application-specific: an application that allows access to two or more blockchains for the sole purpose of running the application. 
      For example, Compound is a lending protocol that is based on Ethereum, but has developed Compound Chain, which is a separate blockchain from Ethereum dedicated solely to cross-chain lending. In this sense, it acts as a bridge. 
      Or again TEZEX, the decentralised exchange that enables the exchange between tokens based on Tezos and Ethereum, acting as a bridge between these blockchains.
    • Generalised: a protocol specifically designed for transferring information across multiple blockchains. A single integration gives a project access to the entire ecosystem connected to the bridge, thus causing a network effect, i.e. increased adoption of the project due to the breadth of the user network that the bridge enables.

      The risk here is that projects sacrifice security and decentralisation to maximise this scaling effect, with possible undesirable effects on the ecosystem. An example of a “generalised” bridge is IBC, currently used for communication between Ethereum and Cosmos, or Chainlink, a blockchain known to support any other blockchain.

    How bridges work

    Before delving into how a bridge works, let’s clarify a few computer science terms. Don’t worry, there are only three:

    1. State:The current state or last known condition of a process, transaction or setting. “Maintaining state” or “managing state” means keeping track of the process.  
    2. Event: When something happens that triggers the execution of code. In apps, events that happen are usually the result of a user action. For example, a user’s click on a button.
    3. Relay: transmission of information between one system and another.

    Let’s apply these terms to the blockchain. 

    State in the blockchain is very important because it is what each node needs to know and have saved on its computer to verify transactions in a decentralised way.

    Events, on the other hand, mostly concern smart contracts, which are a good example of software that requires certain conditions to occur through an Event in order to trigger the intended transactions.

    The term “relay” is used in several fields, as something that mediates information between two entities. In the blockchain, you may have heard it regarding Polkadot, whose central blockchain, called the Relay Chain, is precisely dedicated to the transmission of information between one Parachain and another.

    From a technical point of view, a bridge requires several elements: 

    • Monitoring – by a validator or oracle that checks the state of the initial blockchain. 
    • Messages or relays – sent by the actor monitoring the blockchain, when it detects an event that requires transmission to the external blockchain.
    • Cryptographic signature – required when sending a message to an external blockchain
    • Consensus – required on some blockchains before sending a message

    These elements can be found in the 3 main bridge solutions:

    External validators & Federations

    In this scenario, there is a group of validators that monitor a dedicated address on the source blockchain. Once a consensus is reached, it performs an action on the destination blockchain. 

    For example, a cryptocurrency transfer, which is usually performed by blocking the token in the source address and minting its equivalent on the target blockchain. 

    This is the model used by most bridges today, including those in the Ethereum ecosystem, but also Chainlink, Avalanche, Harmony, Thorchain and Binance.

    Light clients & Relays

    To trigger events on other blockchains, those who monitor the source blockchain generate evidence of past events. They relay this cryptographic evidence to ‘light clients’, i.e. smart contracts on the target blockchain.

    This method is quite secure, but very expensive because it requires developing smart contracts for each destination and executing them by spending gas.

    Rainbow, Optics, IBC, Gravity, Interlay and Polkadot bridges adopt this system.

    Liquidity networks

    Questa soluzione implica l’esistenza di un nodo su ogni blockchain che contiene una riserva di criptovalute native dell’una e dell’altra blockchain.

    Queste due pool di liquidità si scambiano i rispettivi token a bassi costi, facilitando anche le transazioni con alti importi. Oltretutto, le criptovalute scambiate sono nella loro forma originaria, e quindi più fungibili di derivati come i wrapped token.

    The liquidity network way is not yet widely used. Some examples in our infographic are Connext and Liquality.

    Which bridge offers the best interoperability?

    These three models are not compartmentalised, and hybrid solutions do exist. Identifying them, however, allows us to understand the strengths and weaknesses of each, to clarify the state of the art and the prospects for the development of bridges.

    We can evaluate bridge models in terms of security, speed, connectivity (number of supported blockchains), capital efficiency (cost) and statefulness.

    Statefulness refers to the ability to transfer complex states, particular tokens or execute smart contracts between two blockchains.

    blockchain interoperability

    Interoperable blockchains in DeFi

    The most established blockchains that also have interoperability solutions are Ethereum, Polkadot and Cosmos.

    Ethereum is different because it was not specifically created to be interoperable, but simply as programmable as possible. Because of its programmability, it made possible the development of the first Layer 2 blockchains, focused on scalability and interoperability. In the picture we see them in a clockwise direction: Polygon, Optimism, Arbitrum, starkware, zkSync.

    Polkadot, on the other hand, was born with a cross-chain perspective, already including bridges in its whitepaper. Polkadot is an ecosystem of different blockchains, each built for diverse purposes and applications, that are able to communicate and interact easily.

    Cosmos is similar to Polkadot, but with the Stargate update, it has implemented the already mentioned Inter-Blockchain Communication (IBC) protocol. If all blockchains built with Cosmos code upgrade to Stargate, they will be able to increase their level of interoperability not only within the Cosmos ecosystem, but also with Bitcoin or Ethereum.

    Related