MerklePatriciaForestry

scalus.crypto.trie.MerklePatriciaForestry
See theMerklePatriciaForestry companion object
case class MerklePatriciaForestry(root: Node)

Off-chain original Merkle Patricia Forestry implementation (full nibble prefix encoding).

Allows lookup, insertion, deletion, and generation of succinct and on-chain MPF compatible membership/non-membership proofs.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Deletes an element by the specified key from the trie. If this key is missing from the trie, throws an exception.

Deletes an element by the specified key from the trie. If this key is missing from the trie, throws an exception.

Attributes

def get(key: ByteString): Option[ByteString]

Returns the value stored by the specified key, or None

Returns the value stored by the specified key, or None

Attributes

Inserts a new element into this trie

Inserts a new element into this trie

Attributes

def isEmpty: Boolean

true if this trie has no elements, false otherwise

true if this trie has no elements, false otherwise

Attributes

Creates a succinct, on-chain compatible proof of inclusion of an element by this key.

Creates a succinct, on-chain compatible proof of inclusion of an element by this key.

Proofs are compact because branch nodes with 2+ siblings use a sparse merkle tree encoding (4 hashes / 128 bytes) rather than storing all 15 sibling hashes. Branches with a single sibling are encoded as a ProofStep.Fork or ProofStep.Leaf, requiring even less space.

If there's no element by this key, throws an exception.

Attributes

The hash of this MPF

The hash of this MPF

Attributes

def size: Int

The amount of elements in the tree.

The amount of elements in the tree.

Attributes

Wrap the root hash as an on-chain OnChainForestry value.

Wrap the root hash as an on-chain OnChainForestry value.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product