MerklePatriciaForestry

scalus.cardano.onchain.plutus.crypto.trie.MerklePatriciaForestry
See theMerklePatriciaForestry companion class

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class Neighbor(nibble: BigInt, prefix: ByteString, root: ByteString)

A neighbor node used in a proof

A neighbor node used in a proof

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
enum ProofStep

Types of proof steps that can occur in a proof Each step contains a skip value indicating length of common prefix at that level

Types of proof steps that can occur in a proof Each step contains a skip value indicating length of common prefix at that level

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Types

type Proof = List[ProofStep]

A proof is a list of steps processed left to right, corresponding to neighbor nodes along the path to the element being proved.

A proof is a list of steps processed left to right, corresponding to neighbor nodes along the path to the element being proved.

Attributes

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

Create trie from root hash Root must be 32 bytes

Create trie from root hash Root must be 32 bytes

Attributes

Create empty trie

Create empty trie

Attributes

Concrete fields

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

Extensions

Extensions

extension (self: MerklePatriciaForestry)

Delete an element with proof using single-pass: parse proof once, compute both including (verify present) and excluding (new root) simultaneously.

Delete an element with proof using single-pass: parse proof once, compute both including (verify present) and excluding (new root) simultaneously.

Attributes

def has(key: ByteString, value: ByteString, proof: Proof): Boolean

Check if an element exists with a specific value

Check if an element exists with a specific value

Attributes

Insert an element with proof using single-pass: parse proof once, compute both excluding (verify absent) and including (new root) simultaneously.

Insert an element with proof using single-pass: parse proof once, compute both excluding (verify absent) and including (new root) simultaneously.

Attributes

def isEmpty: Boolean

Check if this trie is empty

Check if this trie is empty

Attributes

def update(key: ByteString, proof: Proof, oldValue: ByteString, newValue: ByteString): MerklePatriciaForestry

Update an element's value with proof More efficient than separate delete+insert

Update an element's value with proof More efficient than separate delete+insert

Attributes

def verifyMembership(key: ByteString, value: ByteString, proof: Proof): Unit

Verify membership of a key-value pair, throwing if the proof is invalid

Verify membership of a key-value pair, throwing if the proof is invalid

Attributes

def verifyNonMembership(key: ByteString, proof: Proof): Unit

Verify non-membership of a key, throwing if the proof is invalid

Verify non-membership of a key, throwing if the proof is invalid

Attributes