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 cryptoHelpers
Section titled “Helpers”| Helper | Returns | Description |
|---|---|---|
| @crypto:merkle.proof | array | Generate 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.root | bytes32 | Compute the Merkle root of an array of bytes32 leaves. A single-leaf tree has root = leaf. |
| @crypto:merkle.verify | bool | Verify 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). |