Skip to main content
A consumer contract receives a DataUpdate + SchnorrSignature in calldata, verifies it against the Molpha Verifier, and acts on the value in the same transaction.

Build the calldata

buildEvmVerifierArgs maps a gateway DataUpdateResult onto the on-chain structs with zero runtime dependency on ethers/viem:

Consumer contract

verify returns a boolean — it does not revert on a cryptographically invalid signature (structural violations revert; a bad signature returns false). Always require(...) the return value, or your contract will silently accept unverified data.

Consumer responsibilities

verify proves who signed what, not when you read it. Your contract must:
  • Enforce freshness against canonicalTimestamp — the verifier is stateless and has no replay window of its own.
  • Prevent replay if your flow can be re-executed — the same valid payload verifies forever.
  • Validate feedId and signaturesRequired match the feed you intend to consume.

Gas

Representative execution gas from the repository benchmarks (forge test --match-test test_gas_verify -vv): Full contract reference: EVM Verifier. Deployed addresses: Deployments.