Skip to content

crypto

Cryptographic helpers for EVML scripts: Merkle tree utilities to compute roots, generate inclusion proofs and verify them over raw bytes32 leaves, supporting both the OpenZeppelin sorted-pair convention and positional (unsorted) trees such as Hop transfer roots.

load crypto
HelperReturnsDescription
@crypto:merkle.proofarrayGenerate the Merkle inclusion proof (array of sibling hashes) for the leaf at the given index. A single-leaf tree has an empty proof.
@crypto:merkle.rootbytes32Compute the Merkle root of an array of bytes32 leaves. A single-leaf tree has root = leaf.
@crypto:merkle.verifyboolVerify a Merkle inclusion proof against a root. Without an index the proof is checked with the sorted-pair convention (OpenZeppelin MerkleProof); with an index it is checked positionally (unsorted trees).