Dataflow
Learn the complete flow of a Cross-Chain message.
These can be described as follows:
- Cross-Chain dApp initiating the message calls the Interchain Messaging Contract
- The Interchain Messaging contracts interacts with the AWM precompile of the EVM
- An AWM Relayer relays the message to the destination Chain. It periodically checks the source Avalanche L1 for outgoing messages and delivers these by calling the Interchain Messaging contract on the destination Avalanche L1
- The Interchain Messaging 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 Avalanche L1's validator set.
- The Interchain Messaging 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 Interchain Messaging contract on the source chain
- Receiving a message: Being able to be called by the Interchain Messaging 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.