package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a
doc/tezos_context_disk/Tezos_context_disk/Context_binary/Proof/Stream/index.html
Module Proof.Stream
Stream proofs represent an explicit traversal of a Merle tree proof. Every element (a node, a value, or a shallow pointer) met is first "compressed" by shallowing its children and then recorded in the proof.
As stream proofs directly encode the recursive construction of the Merkle root hash is slightly simpler to implement: verifier simply need to hash the compressed elements lazily, without any memory or choice.
Moreover, the minimality of stream proofs is trivial to check. Once the computation has consumed the compressed elements required, it is sufficient to check that no more compressed elements remain in the proof.
However, as the compressed elements contain all the hashes of their shallow children, the size of stream proofs is larger (at least double in size in practice) than tree proofs, which only contains the hash for intermediate shallow pointers.
type elt =
| Value of bytes
| Node of (string * [ `Value of Tezos_base.TzPervasives.Context_hash.t | `Node of Tezos_base.TzPervasives.Context_hash.t ]) list
| Inode of Tezos_base.TzPervasives.Context_hash.t Tezos_context_sigs__Context.Proof_types.inode
| Inode_extender of Tezos_base.TzPervasives.Context_hash.t Tezos_context_sigs__Context.Proof_types.inode_extender
The type for elements of stream proofs.
Value v
is a proof that the next element read in the store is the value v
.
Node n
is a proof that the next element read in the store is the node n
.
Inode i
is a proof that the next element read in the store is the inode i
.
Inode_extender e
is a proof that the next element read in the store is the node extender e
.
type t = unit -> elt Tezos_base.TzPervasives.Seq.node
The type for stream proofs.
The sequence e_1 ... e_n
proves that the e_1
, ..., e_n
are read in the store in sequence.