MerkleTree

scalus.crypto.tree.MerkleTree
See theMerkleTree companion object
class MerkleTree

Off-chain static Merkle tree.

Built once from a known set of elements. Supports membership proofs but no insert/delete/append. Uses a heap-indexed array of hashes: index 1 = root, 2i/2i+1 = children of node i.

Leaf hashing: blake2b_256(element). Empty leaf: blake2b_256(ByteString.empty).

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def capacity: Int

Number of leaf slots (2^depth).

Number of leaf slots (2^depth).

Attributes

def contains(element: ByteString): Boolean

Check if an element is in the tree.

Check if an element is in the tree.

Attributes

Generate a membership proof for an element.

Generate a membership proof for an element.

Returns D * 33 bytes: D repetitions of (direction[1] + sibling[32]), bottom-up (leaf level first).

Attributes

Root hash of the tree.

Root hash of the tree.

Attributes

Concrete fields

val depth: Int