Parallel Deep Dive 2: Parallel Cross-chain Bridge — A Scalable Cross Consensus Messaging Solution

Adegoke Yusuff
Parallel Finance
Published in
6 min readSep 5, 2022

--

The blockchain industry is a decentralized ecosystem that requires easy interaction and interoperability and since the advent of Bitcoin, there has been an increase in the number of blockchain networks and protocols with varying use cases and designs. As the industry grows, there have been constraints around data exchange and communication between these networks leading to interoperability and composability restrictions as well as lower adoption rates. This is because functionalities developed on one network only work on that network.

Cross-chain bridges have been developed to work around these restrictions to allow for easy flow/exchange of data from one network to another while also increasing the adoption rate. With cross-chain compatibility becoming increasingly popular because it enables connectivity and scalability, it’s clear that interoperability is the future. In this article, we’ll take a deep dive into Parallel Cross-chain Bridge and how it enables cross-chain communication, data sharing, and asset transfer.

A Look at Parallel Cross-Chain Bridge and its Architecture

Overall, a cross-chain bridge serves as a neutral zone that enables users to deploy assets for fast and easy transactions irrespective of blockchain and reduces operational difficulties by allowing access to multiple blockchains through the same network. The Parallel Cross-chain bridge works the same way and all its components are built in a standardized fashion to help unlock the superior liquidity in the DOTSAMA ecosystem.

The cross-chain bridge was initially launched on Parallel Finance’s sister network, Heiko to allow asset movement between Kusama and Heiko network before the same was launched on the Polkadot network (one of the first cross-chain bridges on the Polkadot network).

The Cross-Chain Bridge uses the native cross-consensus messaging (XCM) format of the Polkadot network. This format helps eliminate communication barriers between the interacting networks and provides provable finality so that users can easily send assets from other chains to Parallel to utilize the platform for higher yields to meet their investment goals. This guide will walk you through how to use the Cross-chain bridge.

To fully understand how the bridge works, we need to explain what a cross-consensus messaging (XCM) format is. This will help us understand its importance in parsing information across different chains and ensuring interoperability across different protocols.

Cross Consensus Messaging (XCM) Format

As explained in one of our earlier releases, XCM refers to Cross-Chain Messaging Format that has evolved to become a robust architectural style of message transfer for more than chains but also pallets, smart contracts, bridges, and sharded enclaves.

XCM is not a protocol. As such, it cannot parse messages across consensus by itself. Rather, it is a format for how message transfer should be performed and a language for ideas between consensus systems. Polkadot’s architecture allows the interoperability of parachains, enabling the cross-chain transfer of assets and data. To achieve this, an XCM format defines the language around how the message between the two chains should be parsed.

The XCM has different transport protocols, all of which are integrated into Parallel Cross-chain bridge to act on XCM formats. They include:

  • VMP (Vertical Message Passing): VMP protocol is responsible for message transfer between relaychains and parachains, and it is further divided into two:

— UPM (Upward Message Passing): This allows parachains like Parallel to send messages to their relaychain (Polkadot).

— DMP (Downward Message Passing): It allows relaychains, e.g., Polkadot, to pass messages down to their parachains, e.g., Para.

Parallel Cross-chain Bridge Pallet Parts

As earlier implied, the cross-chain bridge is not a new product of the Parallel Finance protocol. The pallet is a combination of different parts that work together to carry out the primary purpose of asset teleporting between chains with quick finality.

The Parallel Cross-chain Bridge pallet XCM execution process is mainly divided into:

Bridge pallet links to an instance of pallet membership similarly to this:

In the Bridge Pallet, Bridge Members have the following permissions.

  • Create proposal, Vote for proposal
  • Set vote threshold
  • Set the fee for a specific currency
  • Register a new chain
  • Register a new bridge token

Therefore, the account that the Relayer should hold must also be a BridgeMember, otherwise, it will not be able to create a Proposal or vote for it.

Management of Multi-chains and Multi-assets (Bridge Configuration)

Register multi-chains

From a Parachain perspective, only chains that have been Registered can support cross-chains. We record the chain number with type ChainId = u32 and there is a ChainNonces on the storage that records the supported chains and their corresponding transaction nonce. Implemented as follow:

pub type BridgeTokens<T: Config> =

StorageMap<_, Twox64Concat, AssetIdOf<T>, BridgeToken, ValueQuery>;

ID and External

Each BridgeToken has a unique AssetId corresponding to it on the parachain and has its own application scenario.

  • Scenario 1: Parachain acts as the source chain when cross-chaining, token is locked/unlocked using Assets.transfer
  • Scenario 2: Parachain acts as the target chain when cross-chaining, and the token is Burned/Minted using Assets.burn_from / Assets.mint_into

Bridge Configuration

Before a transfer can take place, the Originating Contract defines the following:

  1. The Relaychain address of the paired Destination Contract
  2. The Relaychain name
  3. The Consensus Threshold (how many DSP must respond with matching oracle results for a value to be considered valid).

Please note: In order for a token to be able to shuttle in between Polkadot and Parallel, there must be corresponding token contracts deployed on both sides (i.e. Originating Contract on the Polkadot side and Destination Contract on the Parallel side, and vice versa).

Teleport and Materialize

Asset Teleporting refers to the movement of an asset from one chain to another, e.g Polkadot to Parallel, by destroying the amount being transferred in the origin chain and creating a clone (same amount as destroyed) on the target chain. This is similar to how Parallel Cross-Chain Bridge operates. It creates a clone of the DOT from the relaychain (same amount and value) as a BridgeToken on Parallel and destroys that amount from the relaychain to be utilizable by the user on Parallel.

Conclusion

Existing cross-chain solutions have been faced with different problems, from transaction-based ones to trust disparity between communicating chains. These potential technical issues hinder large-scale blockchain interoperability by blocking a single chain’s throughput capacity when it receives transactions from many chains. These bottlenecks have been resolved with the Parallel Bridge solution. The seamless interoperability that the Parallel Cross-chain bridge facilitates between chains makes it one of the most direct implementations of XCM. It allows users to bring their assets on Parallel and utilize them on its Dapp suite, ensuring access to a broader money market and the opportunity to increase the utilization rate of their assets to earn additional yield.

--

--

Adegoke Yusuff
Parallel Finance

Ade is an expert Web3 writer with deep expertise and experience in Blockchain and Decentralized use cases — DeFi, NFT, GameFi, P2E, Identity Management, etc.