Skip to Content
SupraNova (Bridge)Security Best Practices

Security Best Practices

HyperNova proves that a message was posted on the source chain. Everything about what the message means, and whether your application should act on it, is your application’s responsibility. Use this checklist for every contract or module that receives messages.

Who checks what

The verifier depends on the destination and, on SupraMVM, on the source chain. On EVM chains, the verifier is Hypernova. On SupraMVM, hypernova_core verifies messages from Ethereum, and supra_hypernova_core verifies messages from SupraEVM.

CheckOn EVM chainsOn SupraMVM, from EthereumOn SupraMVM, from SupraEVM
The source chain’s consensus and the inclusion proofsThe verifierThe verifierThe verifier
The message-passing layer emitted the eventThe verifierThe verifierThe verifier
The message is addressed to this chainThe verifierYour moduleThe verifier
Your application posted the messageThe verifier, against the expectedCaller you passYour moduleYour module
The message has not been processed beforeThe verifier, per consumerYour moduleThe verifier, per consumer
The payload is validYour applicationYour applicationYour application

On SupraMVM, hypernova_core keeps no record of processed messages and does not check who posted a message or which chain it is addressed to. A module that receives messages from Ethereum must do all three itself, as described below.

Check who posted the message

Anyone can post a message to any registered destination. Accept only messages posted by your own application.

  • On EVM chains, pass your SupraMVM module’s address as expectedCaller to verifyMessagePostedOnSupra. Never take it from the relayer’s input.
  • On SupraMVM, compare topics[1] of the verified log with your application’s address on the source chain. Neither hypernova_core nor supra_hypernova_core checks it.

Check the destination

  • On EVM chains, Hypernova rejects messages addressed to another chain.
  • On SupraMVM, for messages from SupraEVM, supra_hypernova_core rejects messages addressed to another chain.
  • On SupraMVM, for messages from Ethereum, check that topics[3] of the verified log is this chain’s ID. hypernova_core does not check it.

Prevent replay

A valid proof stays valid indefinitely, so anyone can submit the same message again.

  • On EVM chains, Hypernova records each message per consumer. Call Hypernova directly from the contract that acts on the message. If you call it through another contract, Hypernova keeps the record for that contract instead.
  • On SupraMVM, for messages from SupraEVM, supra_hypernova_core records each message per consumer, the signer that your module passes as consumer. Pass a signer that your module controls, such as its resource account. If you pass the signer of the account that submits the transaction, supra_hypernova_core keeps a separate record for each account, and the same message can be processed once per account.
  • On SupraMVM, for messages from Ethereum, hypernova_core keeps no record. Store every processed message, for example by the log hash that verification returns, and reject repeats.

Use only verified fields

For messages from Ethereum to SupraMVM, hypernova_core does not check the message parameters passed to the verification functions, such as msg_id, source_chain_id and destination_chain_id, against the log. Read the sender, message ID and destination from the verified log’s topics instead.

Fix the verification strategy

For messages from Ethereum, set the verification strategy and safety level in your module, not from relayer input. hypernova_core enforces whatever you pass, including a safety level of 0. See Receive a Message.

Validate the payload

HyperNova does not interpret payloads. Decode the payload defensively, check its length and every field that affects execution or authorization, and reject anything you do not expect.

Plan for liveness

  • A message waits until it is relayed, and until the destination verifier’s committee keys are current. Design your application so that a delayed message is safe.
  • The admin of the message-passing layer can pause it, and the admin of each verifier can pause that verifier. A pause stops new messages in an emergency. See Roles and Permissions.
  • Message IDs come from one counter shared by every application on the source chain. Do not rely on your own messages having consecutive IDs.
Last updated on