Hashed.Operation_list_hashval elt_bytes : elt -> Stdlib.Bytes.telt_bytes x returns the byte sequence representation of the element x.
val pp : Stdlib.Format.formatter -> t -> unitval pp_short : Stdlib.Format.formatter -> t -> unitinclude Mavryk_stdlib.Compare.S with type t := tval hash_bytes : ?key:Stdlib.Bytes.t -> Stdlib.Bytes.t list -> tval hash_string : ?key:string -> string list -> thash_string ?key inputs returns a hash.
Raises an Assert_failure if String.length key > 64.
val zero : tval to_hex : t -> Mavryk_stdlib.Hex.tval of_hex : Mavryk_stdlib.Hex.t -> t Mavryk_error_monad.Error_monad.tzresultval of_hex_opt : Mavryk_stdlib.Hex.t -> t optionval of_hex_exn : Mavryk_stdlib.Hex.t -> tval to_string : t -> stringval of_string : string -> t Mavryk_error_monad.Error_monad.tzresultval of_string_opt : string -> t optionval of_string_exn : string -> tval to_bytes : t -> Stdlib.Bytes.tval of_bytes : Stdlib.Bytes.t -> t Mavryk_error_monad.Error_monad.tzresultval of_bytes_opt : Stdlib.Bytes.t -> t optionval of_bytes_exn : Stdlib.Bytes.t -> tval to_b58check : t -> stringval to_short_b58check : t -> stringval of_b58check : string -> t Mavryk_error_monad.Error_monad.tzresultval of_b58check_exn : string -> tval of_b58check_opt : string -> t optionval b58check_encoding : t Base58.encodingval encoding : t Data_encoding.tval rpc_arg : t Mavryk_rpc.Arg.tval hash : t -> intval seeded_hash : int -> t -> intval to_path : t -> string list -> string listval of_path : string list -> t optionval of_path_exn : string list -> tmodule Set : sig ... endmodule Map : sig ... endmodule Table : sig ... endmodule Error_table : sig ... endmodule WeakRingTable : sig ... endcompute 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.
val empty : tThe empty Merkle tree.
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 path p should be taken to find the element. r is the left subtree where this branching decision is made.Right (l, p), indicating that the element is in the right subtree, from which the path p should be taken to find the element. l is 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.
val path_encoding : path Data_encoding.tEncoding of a path.
val bounded_path_encoding : ?max_length:int -> unit -> path Data_encoding.tEncoding 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.