CommitmentTree (Anoma v0.29.0)
A simple commitment tree.
Currently stores all commitments forever, and stores the full tree in memory, pending future more sophisticated retention policies. Does not yet store any anchors itself for the same reason--this is a complex policy level decision.
Has a fixed depth.
Fiats that empty subtrees have a hash of 0 for simplicity.
Summary
Functions
Adds commitments to the commitment tree, and returns the new tree and the anchor. TODO handle the tree's filling up
Creates a new CommitmentTree
struct.
Types
@type t() :: %CommitmentTree{ root: CommitmentTree.Node.t(), size: integer(), spec: CommitmentTree.Spec.t(), table: term() }
Functions
Link to this function
add(tree, cms)
Adds commitments to the commitment tree, and returns the new tree and the anchor. TODO handle the tree's filling up
Link to this function
init_storage(mnesia_table)
Link to this function
new(spec, table)
@spec new(CommitmentTree.Spec.t(), term()) :: t()
Creates a new CommitmentTree
struct.
Link to this function
prove(tree, i)
@spec prove(t(), integer()) :: CommitmentTree.Proof.t()