MerkleTree

scalus.cardano.onchain.plutus.crypto.tree.MerkleTree
object MerkleTree

Plain Merkle tree for static membership verification.

Built once from a known set of elements. Supports only membership proofs — no insert/delete/append. This is the cheapest on-chain option when the set is static.

Membership proofs use the same interleaved format as IMT: D * (direction[1] + sibling[32]) = D * 33 bytes. The depth is derived from the proof length, so no depth parameter is needed.

Cost: D + 1 blake2b_256 calls for depth D.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
MerkleTree.type

Members list

Value members

Concrete methods

def verifyMembership(root: ByteString, element: ByteString, proof: ByteString): Unit

Verify that element is a member of the tree with the given root.

Verify that element is a member of the tree with the given root.

Value parameters

element

the element to verify membership for

proof

membership proof: D * 33 bytes (D repetitions of direction[1] + sibling[32])

root

expected root hash (32 bytes)

Attributes

Concrete fields

lazy val sirDeps: List[SIRModuleWithDeps]
lazy val sirModule: Module