Router Protocol
Router Protocol offers two frameworks for cross-chain interactions:
- Router CrossTalk: Enables stateless and stateful cross-chain messaging
- Router Nitro: Facilitates native cross-chain asset transfers
For guidance on choosing the appropriate framework, refer to Router's guide.
This documentation focuses on Router CrossTalk. If you're primarily interested in asset transfers, please consult the Router Nitro documentation.
Router CrossTalk
Router CrossTalk is designed to enable cross-chain interactions, allowing developers to create decentralized applications (dApps) that operate across multiple blockchain networks. This framework supports both stateless and stateful operations, providing flexible and efficient communication between contracts on different chains.
Architecture
High-level architecture diagram for Router CrossTalk1
The CrossTalk infrastructure consists of three main components:
- Gateway contracts on source and destination chains
- Orchestrators on the Router chain
- Relayers that forward messages to the Router Gateway contracts
The process flow is as follows:
- The dApp contract calls the iSend function on the source chain's Gateway contract.
- Orchestrators monitor events emitted by the Gateway contract.
- A Relayer picks up the transaction signed by the orchestrator and forwards the message to the destination chain's Router Gateway contract.
- Gateway contract on the destination chain calls the dApp contract's
iReceive
function. - For acknowledgment, the process is reversed, and the Relayer calls the
iAck
function on the dApp contract on the source chain.
Fees
Fees in the cross-chain messaging process are paid by two parties:
- The dApp user pays when initiating the transaction on the source chain.
- The dApp fee payer pre-pays the Relayers for calling the Router Gateway contract.
To ensure the correct fee payer is used, the dApp's contract must register the fee payer address as metadata with the Router Gateway. Additionally, the fee payer needs to approve the conntract on the Router chain, which can be done through the Router Explorer.
For more info about the fee management, consult the Router documentation.
Examples
Explore our PingPong example to see Router CrossTalk in action.
For more examples, refer to the Router Protocol documentation:
and in the Router Protocol CrossTalk sample repository.
Footnotes
-
The CrossTalk high-level architecture diagram is courtesy of Router documentation. ↩