Message passing
Last updated
Last updated
zkBridge enables secure and efficient cross-chain message passing between different blockchain networks, leveraging zero-knowledge proof (ZKP) technology and a set of APIs designed to facilitate interoperable communication. This document provides an overview of the cross-chain message passing process using zkBridge. You can try out our function on zkBridge.
To pass messages across different chains, zkBridge uses the SendAPI and ReceiveAPI interfaces, along with the block header relay network. These components ensure secure and efficient cross-chain communication.
The following steps outline the process of passing messages across chains using zkBridge:
On the sender chain, prepare the message payload, which typically contains information such as the destination address, destination chain, and any other custom data that needs to be transmitted.
Utilize the zkBridge entrypoint interface to send the message to the destination chain. Call the send
function, providing the necessary parameters such as the destination chain ID, destination address, and message payload.
The block header relay network generates a zkProof for the sender chain's block header, which is then verified by the updater contract on the receiver chain. This process ensures the integrity and security of the cross-chain communication.
On the destination chain, use the zkBridge receiver interface to receive and process the message. Call thezkReceive
function, providing the source chain ID, source block hash, and zkProof. These functions return the decoded payload, allowing you to process the cross-chain message according to your application's requirements.