Module proof

Module proof 

Source
Expand description

Trie proofs and proof verification.

The Merkle Trie defined in NOMT is an authenticated data structure, which means that it permits efficient proving against the root. This module exposes types and functions necessary for handling these kinds of proofs.

Using the types and functions exposed from this module, you can verify the value of a single key within the trie (PathProof), the values of multiple keys (MultiProof), or the result of updating a trie with a set of changes (verify_update).

Structs§

KeyOutOfScope
An error type indicating that a key is out of scope of a path proof.
MultiPathProof
This struct includes the terminal node and its depth
MultiProof
A proof of multiple paths through the trie.
PathProof
A proof of some particular path through the trie.
PathUpdate
An update to the node at some path.
VerifiedMultiProof
A verified multi-proof.
VerifiedPathProof
A verified path through the trie.

Enums§

MultiProofVerificationError
Errors in multi-proof verification.
PathProofTerminal
Wrapper for a terminal node, it will store the LeafData if it is a leaf node, and just the KeyPath to that terminal if it is a terminator node
PathProofVerificationError
Errors in path proof verification.
VerifyUpdateError
Errors that can occur when verifying an update proof.

Functions§

verify_multi_proof
Verify a multi-proof against an expected root. This ONLY checks the consistency of the trie.
verify_multi_proof_update
Verify an update operation against a verified multi-proof. This follows a similar algorithm to the multi-item update, but without altering any backing storage.
verify_update
Verify an update operation against the root node. This follows a similar algorithm to the multi-item update, but without altering any backing storage.