Message and Proof Formats
This page specifies the byte-level formats that relayers, provers and applications need to build or decode SupraNova messages and proofs. Verification explains how each proof is used.
Token Bridge payload from SupraMVM
A transfer from SupraMVM carries a payload in Recursive Length Prefix (RLP) encoding. The TokenBridge on the destination EVM chain decodes the payload into exactly nine fields, in this order:
- sender address
- source token address
- source chain ID
- payload
- receive amount
- service fee
- relayer reward
- receiver address
- unwrap flag
The TokenBridge rejects the payload unless all of these conditions hold:
- The payload has exactly nine fields.
- The sender address and the source token address, which are SupraMVM addresses, are exactly 32 bytes each.
- The source chain ID and each amount fit in a
u64.
Supra Merkle accumulators
Supra commits every executed transaction, and every event that each transaction emits, to Merkle accumulators. Supra hashes each internal node as keccak256(prefix || left || right). The prefix is keccak256("SUPRA::EventAccumulator") in the event accumulator and keccak256("SUPRA::TransactionAccumulator") in the transaction accumulator. Because the prefixes differ, a node from one tree can never be presented as a node of the other.
Each leaf is one of these hashes, where || is byte concatenation:
- Move event:
keccak256(typeTag || data) - EVM log:
keccak256(address || topicCount || topics || data), whereaddressis the 20-byte emitting contract andtopicCountis the number of topics as a 32-byte big-endian integer - Transaction:
keccak256(keccak256("SUPRA::TransactionAccumulator") || txHash || eventRoot)
The transaction leaf commits to the transaction hash and to its event accumulator root together. A valid event root therefore cannot be reattached to a different transaction.
The transaction accumulator is append-only. The root certified at a later block still contains every earlier transaction. You can therefore prove a transaction against the certificate of its own block or of any later block.
Transactions Inclusion Certificate
The certificate is a ClanMajority signature over the Keccak-256 digest of:
moveVmMerkleTreeRoot || evmMerkleTreeRoot || blockHeight (u64, little-endian) || chainId (1 byte) || epoch (u64, little-endian)The digest covers the accumulator roots of both SupraMVM and SupraEVM, so one certificate serves messages from either of them. The digest also binds the block height, the chain and the epoch, so a certificate cannot be reused for a different block, chain or epoch.
Supra RPC returns the signature as a 96-byte compressed BLS12-381 G2 point. The Hypernova contract expects the 256-byte encoding that EIP-2537 defines. To convert the signature:
- Decompress the point.
- Left-pad each of its four 48-byte field elements with 16 zero bytes.
- Concatenate the padded field elements in this order: x real, x imaginary, y real, y imaginary.
Boneh–Lynn–Shacham (BLS) signature libraries such as blst produce an uncompressed form that puts the imaginary part of each coordinate first. Reorder the field elements before you concatenate them.
Message events
On EVM chains, the Hypernova contract emits each outbound message as a MessagePosted event:
event MessagePosted(address indexed caller, uint256 indexed messageId, uint64 indexed chainId, bytes messageData);On SupraMVM, hypernova_core_from_supra emits each outbound message as a MessagePostedEvent:
struct MessagePostedEvent has store, drop {
caller: address,
message_id: u256,
to_chain_id: u64,
message_data: vector<u8>,
}chainId and to_chain_id are the destination chain ID. See Send a Message.
When a MessagePostedEvent is proven, its leaf is keccak256(typeTag || data):
typeTagis the UTF-8 event type,<package>::hypernova_core_from_supra::MessagePostedEvent. Write the package address as 64 hexadecimal digits, without the0xprefix.datais the Binary Canonical Serialization (BCS) encoding of the event, in this order:caller, 32 bytes.message_id, 32 bytes, little-endian.to_chain_id, 8 bytes, little-endian.- The length of
message_data, as an unsigned Little Endian Base 128 (ULEB128) integer. message_data.
The leaf equals the event hash that Supra RPC returns. Compare your encoding against the hash to check it.