Skip to main content

Bridging Messages

Introduction

⚠️ This feature is still under development and might be changed in the future

The message bridge is a smart contract-based mechanism that enables the seamless transfer of messages from one chain to another.

Even when it allows message transfers between chains, it operates differently to the ERC20 and ERC721 routers. In order to transfer messages it is necessary to directly interact with the Bridge teleport message in the source chain.

The message dApp on the destination chain will implement the 'onTeleportMessage', sending an encoded payload to the target smart contract, which will procces and execute the wrapped command.

How to bridge Messages

In order to bridge messages from a source chain to a target chain, we use the transmit function of the teleport smart contract:

function transmit(
uint8 targetChainId_,
bytes calldata transmissionReceiver_,
bytes32 dAppId_,
bytes calldata payload_
) external payable
targetChainId_The chainID where the message should be delivered to
transmissionReceiver_The address of the contract in the target chain to receive the transmission
dAppId_ID for the dApp that the message belongs to
payload_The dApp-specific message data