@proto-kit/commonDocs


Documentation / @proto-kit/common / createMerkleTree

Function: createMerkleTree()

createMerkleTree(height): AbstractMerkleTreeClass

A Merkle Tree is a binary tree in which every leaf is the cryptography hash of a piece of data, and every node is the hash of the concatenation of its two child nodes.

A Merkle Tree allows developers to easily and securely verify the integrity of large amounts of data.

Take a look at our documentation on how to use Merkle Trees in combination with zkApps and zero knowledge programming!

Levels are indexed from leaves (level 0) to root (level N - 1).

This function takes a height as argument and returns a class that implements a merkletree with that specified height.

It also holds the Witness class under tree.WITNESS

Parameters

height: number

Returns

AbstractMerkleTreeClass

Defined in

packages/common/src/trees/sparse/RollupMerkleTree.ts:137