Module diem_sdk::types::proof

Modules

  • This module implements an in-memory Merkle Accumulator that is similar to what we use in storage. This accumulator will only store a small portion of the tree – for any subtree that is full, we store only the root. Also we only store the frozen nodes, therefore this structure will always store up to Log(n) number of nodes, where n is the total number of leaves in the tree.
  • This module has definition of various proofs.
  • This module provides an abstraction for positioning a node in a binary tree, A Position uniquely identifies the location of a node
  • All proofs generated in this module are not valid proofs. They are only for the purpose of testing conversion between Rust and Protobuf.

Structs

  • The complete proof used to authenticate the state of an account. This structure consists of the AccumulatorProof from LedgerInfo to TransactionInfo, the TransactionInfo object and the SparseMerkleProof from state root to the account.
  • A proof that can be used to show that two Merkle accumulators are consistent – the big one can be obtained by appending certain leaves to the small one. For example, at some point in time a client knows that the root hash of the ledger at version 10 is old_root (it could be a waypoint). If a server wants to prove that the new ledger at version N is derived from the old ledger the client knows, it can show the subtrees that represent all the new leaves. If the client can verify that it can indeed obtain the new root hash by appending these new leaves, it can be convinced that the two accumulators are consistent.
  • A proof that first verifies that establishes correct computation of the root and then returns the new tree to acquire a new root and version.
  • A proof that can be used authenticate an element in an accumulator given trusted root hash. For example, both LedgerInfoToTransactionInfoProof and TransactionInfoToEventProof can be constructed on top of this structure.
  • A proof that is similar to AccumulatorProof, but can be used to authenticate a range of leaves. For example, given the following accumulator:
  • The complete proof used to authenticate a contract event. This structure consists of the AccumulatorProof from LedgerInfo to TransactionInfo, the TransactionInfo object and the AccumulatorProof from event accumulator root to the event.
  • Cryptographic hasher for an BCS-serializable #item
  • A proof that can be used to authenticate an element in a Sparse Merkle Tree given trusted root hash. For example, TransactionInfoToAccountProof can be constructed on top of this structure.
  • A proof that can be used authenticate a range of consecutive leaves, from the leftmost leaf to a certain one, in a sparse Merkle tree. For example, given the following sparse Merkle tree:
  • An in-memory accumulator for storing a summary of the core transaction info accumulator. It is a summary in the sense that it only stores maximally frozen subtree nodes rather than storing all leaves and internal nodes.
  • TransactionInfo and a TransactionAccumulatorProof connecting it to the ledger root.
  • The complete proof used to authenticate a list of consecutive transactions.

Type Definitions