org.sigilaris.core.merkle
Members list
Type members
Classlikes
Merkle Trie operations providing key-value storage with cryptographic verification.
Merkle Trie operations providing key-value storage with cryptographic verification.
A Merkle Trie is a tree structure where:
- Keys are represented as Nibbles (4-bit sequences)
- Each node has a hash computed from its contents
- The root hash uniquely identifies the entire tree state
All operations are effectful and maintain state through MerkleTrieState, which tracks the root hash and accumulated differences.
Attributes
- See also
-
MerkleTrieNode for node structure
MerkleTrieState for state management
Nibbles for key representation
- Source
- MerkleTrie.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
MerkleTrie.type
Represents a node in a Merkle Trie.
Represents a node in a Merkle Trie.
Merkle Trie consists of three types of nodes:
Leaf: Terminal node storing a key-value pairBranch: Branch node with only child nodesBranchWithData: Branch node with both child nodes and a value
Attributes
- See also
-
MerkleTrieNode.Leaf for terminal nodes
MerkleTrieNode.Branch for branch nodes
MerkleTrieNode.BranchWithData for branch nodes with values
- Example
-
val leaf = MerkleTrieNode.leaf( prefix = ByteVector(0x12, 0x34).toNibbles, value = ByteVector(0xab, 0xcd), ) - Companion
- object
- Source
- MerkleTrieNode.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Companion object for MerkleTrieNode with constructors and type definitions.
Companion object for MerkleTrieNode with constructors and type definitions.
Attributes
- Companion
- trait
- Source
- MerkleTrieNode.scala
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
MerkleTrieNode.type
Represents the state of a Merkle Trie with change tracking.
Represents the state of a Merkle Trie with change tracking.
Tracks the current root, base root, and accumulated differences to enable efficient state transitions and merging.
Value parameters
- base
-
base root hash (for tracking changes)
- diff
-
accumulated differences from base
- root
-
current root hash
Attributes
- See also
-
MerkleTrieStateDiff for difference tracking
MerkleTrieNode.MerkleRoot for root hash type
- Companion
- object
- Source
- MerkleTrieState.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Companion object for MerkleTrieState with constructors.
Companion object for MerkleTrieState with constructors.
Attributes
- Companion
- class
- Source
- MerkleTrieState.scala
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
MerkleTrieState.type
Companion object for MerkleTrieStateDiff with operations.
Companion object for MerkleTrieStateDiff with operations.
Attributes
- Source
- MerkleTrieStateDiff.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
MerkleTrieStateDiff.type
Companion object for Nibbles providing creation and manipulation methods.
Companion object for Nibbles providing creation and manipulation methods.
Attributes
- Source
- Nibbles.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Nibbles.type
Types
Tracks differences in Merkle Trie state using reference counting.
Tracks differences in Merkle Trie state using reference counting.
Maintains a map from node hashes to (node, reference count) pairs. Positive counts indicate additions, negative counts indicate removals.
Attributes
- See also
-
MerkleTrieState for usage context
- Source
- MerkleTrieStateDiff.scala
Represents a bit vector aligned to 4-bit boundaries.
Represents a bit vector aligned to 4-bit boundaries.
Used to represent key paths in Merkle Tries, where each nibble has a value in the range 0-15.
Attributes
- Note
-
The bit size must always be a multiple of 4.
- Example
-
val bytes = ByteVector(0x12, 0x34) val nibbles = bytes.toNibbles nibbles.hex // "1234" nibbles.nibbleSize // 4 - Source
- Nibbles.scala