Cross-layer Interoperability: The Future Of Interconnected Layer 2 Ecosystem

Written by haroonbaig | Published 2021/07/03
Tech Story Tags: cryptocurrency | composable-finance | connext | hop-protocol | hyphen | defi | layer2 | decentralized-internet

TLDR Layer-2 scaling solutions were proposed to help solve the prevalent scalability problem and increase the throughput of the underlying Layer-1 platforms. The current market state of the L2 solutions is very fragmented, but they all differ in terms of their technology and approach. Some of the notable projects using ZK-rollups include Loopring, Aztec 2.0, Matter Labs zkSync, Starkware. In Validium, the data is stored off-chain, which increases transaction throughput and efficiency.via the TL;DR App

Bitcoin laid the foundation of a decentralized and peer-to-peer digital asset, aiming to fix the broken international monetary system with a unique economic security model that is borderless, trustless, and censorship-resistant. 
Ethereum brought much-needed flexibility and extensibility to the space by introducing a Turing-complete 'programmable blockchain' platform that can run decentralized applications. 
As platforms like Bitcoin and Ethereum started to gain traction, the limitations started surfacing, sparking a debate around scalability issues. Ethereum got affected the most because the bulk of the activity has always been happening on Ethereum, from the ICO boom back in 2017, and now the Defi era that started in late 2018. 
Layer-2 solutions were proposed to help solve the prevalent scalability problem and increase the throughput of the underlying Layer-1 platforms. The earliest examples of Layer-2 solutions are Bitcoin Lightning Network that uses state channels, and Ethereum Plasma, an off-chain scaling solution for Ethereum. 
This article discusses the advantages and drawbacks of Layer-2 scaling solutions and how Composable helps unite the Layer-2 platforms with its unique approach towards establishing cross-chain and cross-layer interoperability.

Current State Of The Layer-2 Scaling Solutions 

Layer-2 (L2) scaling solutions refer to the protocols built on top of the underlying blockchain platform (L1) to increase throughput, lower operating costs (transaction fees), and enhance the overall efficiency of the system. 
Sidechains are often correlated with L2 solutions, even though they are widely different because L2 solutions inherit consensus security from L1 chains, whereas sidechains work independently and have their own consensus security and finality. 
The current market state of the L2 solutions is very fragmented. Although L2 solutions serve the same purpose, they all differ in terms of their technology and approach. If we were to segment all the L2 solutions available today based on their technology, we would see five different categories. 
Optimistic Rollups 
Optimistic Rollups (ORUs) is a kind of L2 construction that leverages the Optimistic Virtual Machine (OVM) to run smart contracts in L2, secured by the L1 chain. ORUs are fraud-proof, and they rely on aggregators that deploy smart contracts, accumulate large amounts of transactions in a 'rollup block', and publish them on the L1 chain in bundles. 
Some of the notable projects using Optimistic rollups include Off-chain Labs Arbitrum rollup, Fuel Network, Optimism. 
ZK Rollups
ZK-rollups (Zero-knowledge rollups) is a kind of L2 construction that runs off-chain computations and bundles transactions in 'roll up' blocks. It then generates a SNARK cryptographic proof called the 'validity proof', which is later posted on the L1 chain.
ZK-rollups only require validity proof instead of all the transaction data, which means blocks are validated much quicker and cheaper. It also provides faster finality time because the state is instantly verified once the validity proof is sent to the L1 chain. 
Some of the notable projects using ZK-rollup include Loopring, Aztec 2.0, Matter Labs zkSync, Starkware. 
Validium
Validium is very similar to ZK-rollups as both generate zero-knowledge proofs that are sent to the L1 chain for settlement and finality. The only difference is that in ZK-rollups, the data is stored on-chain, while in Validium, the data is stored off-chain, which increases transaction throughput and system efficiency. 
Some of the notable projects using Validium include Matter Labs zkPorter and Starkware.
Plasma
Plasma is an L2 construction that was proposed by Vitalik Buterin himself, along with his team members. It involves non-custodial chains called 'child chains' that are created with the use of smart contracts and Merkle trees. These child chains offload a lot of the data and computation from the L1 chain, increasing system efficiency and transaction throughput. 
All the communication between the child chains and the L1 chain is secured by fraud proofs. Some of the notable projects using Plasma include Polygon (Matic), Leap DAO, Gazelle, OMG Network. 
State Channels
The idea of state channels was derived from payment channels that existed for quite a while now with the Lightning Network. State channels is an L2 construction where the arbitrary state transitions happen off-chain, involving not just payments but transactions and off-chain computation. Some of the notable projects using State Channels include Perun, Raiden, Connext. 

The problem - Lack of composability and interoperability

There is one single advantage of L2 solutions; they solve the scalability problem at a considerable rate without compromising the security as they all rely on the consensus security of the underlying L1 protocols. They allow you to perform near-instantaneous transactions with much lower fees while reducing the network congestion on the L1 chain. 
However, L2 protocols introduce a new set of problems that makes it harder for average users and Defi developers to make a shift towards them. The technology behind these L2 protocols is incredible, but using them is not a piece of cake as there is a much higher degree of complexity surrounding them. Let's discuss each of these problems and how they hinder the growth of the overall L2 ecosystem. 
Fragmented Market
The L2 protocols we see today work in silos, and the entire industry is disjointed and disparate. L1 protocols suffer the same fragmentation problem, but a lot of work has been done to bridge these protocols and establish cross-chain communication and interoperability. 
If we look at the top Defi ecosystem players on Ethereum, each one of them is planning to migrate to a different L2 solution, creating more fragmentation into the ecosystem.
  • Uniswap is planning to use Arbitrum for its v3. 
  • Curve is migrating to zkSync. 
  • Aave is migrating to Polygon (Matic).
None of these L2 solutions dominate the market, creating a fragmented ecosystem for both users and Defi developers. Defi developers want to remain competitive by utilizing cross-chain and cross-layer protocols to build applications, but the fragmented ecosystem makes them time-inefficient, resource-intensive, and vulnerable to attacks. 
Lack Of Composability 
If there is one thing that has changed the face of the internet, it's composability in the ecosystem. In the blockchain and Defi context, composability refers to a model where developers can combine pieces of different protocols together to build their decentralized applications. Think of it like lego bricks, which you can combine in infinite ways to build interesting things. 
Lack of composability is a serious problem in both the L1 and L2 ecosystems, especially among the L2 protocols where there is still no concept of cross-layer communication and interaction. We do have some degree of cross-chain composability among the L1 protocols through bridges and wrapped assets, but they are very constrained when it comes to actually building applications on top of them. 
This lack of composability results in a fragmented ecosystem and poor user experience for both developers and users. 
Lack Of Cross-layer (L2/L2) Interoperability
As of today, no protocol facilitates moving between different L2 applications. Moving between L2 applications requires you to move back to the L1 chain first, which is highly insufficient due to long lockup periods (up to a few weeks) and a lot of fragmentation. 
Due to this lack of cross-layer (L2/L2) interoperability, applications on one L2 network can't communicate with the applications on another L2 network, resulting in siloed infrastructures and increased complexity.

Cross-Layer Interoperability Solutions 

Composable Finance

Composable Finance is building a cross-chain and cross-layer interoperable infrastructure for the interconnected blockchain ecosystem of the future, by tapping into the $57.42 billion Defi economy. 
Composable will be the first protocol to exhibit cross-layer (L2/L2) interoperability that will allow assets to move between different L2 protocols without going back to the L1 chain first. 
Composable Finance has two development phases. In the first phase, they are focusing on multi-layer (L2/L2) interoperability, bridging the gap between different Ethereum Layer 2 implementations and sidechains. In the second phase, they will launch a Parachain on Polkadot, which will enable cross-chain interoperability by allowing smart contracts from different Layer 1 blockchains to run on a unified execution environment on Composable’s Polkadot parachain.
Users can seamlessly move assets between various chains and layers, and the developers get a cross-chain and cross-layer framework with higher degree of interoperability that abstracts away all the complexity. 
Ethereum Cross-layer Asset Swaps
If you want to bring an asset from one L2 to another, the process is fairly complicated and requires moving back to the L1 chain that can take up to 2 weeks. Let’s take Uniswap v3 deployed on Arbitrum L2, and Curve deployed on zkSync L2. If you want to move an asset from Arbitrum to zkSync, you will need to move the asset from Arbitrum to L1 (Ethereum), and then move it to zkSync. This process can take up to one week due to long lock-up periods.   
With Composable multi-layer solution, you can avoid these long lock-up periods of moving back to the L1 chain and instead, bring the assets directly from the L2, e.g., bringing assets from Uniswap (Arbitrum) directly to Curve (zkSync). 
Interoperability with Polkadot
Polkadot provides interoperability with other chains via bridges. However, this interoperability isn’t universal and only supports those chains that Polkadot bridges to. Composable Finance Parachain will be a polyglot assembly machine that will merge various existing infrastructures like the Ethereum Virtual Machine (EVM), Tezos, ink!, and Solana's eBPF, to run any compiled smart contract in the same place and allow them to talk to each other on the same chain.
To secure a parachain slot, Composable Finance team has recently launched their novel ‘Vault Strategy’ that allows for the participation in their Parachain auction with ETH or any ERC-20 token asset, rather than purchasing KSM/DOT and locking them up.  
Users will deposit their ETH in an unlocked multisig vault and get a receipt token (parachain Auction Tokens or pAT), which can be further used to mint their multi-layer stablecoin, the Equal Cash (EQLC). 

Connext

Connext is a cross-chain liquidity network that powers fast, fully noncustodial swaps between EVM-compatible chains and Ethereum L2 networks. At its core, Connext is a network of liquidity pools on different chains. Users swap value between these pools, similar to AMM DEXes like Uniswap.
Connext is a fully featured generalized state channel protocol. The entire system relies on routers (the liquidity providers) that provide liquidity for user swaps and earn fees in return. This model is similar to the DEXes like Uniswap or PancakeSwap, where users provide liquidity and earn LP rewards according to their share of the pool. 
On a higher level, this is how a process of L2-L2 asset transfer looks like in Connext: 
  • User A transfers his asset A to user B
  • User B is a liquidity provider (a router) that send the equivalent amount of asset B to user A
  • Both of these transactions were conditional transfers, and at the end, both User A and User B unlock their conditional transfers to receive their assets
Unlike Composable Finance, Connext is very simple and fairly limited. It relies on liquidity pools and liquidity providers (routers) just like a DEX. You can swap a token only if the routers are providing liquidity for it. If there are no routers providing liquidity for your token, you won’t be able to perform a swap. 
Connext does not have a token at this time. It is geared towards developers who can build applications like DEXs on top of Connext, or they can provide liquidity to the network by running Connext routers. It currently supports all the EVM-compatible chains and L2 networks, and works out of the box with any erc20 token.
The Connext mainnet bridge and tech is live at xPollinate where you can test out different features, or become a router and earn fees based on your share of the liquidity pool. Another great thing about Connext is that it's fully non-custodial, and neither Connext, nor any projects building on Connext have custody over a user's funds.

Hop Protocol

Hop is a protocol for sending tokens across rollups and their shared Layer 1 network in a quick and trustless manner. Rollups have the potential to scale the Ethereum network, but each rollup creates a siloed environment for its applications.
Moving assets between rollups and the Layer 1 network is slow and expensive, diminishing the savings users gain by using the rollup. The Hop protocol allows assets to be moved directly from rollup to rollup, providing cost savings and enabling cross-rollup composability of applications.
The Hop protocol provides a scalable rollup-to-rollup General Token Bridge that allows users to convert between Layer 1 tokens and their canonical Layer 2 representations, not just create a new representation of the Layer 1 token on the rollup. The General Token Bridge uses a two-pronged approach:
  1. Create a cross-network bridge token that can be quickly and economically moved from rollup to rollup or claimed on layer-1 for its underlying asset.
  2. Use Automated Market Makers to swap between each bridge token and its corresponding Canonical Tokens on each rollup in order to dynamically price liquidity and incentivize the rebalancing of liquidity across the network.
Hop Bridge Tokens (e.g., ‘Hop ETH’, ‘Hop DAI’ with symbols ‘hETH’, ‘hDAI’ respectively) are specialized Layer 2 tokens that can be transferred rollup-to-rollup in batches and act as intermediary assets in the Hop protocol. Each Hop Bridge Token represents a deposit in the Layer 1 Hop Bridge contract. For example, if 4 ETH are deposited into the Layer 1 Hop Bridge contract, 4 Hop ETH can be minted from a layer-2 Hop Bridge contract. 
Inversely, a Hop Bridge token can be redeemed for its underlying asset on Layer 1, which burns the Hop Bridge Token being redeemed on Layer 2. When a Hop Bridge Token is transferred from rollup to rollup, it is burned on the origin rollup and minted on the destination rollup. 
With both the Hop Bridge Token and Automated Market Makers on each rollup to swap between the Hop Bridge Token and the Canonical Token, users can quickly and easily convert from one rollup’s Canonical Token to the next. 
Rollup-to-rollup transfers through the Hop protocol are highly scalable because individual transfers do not require any Layer 1 transactions. Consider the following scenario where Alice has Rollup A Canonical ETH and wants Rollup B Canonical ETH:
For convenience, Alice can also make her cross-rollup transfer by making a single transaction. She makes a call to the Hop Bridge, which performs a swap from Rollup A Canonical ETH to Hop ETH for Alice using the AMM and then sends the Hop ETH to its destination. This time, the Transfer is sent with instructions to automatically swap Hop ETH for Rollup B Canonical ETH at the destination. 

Hyphen

Hyphen is another protocol aiming to bring cross-chain liquidity by solving the pain points of getting your assets from Layer 2 back to Layer 1. It uses the same model of liquidity providers, where the protocol maintains token liquidity on both sides of the chains and instantly transferring tokens on the second chain after accepting tokens on the first chain. 
Hyphen also rebalances the liquidity automatically if there's too much one sided transfers. Just like a traditional DEX, If Alice wants to transfer tokens across chains then she'll be charged a 0.3% fee which goes directly to the Liquidity Providers. Also, the transfer transaction fee is also deducted from the tokens being transferred in the same currency. 
Hyphen is a product of Biconomy, and they have deployed LiquidityPoolManger contracts on all supported chains where all Liquidity will be stored. Executor Nodes are off-chain servers that are constantly monitoring these smart contracts for any incoming deposit transactions. 
The LiquidityProvider fee and transfer transaction fee is deducted on-chain on LiquidityPoolManager smart contract only. Hyphen also supports automated re-balancing. The re-balancing scripts are run to find if there is less liquidity on a particular chain, then it triggers re-balancing operations and funds are transferred from other chains to balance the liquidity via corresponding native bridges.

Conclusion

Cross-chain and cross-layer interoperability is undoubtedly the future of the interconnected blockchain ecosystem. These new players in the cross-layer ecosystem will reduce the complexity and fragmentation for developers by allowing them to benefit from multiple L1 chains and L2 protocols, and build multi-layered applications that was never possible before, with better user experience for the end users. 
Over and out! 👋
Haroon

Written by haroonbaig | 👋 I write fluff-free & engaging content in crypto space, ECDSA to zk-SNARKs, Bitcoin to Polkadot, DeFi to NFTs 👨‍💻
Published by HackerNoon on 2021/07/03