Full Stack Bridging (Data + Liquidity Layer)

Devain Pal Bansal
Socket Technology
Published in
4 min readJun 16, 2022

The term bridge today is synonymous with any protocol that helps asset transfers across different chains. But that’s not all that a bridge can do! A true bridge is much more powerful & becomes the primary way for generalised message passing as we head to a multi-chain world.

True bridges

TLDR: A true-bridge is a data-bridge!

A true bridge has the ability to send messages across chains allowing to update the state of smart contracts on different chains.

Assets are essentially storage slots on a smart contract & updating these slots allows true bridges to transfer assets across chains. Based on this particular use-case we can call these bridges as asset bridges, the most popular way we know them today!

For example, the amount of DAI you hold is actually just a mapping to the storage slot of an ERC20 smart contract.

Since messages can also be sent as bytes across chains and can be encoded/decoded in any form. True-bridges can thus be used to build other cool use-cases like NFT bridges, governance bridges etc.

How Asset Bridges Are Built on Top of True Bridges

Say Alice wants to send DAI from chain A to chain B:

  • Alice locks the tokens on the bridge contract on chain A
  • This contract uses the native bridge (red arrow) to send a message to the bridge contract on chain B
  • Contract on chain B then mints the wrapped version of the token as a representation of DAI on chain B

Liquidity Networks

Liquidity networks are specialised mechanisms to enable value transfers across chains, with the help of liquidity providers. Liquidity providers act as a third party between 2 chains, by having funds on both chains and sitting in the middle effectively bypassing the true-bridge.

In case of a liquidity network, Alice deposits funds in a Liquidity pool on chain A. But unlike using a true-bridge to send messages, rather there exists an LP that performs the transfer. The LP observes the state on chain A, listens to the event of Alice depositing funds & in response provides DAI on the destination.

As per the user experience, things remain pretty much the same as they deposited some amount on chain A and then got funds on chain B.

How are Liquidity networks dependent on True-Bridges?

In the above image, as users keep bridging through the liquidity network, pool on side A gets a surplus of liquidity while there is lower liquidity on chain B. The LP now has to rebalance the funds across both the pools, this is where the true-bridge comes into play.

LPs use the true-bridges to rebalance the liquidity across chains. The user needs were served by the liquidity network while the true-bridge is used behind the scenes by LPs for final settlement.

Both liquidity networks & true bridges have been around for a while and here are a few examples that you might have used.

Liquidity Networks Vs True Bridges

True bridges suffer blockchain constraints like waiting for confirmations before a block is considered final. They thus generally take longer to send messages across chains to avoid risks like roll-backs.

On the flip side, since LPs are exposed to the risk of roll-backs they charge fees for providing the user access to quick liquidity and generally are faster than true bridges.

Things Bridges are good at, Liquidity Networks are not, and vice versa, so it boils downs to managing these trade-offs.

Beating trade-offs — Modularizing the Stack

The age-old way that the crypto community has found to beat trade-offs is to take a modular approach. Like in the case of Ethereum, the execution layer is separated from the consensus layers and each takes the best approach for their environments.

At Socket, we too believe in designing layers that are great at one thing that they do well and composing them together to create a powerful full-stack suite. By using Socket, protocols thus get the best of both liquidity networks & true bridges to solve any of their multichain problems!

For example, if they want to send data they can use the data layer but something specific like value transfer will automatically be routed from the liquidity layer. The combination of the pros of both the data layer and the liquidity layer allows a developer to beat the pros n cons of any one solution.

For a better understanding of the how True Bridge compare to Liquidity networks,

Refer to Liquidity Networks Vs True Bridges by Vaibhav Chellani

--

--