Gateway Contracts: A Key Enabler of Cross-Chain Action on the Router Chain

Router Protocol
4 min readMar 16, 2023

--

As a pioneer in cross-chain projects, Router Protocol is building a secure, scalable, modular, and composable framework for cross-blockchain interoperability. Router Chain is a Layer 1 blockchain being built using Cosmos’ Tendermint Consensus. Cross-chain dApps built using Router Chain can, by default, interact with any blockchain ecosystem without the need for a bridge, thereby tapping into the benefits of each blockchain.

The key to the success of our ecosystem lies in our architecture, which enables secure and decentralised interactions between contracts on different chains. Besides, one of the vital architectural components that facilitate this seamless flow of communication between blockchains is the Gateway Contracts. In this blog, we will provide a brief overview of Gateway Contracts and their crucial role in ensuring the interoperability of various blockchain platforms.

A Closer Look at Gateway Contracts

The name “Gateway” is derived from the fact that these contracts act as an entry point or gateway for cross-chain transactions. They enable the secure and decentralised exchange of data and assets between different blockchain platforms, providing a seamless and efficient cross-chain experience.

By establishing a reliable connection between blockchains, Gateway contracts make it possible for users to leverage the unique features and capabilities of each blockchain, ultimately enhancing the overall functionality of the blockchain ecosystem.

The Key Functions of Gateway Contracts

Gateway contracts serve as the interface for the application contracts on any chain to interact with contracts on other chains. Gateway contracts are responsible for facilitating the request and response flow between different chains.

Gateway is used to do a lot of things, including -

  • Sending inbound transactions to the Router Chain
  • Receiving outbound transactions
  • Crosstalk requests processing

Let’s take a look at these functionalities

Gateway Contracts in Inbound Module

Inbound Workflow

After a user initiates a cross-chain action on an application contract on the source chain, the application contract calls up a function on the Gateway Contacts with the relevant parameters. Post that, the Gateway contract on the source chain emits an event that is listened to by the orchestrators and finally sends it to the Router Chain for further processing.

Gateway Contracts in Outbound Module

Outbound Workflow
Outbound Workflow

On the Router chain, after generating an outbound request, the bridging contract passes the request to the Outbound Module. Then, Outbound Module collects all the signatures from the Orchestrators (to validate it) and after receiving the majority votes — The Relayer picks up the transaction and forwards the event to the Router Gateway contract on the destination chain.

To ensure that the data forwarded by the relayer is not tampered with, the Gateway contract on the destination chain calls a function, which decodes the signed call data to verify the validator signatures. Then, Gateway Contracts call the function (in which the logic is written) of the Application Contract, and accordingly, the Application Contract takes the appropriate actions based on the data transferred.

Gateway Contracts in CrossTalk Workflow

CrossTalk Workflow

Router’s CrossTalk library abstracts Router’s infrastructure to allow contracts on one chain to communicate with contracts deployed on some other chain. The library is structured in a way that it can be integrated seamlessly into a development environment to allow for cross-chain message passing without disturbing other parts of the product.

Here, Router’s Gateway contracts help an application to initiate a CrossTalk Request on the source chain with some parameters, and once the source chain transaction is successful, the Gateway contract emits an event for the same.

Conclusion

The Gateway Contract is a fundamental component of the Router Chain’s architecture. It enables interoperability between different blockchain networks and manages the network’s cross-chain communication. In the inbound module, the Gateway Contract sends the event to the Router Chain for further processing while in the outbound module, it ensures that transactions comply with the rules of the destination network. The Gateway Contract is a testament to the Router Chain’s commitment to providing fast, secure, and reliable cross-chain transactions.

Announcement -

We have announced the launch of the Devnet for Router Chain, now accessible at https://v2.routerprotocol.com/. As a blockchain project focused on solving the challenges of cross-chain communication and promoting seamless interoperability between diverse blockchain networks, the release of our Devnet marks a major milestone in realising this vision. With this launch, we invite developers, partners, and enthusiasts to explore and test the features of Router Chain, providing valuable feedback that will help us refine our platform and bring us closer to achieving our goal.

Lastly, do check our previous blogs for an in-depth explanation of our architecture, showcasing the underlying technology that powers our platform here -

Episode 1: Understanding Router Chain: An Overview of its Architectural Key Components

Keep us close at hand by following us on your preferred social media platform!

Website | Twitter | Telegram | Telegram announcements | Discord

--

--

Router Protocol

Router Protocol is a secure, composable, and modular framework for building interoperable applications. More at https://routerprotocol.com