How to Build an Omnichain Protocol for the Application layer?

Cryptonite Capital
8 min readAug 29, 2022

--

A Closer Look into MAP Protocol and their Omnichain Technology

With the growth in the number of chains, with no clear winner, interoperability has become an increasingly attractive problem to solve. As a result, while being one Web3 community; users, liquidity and dev skills are fragmented and unable to communicate with each other freely. Bridges have enabled communication between chains but with certain trade-offs like security, trust and centralisation. They also require expertise, time and cost to use. Just like in real life where travelling between countries require a passport, foreign currency and airfare, travelling between chains comes with its own rules. We have seen solutions to this outside of bridges in the form of chain ecosystems like like Cosmos, AVAX and Polkadot, but that is targeting chain builders and not applications. Ultimately, it provides more fragmentation and competition for users and devs.

Fast forward to today though, and what we are seeing now is a new type of tech, that is creating interoperability solutions directly targeting applications. The idea is simple but hard to execute. The protocol layer itself is integrated across chains so the applications don’t have to.

Welcome to a world where applications can be built on protocols that allow cross chain interoperability from day one.

The MAP Protocol — For Omnichain Apps

Source: MAP Protocol

MAP was founded in 2019, by a team of technologists and cryptographers. With MAP, there is no oracle, no Multisig/MPC validators, or any other trusted third-party agent. Instead, MAP has built infrastructure that can truly verify each transaction and integrate in a way that allows various chains to communicate securely by using light clients. Light client technology has stood the test of time in the industry and is widely adopted by Ethereum, Cosmos, Polkadot and many other major public chains. Doing this is no small feat and requires deploying light clients on every blockchain that is integrated in MAP ecosystem and the team today is working hard to integrate across all major chains. To illustrate the power of the tech, the team is starting with a heterogenous integration, an EVM to non-EVM link up between Ethereum and NEAR.

Source: MAP Protocol

Deploying Light Clients on Every Chain

For those that do not know what a light client is, if you think of different blockchain as countries, the light client is the country’s customs agent, making sure that goods entering and exiting the country are legitimate. For blockchain, this means the light clients check the data on all the integrated chains, making sure that the data sent across is correct. Light clients in MAP Protocol are responsible for providing the correct block header and checking that a given block header is correct. The validation of block headers for almost all blockchains requires very limited but critical information so that the required information can be stored inside a smart contract and the validation can be expressed in the same contract. In this way, as long as the light client is correctly initialised, then the light client itself would be “smart” enough to validate block headers and correctly update its internal state. In this way, MAP Protocol can achieve “verification finality” for all cross-chain transactions — something that cannot be done by any other cross-chain solutions in the market today.

The MAP Relay Chain Works as the Hub for the Omnichain Network

MAP Protocol also built their own PoS layer 1 called the MAP Relay Chain, where they have extended their own EVM layer with innovative engineering. MAP integrates each chain’s consensus logic, its hashing/signing algorithms, the verification process and many other chain specific data structures. It requires a tremendous amount of work and expertise to understand the consensus and algorithms on each chain. For applications that want to develop cross-chain, especially heterogeneously beyond EVM, this is a significant hurdle from a cost-benefit point of view. MAP does it for you so you don’t have to.

Gas Optimised

Another major hurdle MAP has cleared is the gas cost of operating all the cross-chain communication and verification that needs to happen for you to send generalised information across. When the team finished MAP v1 in 2020, the gas costs were prohibitive. In order to reduce the gas cost in MAP v2, the team embedded different signing algorithms, hashing algorithms, mining algorithms and Merkle proof verifications, in the form of pre-compiled smart contracts into MAP Relay Chain’s EVM layer.

This is no small feat. All in all, they’ve spent almost 4 years getting to this point and they are now getting close to mainnet launch right as the narrative around omnichain is emerging. The MAP team is also conducting R&D on zk-SNARK technology, further optimizing MAP Protocol to toward reducing cross-chain gas fees to a minimum.

The Main Building Blocks

Firstly, we’ll just introduce some easy terminology so the below example of a token transfer can be easily understood. Don’t get intimidated by the diagrams, we’ll be using plain English to explain it all.

The Protocol Layer

Source: MAP Protocol

At the bottom sits the protocol layer, and here you’ll find the MAP Relay Chain, where light clients of each connected target chain are deployed and with MAP’s light client on each connected chain. To have a cross-chain application you essentially need each chain to know what is happening on the other chains, and be sure that that information is valid. On this layer, Maintainers update the status of the light client deployed on the target chain so that the verification network can run smoothly. Light clients have a self-verification mechanism so the light client will not accept invalid block headers submitted by any malicious Maintainer.

The MCS Layer

Source: MAP Protocol

On top of the protocol layer sits the MCS layer, where you’ll find all the data being transfered. Here you find data- and asset vault smart contracts. MAP enables generalised data transfer, which means that you can transfer any kind of information, not just tokens. Any token transfers are stored in vaults and data transfers are stored in ‘Data’. Messengers are an independent inter-chain programs and are incentivised and rewarded to manage transmission of the information, build proofs and prepay gas fees. Anyone can become a Messenger in MAP Protocol. As long as the Messenger is honest while operating between chains, all cross-chain transaction messages of the dApp can be transferred. Malicious attacks by Messengers will not cause any loss of assets and simply result in invalidity of verification on the MAP Protocol Layer. Malicious actors will lose staked tokens.

The Application Layer

Source: MAP Protocol

Lastly there is the application layer, where the applications sit. For ease, applications do not need to deploy their main smart contracts on the MAP Relay Chain in order to access to MAP’s omnichain network. MAP will issue a suite of SDKs for applications to integrate easier. For example, a project called Barter Network is building an omnichain payment solution powered by MAP Protocol. Other teams are building an omnichain wallet, and an omnichain ENS services on MAP right now.

Alice wants to bridge 100 $XYZ token from Ethereum to NEAR — here is the workflow

1. Alice will lock the 100 $XYZ to the MAP on-chain Vault on Ethereum

2. The Vault will emit a lock event.

3. The Messenger listens to the lock event and at the same time extract proof from Ethereum Network, specifically, checking the status of the transaction.

4. The messenger transfers the event message along with the proof to the Vault on MAP Relay Chain.

5. At the moment when Alice’s lock transaction becomes successful, which means there is a new block on Ethereum that contains Alice’s transaction, the Maintainer will notice there is a new block created and update the light client of Ethereum. the Light client of Ethereum on MAP Relay chain now contains the new block header and allows it to prove Alice did lock 100 $XYZ.

6. The Vault on MAP Relay Chain receives the message, verifies it against Ethereum’s light client.

7. If verified successfully, it does a mint and burn.

8. The Messenger between MAP and NEAR listens to the burn event, and extract proof on the MAP Relay Chain.

9. Transfer the message and proof to the Vault on NEAR.

10. The Vault on NEAR verifies the message against the light client on the MAP Relay Chain.

11. If verified successfully, it mints 100 $ nXYZ (minus transaction costs) to Alice’s NEAR address.

The Omnichain Landscape Today

Source: MAP Protocol

The reason we wanted to write this article was to highlight the work the MAP team has been doing to create a truly trustless and open omnichain protocol. Constructing light clients and pre-embedded smart contracts and integrating them across both EVM and non-EVM chains, requires a tremendous amount of work. Meanwhile, MAP Protocol is 100% open source and pursues security finality for cross-chain communication. There are other solutions on the market too, LayerZero for example, however, LayerZero’s basecode is not open sourced and LayerZero relies on both the oracle (Chainlink) and relayer operating independently and properly. While very effective, this design introduces trust and could be vulnerable to collusion risk. Whilst we will also publish on LayerZero, we wanted to start with MAP Protocol as this would be the no short cut way of implementing cross chain interoperability. Ultimately, this speaks to the expertise of the MAP team coming with a deep understanding of cryptography and blockchain.

The future for interoperability can hold many solutions, but it is definitely one of the most important problems out there to solve. It is always worth highlighting important technology like MAP Protocol because it teaches us the fundamental building blocks of blockchain and showcases what kind of architecture is needed to solve one of the most pressing issues in Web3 today.

About MAP Protocol

MAP Protocol provides the omnichain layer of Web3 with absolutely secure cross-chain communication built on light client and zk technology, providing seamless communication between all chains and connecting EVM with non-EVM. Developers can access a full suite of SDKs so their DApps can easily become omnichain applications.

Litebook | Website | Twitter | Medium | Telegram | GitHub | LinkedIn

About Cryptonite Capital

Founded in 2020, Cryptonite Capital exists to invest and support the Web3 companies of the future. Our partner team, draw from over 50 years of combined experience, and have invested in every crypto cycle since 2013. We come from a background of founders, venture capital, macro and technology. Our investors understand the huge opportunities in being early and the unique skillset that it requires. We deploy capital globally across both primary and secondary markets, hunting for the next mass adoption opportunities in Web3. The early bird catches the worm, and we are here to catch the bird. We love the exploring visions with founders and helping them connect the dots on their path to success.

|Twitter|Medium|LinkedIn|Website

--

--