Parachains, Bridge e Sidechain

Advanced
by Andrea Ferrario
16 December 2023

Index

With today's lesson, we will look in detail at these 3 technologies that enable expanded connectivity between blockchains, comparing them and learning about them on a technical level

With today’s lesson, we will look in detail at these 3 technologies that allow for expanded connectivity between blockchains, comparing them and learning about them on a technical level. They are all technologies that allow the transfer of tokens and data between different networks, increasing the interoperability process by leveraging different methods.

In particular, we will see Polkadot and its innovative parachains structure, bridges and their classifications and uses, and finally sidechains, first of all Polygon and its “support network” for Ethereum.

1. The 4 layers of the blockchain

Before looking at the first type of technology, namely the Parachain, we need to be clear about the definition and differences of structural layers precisely because many technologies developed on blockchain have different purposes since they are developed on different layers.

By layers we mean the different structural layers of each blockchain. Each layer has a specific purpose and allows for the inclusion of an additional type of technology, thus allowing the blockchain itself to exist and have particular functionality.

Each blockchain is composed of a set of rules and procedures, called protocols, written at the computer code level. These protocols define blockchain features such as decentralization, security, scalability, usability, ecosystem, and governance.

Let’s look at the different layers in detail:

  • Layer 0: This is nothing more than the base of the blockchain itself, that is, what is needed for it to function: the Internet and hardware. These elements allow the proper functioning of the blockchain and the possibility of adding Layer-1.
  • Layer-1: considered the main layer because it contains the protocols that enable the cryptography and security of the blockchain, as well as the mechanism and architecture of the blockchain. An example is Bitcoin PoW at launch in 2009, still lacking the Lightning Network and thus Layer-2. Another example of this layer is the Ethereum network.
  • Layer-2: the layer that allows specialization of the blockchain by adding off-chain functionality to the basic blockchain created with layer-1. Protocols use layer-2 to increase scalability by transferring some layer-1 interactions to the new layer. This layer can include: smart contracts, transactions and virtual enviroments. The main example of this layer is BTC’s Lightning Network.
  • Layer-3: The third layer represents ‘the front’ of the first two layers. It is a kind of application and graphical interface for the user to operate directly on the blockchain. It is the third layer that creates the so-called use-case for the real world. In fact, it contains the dApps, DAOs and autonomous agents. These 3 elements can be of any type and can ‘communicate’ directly with the blockchain through various protocols embedded within the application. Examples of this layer can be all the DeFi apps such as SushiSwap, PancakeSwap.

Now that we have in mind how the layers of a blockchain are structured, let’s look at the Parachains, specifically introducing Polkadot, which is the first blockchain to use this model for building its network.

2. Polkadot

Definition

Polkadot was created to create a decentralized Internet built on layer-0 where users are in control. It is a multichain protocol that facilitates cross-chain transfer of any information contained on the blockchain.

To make it simple, this type of protocol allows the transfer of not only coins or tokens, as most blockchains do, but also data of all kinds, thus facilitating the introduction of innovative application uses for this type of technology: school databases, government Censuses, private corporate databases, etc.

In fact, Polkadot not only connects public blockchains, but also private ones, creating a true internet of information compatible with all blockchains.

How it works

Polkadot’s network is based on the sharded model.

The sharded model is a type of construction based on the horizontal partitioning of data in a database. Each ‘shard’ is separated from the server by keeping a part of its own data and a part of the main server’s data to facilitate its distribution and load.

Polkadot uses this model for its blockchain. In fact, its blockchain can be seen as a kind of central database, which is the mainchain (called the Relay Chain by the Polkadot team), connected to many smaller shards (called parachains) that all work for the Relay Chain. The parallel nature of the sharded model solves the network scalability problem. This division between relay chains and parachains is essentially a multichain system.

In addition, these parachains build and propose blocks to validators on the Relay Chain, where rigorous security checks are performed on the proposed blocks before they are approved and placed within the final chain. Since the Relay Chain takes care of security, the link between the parachains and the Relay Chain is built by a node called Collators, which has no security protocol to make the network faster.

Polkadot also has bridges within its ecosystem of parachains (which we will see in detail in a moment), which allow transfers between different parachains in an easy and straightforward way.


3. Cross-chain Bridge

Definition

As a second technology we see Cross-chain bridges, or more commonly called bridges.

Bridges are protocols that allow funds to be transferred from one blockchain to another as a kind of bridge. There are a variety of Networks that allow the use of DeFi, but many of them are not compatible with each other due to different rules, protocols and governance. Users, however, simply want to transfer their tokens from one network to another. They therefore rely on bridge systems, usually dapps, that allow this type of transfer.

Operation

The way bridges work is simple: when we want to transfer funds from one blockchain to another, the bridge acts as a conduit between the two so that the funds are withdrawn from our account1 and deposited into our account2.

However, this method is different depending on the type of bridge, in fact it varies if the bridge is centralized or if it is a smart contract.

  • Centralized bridge: we for example want to transfer ethers from the ethereum network to the BSC (Binance Smart Chain) network. To do this, we deposit our ETHs within a liquidity pool in chain1. In chain2 there will be another liquidity pool that will have within it bETHs, which are ETHs that are compatible with the BSC network. A liquidity provider, who will coordinate the transaction, will display the ETHs we place in the first pool and draw from the second pool the same amount, but in bETH, sending us the amount on the second chain.
  • Decentralized bridge (smart contract): the method of the exchange remains almost similar, but the smart contract instead of withdrawing the amount from a pool, blocks our funds on the first chain (making them unusable) and will undermine the same amount of tokens on the second chain. The funds on chain1 will remain blocked until the same amount of tokens on chain2 are burned or blocked for a reverse pass.

Positive aspects of bridges

Bridges are useful for a variety of reasons, the main ones being:

  • DeFi: take the case where we have Ethereums and want to invest them in a staking pool. Curves, DeFi’s main platform on Ethereum offers us a 0.5% APY, which is a very low percentage considering the fees we have to spend on Ethereum for each transaction on the network. We check on another network, say Solana, and notice that on one of its DeFi platforms we find a pool of ETH tokens with an APY of 20%. Obviously the pool on Solana is cheaper, so we use the bridge to transfer ETHs from Ethereum to Solana-compatible ETH tokens so that we can invest our ETHs on Solana’s DeFi platform.
  • Fees: the fees on the Ethereum network, which is currently the most implemented and used network, are very high because the transactions are not yet on the Proof of Stake model, so we often end up paying even $20 commission fees for transactions of $4 to $5. We therefore use a bridge to transfer our eths to the polygon network in order to make eth transactions without spending a capital in fees.

Negative aspects of bridges

  • They are often centralized because smart contracts or other types of programs cannot be used to be able to do these types of transactions as with classic dapps, so they are less secure than decentralized blockchains.
  • They are often slow and some transactions even use days to accomplish as the liquidity pools that centralized bridges use can become empty and we have to wait for a second user to perform a reverse transaction to ours to get what we need on the other chain.

4. Polygon (MATIC)

Finally, let’s look at sidechains, studying in detail Polygon and its infrastructure that can solve Ethereum’s problems by enhancing its network.

MATIC was born in 2017 with the goal of solving ethereum’s two main problems: scalability and network interoperability. Ethereum in fact manages to perform 20 transactions per second, a really low figure compared to other competitors such as Solana (65,000) or XRP (50,000). Regarding interoperability, the ethereum network can only use ERC-20 tokens, all other tokens are not compatible.

MATIC then manages to solve these two problems by using the side-chain and an SDK, a Software Development Kit, which is a kind of layout that allows developers to create blockchains that are interoperable with the MATIC network and thus the Ethereum network.

The side-chain is a semi-independent blockchain built on layer-2 of a main-chain to enhance or speed it up. As for MATIC, its network is divided into two layers:

  • Layer-1 | Polygon Networks Layer: is the network ecosystem of all the blockchains developed through the SDK. Each of them has its own community that produces blocks and creates precisely MATIC’s multi-chain in its entirety.
  • Layer-2 | Execution Layer: this is basically the layer where the EVM (Ethereum Virtual Machine) has been implemented, which allows the proper unfolding of the smart contracts of the various blockchains of the first layer of MATIC on the Ethereum main-chain.

Ethereum itself is already a kind of multi-chain, in fact the EVM is a language that is compatible with over 150 different blockchains. The problem lies precisely in the native scalability of the network, as it ‘clogs up’ the transactions of ETH and all other EVM-developed chains. MATIC therefore offers enhancements to the network to increase its scalability:

  • POS Chain: MATIC’s blockchain based Proof of Stake layer allows more transactions per second, increasing the number up to 65,000 tps;
  • Plasma: is a protocol that allows movements between chains, used to take some transactions off-chain and bring them back on-chain when completed. MATIC leverages this protocol as a Bridge.
  • Rollups: Rollups are nothing more than methods to lighten the Ethereum network by moving transactions from ETH layer-1 to ETH layer-2, then throwing transaction outputs directly back to layer-1. There are two types of Rollups:
  • ZK-Rollups: allow a certain amount of transactions to be stored in blocks of one larger transaction to save transaction fees;
  • Optimistic Rollups: are a tool that run on top of layer and allow anyone to create a block of transactions, with no security or checks.

Polygon’s Layer-2, going back to the interoperability issue, allows you to have several smaller blockchains built with the EVM and then with the ability to communicate with each other, directly with the Ethereum network and the Polygon network. This allows for a true network of blockchains that are compatible with each other for exchange of data, tokens and infinite implementations and dapps.

Author: Andrea Ferrario

Did you like the article?

Share it on social