Struct akd::append_only_zks::Azks [−][src]
Expand description
An append-only zero knowledge set, the data structure used to efficiently implement a auditable key directory.
Fields
latest_epoch: u64
The latest complete epoch
num_nodes: u64
The number of nodes ie the size of this tree
Implementations
Creates a new azks
Inserts a single leaf and is only used for testing, since batching is more efficient. We just want to make sure batch insertions work correctly and this function is useful for that.
Insert a batch of new leaves
An azks is built both by the crate::directory::Directory and the auditor. However, both constructions have very minor differences, and the append_only_usage bool keeps track of this.
Returns the Merkle membership proof for the trie as it stood at epoch
In a compressed trie, the proof consists of the longest prefix of the label that is included in the trie, as well as its children, to show that none of the children is equal to the given label.
An append-only proof for going from start_epoch
to end_epoch
consists of roots of subtrees
the azks tree that remain unchanged from start_epoch
to end_epoch
and the leaves inserted into the
tree after start_epoch
and up until end_epoch
.
If there is no errors, this function returns an Ok
result, containing the
append-only proof and otherwise, it returns a errors::AkdError.
RESTRICTIONS: Note that start_epoch
and end_epoch
are valid only when the following are true
start_epoch
<=end_epoch
start_epoch
andend_epoch
are both existing epochs of this AZKS
pub async fn get_root_hash<S: Storage + Sync + Send, H: Hasher>(
&self,
storage: &S
) -> Result<H::Digest, HistoryTreeNodeError>
pub async fn get_root_hash<S: Storage + Sync + Send, H: Hasher>(
&self,
storage: &S
) -> Result<H::Digest, HistoryTreeNodeError>
Gets the root hash for this azks
Gets the root hash of the tree at a epoch. Since this is accessing the root node and the root node exists at all epochs that the azks does, this would never be called at an epoch before the birth of the root node.
Gets the latest epoch of this azks. If an update aka epoch transition is in progress, this should return the most recent completed epoch.
This function returns the node label for the node whose label is the longest common prefix for the queried label. It also returns a membership proof for said label. This is meant to be used in both, getting membership proofs and getting non-membership proofs.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Must return a valid storage type
Retrieve an instance of the id of this storable. The combination of the storable’s StorageType and this id are globally unique Read more
Retrieve the full binary version of a key (for comparisons)
Reformat a key from the full-binary specification
Retrieve the full binary version of a key (for comparisons)
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.