Build with Vea
This page covers how to integrate Vea into a cross-chain application. For protocol-level details, see the Vea Bridge overview.Integration Pattern
To integrate Vea, you deploy two gateway contracts:- Sender Gateway on the sending chain, which interfaces with VeaInbox
- Receiver Gateway on the receiving chain, which interfaces with VeaOutbox
1. Sender Gateway
The Sender Gateway callssendMessage() on VeaInbox to initiate cross-chain communication.
- The target contract address on the receiving chain (
_to) - The function to call on the target (
_fnSelector) - The encoded parameters (
_data)
Example: Sender Gateway
2. Receiver Gateway
The Receiver Gateway receives the relayed message on the destination chain. Vea passes themsg.sender from the sending chain as the first argument of any cross-chain call.
address msgSender as the first parameter:
3. Relaying Messages
After the challenge period passes, a relayer callsverifyAndRelay() on VeaOutbox to deliver the message to the Receiver Gateway.
The Vea SDK provides utility functions to calculate merkle inclusion proofs and fetch message data for relaying:
The SDK is under active development. Check the Vea SDK package for the latest API.