Skip to main content
Module

x/lucid/mod.ts>MerkleTree

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
Very Popular
Go to Latest
class MerkleTree
import { MerkleTree } from "https://deno.land/x/lucid@0.8.4/mod.ts";

Constructors

new
MerkleTree(data: Array<Uint8Array>)

Construct Merkle tree from data, which get hashed with sha256

Properties

root: MerkleNode | null

Methods

getProof(data: Uint8Array): MerkleTreeProof
rootHash(): Hash
size(): number
toString(): string

Static Methods

private
buildRecursively(hashes: Array<Hash>): MerkleNode | null
fromHashes(hashes: Array<Hash>)

Construct Merkle tree from sha256 hashes

verify(
data: Uint8Array,
rootHash: Hash,
proof: MerkleTreeProof,
): boolean