Struct akd::append_only_zks::Azks

source ·
pub struct Azks {
    pub latest_epoch: u64,
    pub num_nodes: u64,
}
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 is the total size of this tree

Implementations§

Creates a new azks

Insert a batch of new leaves.

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 an AkdError.

RESTRICTIONS: Note that start_epoch and end_epoch are valid only when the following are true

  • start_epoch <= end_epoch
  • start_epoch and end_epoch are both existing epochs of this AZKS

Gets the root hash for this azks

Gets the root hash of the tree at the latest epoch if the passed epoch is equal to the latest epoch. Will return an error otherwise.

Gets the latest epoch of this azks. If an update aka epoch transition is in progress, this should return the most recent completed epoch.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Retrieve the in-memory size of a structure
This particular storage will have a key type
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
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§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.