Skip to Content
SupraNova (Bridge)Receive a Message

Receive a Message

To receive a message, your application exposes an entry point on the destination chain. The entry point accepts the message event and its proof bundle, passes them to the verifier, and acts on the message only if verification succeeds. Verification describes the proof bundles.

SupraNova will publish its EVM and Move interfaces in a GitHub repository. Until then, use the signatures on this page.

Call verifyMessagePostedOnSupra on the Hypernova contract directly from your contract:

function verifyMessagePostedOnSupra( MoveEventV2 calldata moveEvent, EventInclusionProof calldata eventInclusionProof, TransactionsInclusionCertificate calldata certificate, bytes32 expectedCaller ) external payable returns (SupraMessagePostedEvent memory messagePostedEvent);
  • expectedCaller is the 32-byte SupraMVM address that posted the message: your module’s account. Hypernova rejects messages posted by anyone else.
  • msg.value must equal sourceEnabledChainVerificationFee(chainId) exactly, where chainId is the SupraMVM chain ID listed in Supported Networks.
  • Replay protection: Hypernova records each message per source chain, msg.sender and message ID. Call Hypernova from the contract that acts on the message, not through an intermediary, so that the record is kept for your contract.
  • Hypernova also checks that the message is addressed to this chain and that the message-passing layer on SupraMVM emitted it.
  • To check later whether your contract has processed a message, call isMessageProcessed(sourceChainId, consumer, messageId) on Hypernova, with your contract as consumer.

The function returns the decoded message:

struct SupraMessagePostedEvent { bytes32 caller; uint256 messageId; uint64 toChainId; bytes messageData; }

The parameters use these structs. Declare them in your own interface for Hypernova: only their field types and order must match.

struct MoveEventV2 { bytes typeTag; // UTF-8 bytes of the event type, with the address written without 0x bytes data; // BCS-encoded event data } struct EventInclusionProof { MerkleProof eventMerkleProof; bytes32 transactionHash; // hash of the transaction that emitted the event MerkleProof transactionMerkleProof; } struct MerkleProof { bytes32[] proof; // sibling hashes from the leaf level up to, but not including, the root bytes32 root; // accumulator root the proof is verified against uint256 index; // 0-based index of the leaf in the accumulator } struct TransactionsInclusionCertificate { bytes32 certifyingCommitteeHash; TransactionsInclusionCertificationData data; bytes signature; } struct TransactionsInclusionCertificationData { bytes32 moveVmMerkleTreeRoot; bytes32 evmMerkleTreeRoot; uint64 blockHeight; EpochId epochId; } struct EpochId { uint8 chainId; uint64 epoch; }

Supra Consensus Verification and Message and Proof Formats describe how these proofs are built.

batchVerifyMessagePostedOnSupra verifies several messages proven against one block with a single signature check. verifyMessagePostedOnSupraWithoutCertificate and batchVerifyMessagePostedOnSupraWithoutCertificate skip the certificate once the block’s root is cached. For a batch, msg.value is the fee times the number of messages.

Receiving messages from SupraEVM on SupraMVM is not yet covered in these docs.
Last updated on