Packages

package merkle

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package serialization
  2. package sparse

Type Members

  1. case class BatchMerkleProof[D <: Digest](indices: Seq[(Int, Digest)], proofs: Seq[(Digest, Side)])(implicit hf: CryptographicHash[D]) extends SparkzEncoding with Product with Serializable

    Implementation is based on Compact Merkle Multiproofs by Lum Ramabaja Retrieved from https://deepai.org/publication/compact-merkle-multiproofs

    Implementation is based on Compact Merkle Multiproofs by Lum Ramabaja Retrieved from https://deepai.org/publication/compact-merkle-multiproofs

    indices

    - leaf indices used to build the proof

    proofs

    - hash and side of nodes in the proof

  2. case class EmptyNode[D <: Digest]()(implicit hf: CryptographicHash[D]) extends Node[D] with Product with Serializable

    Empty Merkle tree node.

    Empty Merkle tree node. Either Leaf (if number of non-empty leafs is not a power of 2, remaining leafs are EmptyNode) or InternalNode (if both childs of an InternalNode are empty, it is EmptyNode)

    D

    - hash function application type

    hf

    - hash function

  3. case class EmptyRootNode[D <: Digest]()(implicit hf: CryptographicHash[D]) extends Node[D] with Product with Serializable

    Empty root node.

    Empty root node. If the tree contains no elements, it's root hash is array of 0 bits of a hash function digest length

    D

    - hash function application type

    hf

    - hash function

  4. case class InternalNode[D <: Digest](left: Node[D], right: Node[D])(implicit hf: CryptographicHash[D]) extends Node[D] with Product with Serializable

    Internal node in Merkle tree

    Internal node in Merkle tree

    D

    - hash function application type

    left

    - left child. always non-empty

    right

    - right child. can be emptyNode

    hf

    - hash function

  5. case class Leaf[D <: Digest](data: LeafData)(implicit hf: CryptographicHash[D]) extends Node[D] with Product with Serializable

    Merkle tree leaf

    Merkle tree leaf

    D

    - hash function application type

    data

    - leaf data.

    hf

    - hash function

  6. case class MerkleProof[D <: Digest](leafData: LeafData, levels: Seq[(Digest, Side)])(implicit hf: CryptographicHash[D]) extends SparkzEncoding with Product with Serializable

    Proof is given leaf data, leaf hash sibling and also siblings for parent nodes.

    Proof is given leaf data, leaf hash sibling and also siblings for parent nodes. Using this data, it is possible to compute nodes on the path to root hash, and the hash itself. The picture of a proof given below. In the picture, "^^" is leaf data(to compute leaf hash from), "=" values are to be computed, "*" values are to be stored.

    ........= Root ..... / \ .... * = ....... / \ ...... * = ......... /.\ .........* = ............ ^^

    leafData

    - leaf data bytes

    levels

    - levels in proof, bottom up, each level is about stored value and position of computed element (whether it is left or right to stored value)

  7. case class MerkleTree[D <: Digest](topNode: Node[D], elementsHashIndex: Map[ofByte, Int]) extends Product with Serializable
  8. trait Node[D <: Digest] extends SparkzEncoding

Value Members

  1. object MerkleProof extends Serializable
  2. object MerkleTree extends Serializable

Ungrouped