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.

⚗️ Experimental — available at next.evmcrispr.com.

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: with no index the sorted-pair convention (OpenZeppelin MerkleProof), with an index the positional one for unsorted trees.