Dataflow
Learn the complete flow of a Cross-Chain message.
These can be described as follows:
- Cross-Chain dApp initiating the message calls the Teleporter Contract
- The Teleporter contracts interacts with the AWM precompile of the EVM
- An AWM Relayer relays the message to the destination Chain. It periodically checks the source Subnet for outgoing messages and delivers these by calling the Teleporter contract on the destination Subnet
- The Teleporter contract on the destination chain interacts with AWM to verify the signature the message and whether it has been signed by a sufficiently large stake share of the source Subnet's validator set.
- The Teleporter contract then calls the destination dApp contract
- The dApp decodes the message payload
As you noticed in the Teleporter Basics
chapter most of the cross-chain communication has been abstracted away from the dApp developer. The only interfaces for them are:
- Sending a message: Simply calling the Teleporter contract on the source chain
- Receiving a message: Being able to be called by the Teleporter on the destination chain
To start, we will assume there is always an AWM Relayer to deliver our messages without any incentives. Let's dive deeper into the sending and receiving of messages in the next sections.