Cross-Chain Messaging
ZetaChain’s cross-chain messaging lets you send value and data between chains in a single step, and build dApps that span across multiple chains.
Start Building →How does cross-chain messaging work?
Contracts on any connected chain can send data and value to other contracts on other chains through ZetaChain’s Connector contracts. ZetaChain’s cross-chain messaging also lets you build value-transfer apps that don’t create new wrapped assets and risk for users. Implement "sender", "receiver" and "revert" functions to get intuitive, traceable, and revertible behavior so your users don’t get stuck or risk their funds.
Build Universal dApps →
contract YourContract is ZetaInteractor, ZetaReceiver {
constructor(address connectorAddress)
ZetaInteractor(connectorAddress) {}
function sendMessage(uint256 chainId) external payable {
connector.send(
ZetaInterfaces.SendInput({
destinationChainId: chainId,
destinationAddress: interactorsByChainId[chainId],
destinationGasLimit: 300000,
message: abi.encode("Hello, Cross-Chain World!"),
zetaValueAndGas: msg.value,
zetaParams: abi.encode("")
})
);
}
function onZetaMessage(
ZetaInterfaces.ZetaMessage calldata zetaMessage
) external override isValidMessageCall(zetaMessage) {
// Handle the message
}
function onZetaRevert(
ZetaInterfaces.ZetaRevert calldata zetaRevert
) external override isValidRevertCall(zetaRevert) {
// Handle the revert
}
}
Built for an unparalleled developer experience
Easily pass data to other chains
Speed where it matters
Use your existing contracts
Deploy contracts on two or more connected chains implementing connector calls. Simple functions can send arbitrary data and value message between blockchains to synchronize state, exchange value, or interact agnostically.
Call a simple function to send and swap value, or NFTs to an address on a different chain. The message is received by ZetaChain and signed on the destination in one-step, and there’s no need to update state back on the source chain.
With message passing, you can build your app logic across all the chains you need. ZetaChain acts as a message verifier and relayer, which makes it easy to use your existing infrastructure and achieve connectivity.