package octez-libs
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053
doc/octez-libs.crypto/Tezos_crypto/Hashed/Operation_list_hash/index.html
Module Hashed.Operation_list_hashSource
The element type elt of the Merkle tree.
elt_bytes x returns the byte sequence representation of the element x.
include Tezos_stdlib.Compare.S with type t := t
hash_string ?key inputs returns a hash.
Raises an Assert_failure if String.length key > 64.
compute xs computes a full binary tree from the list xs.
In this tree the ith leaf (from left to right) is the ith element of the list xs. If xs is the empty list, then the result is the empty tree. If the length of xs is not a power of 2, then the tree is padded with leaves containing the last element of xs such that a full tree is obtained.
Example: given the list [1; 2; 3], the tree
/\
/ \
/\ /\
1 2 3 3is built.
A path to an element in a Merkle tree.
A path is either:
Left (p, r), indicating that the element is in the left subtree, from which the pathpshould be taken to find the element.ris the left subtree where this branching decision is made.Right (l, p), indicating that the element is in the right subtree, from which the pathpshould be taken to find the element.lis the left subtree where this branching decision is made.Op, indicating that the path traversal has reached the element.
Example:
/\
/ \
/\ /\
4 5 6 7The path to the third leaf, containing 6 will be:
Right (node (leaf 4, leaf 5), Left (Op, leaf 7))
Consequently, the path will contain all the information to reconstruct the full tree, except the element to which the path lead.
Encoding of a path.
Encoding of a path, with optional bound max_length.
The encoding is bounded to log2(max_length) * (size + 1) + 1 bytes.
compute_path xs i computes the path to the ith leaf of the Merkle tree computed from xs, that will also contain the ith element of xs.