Tezos_raw_protocol_024_PtTALLiN.Seed_reprTezos Protocol Implementation - Random number generation
This is not expected to be a good cryptographic random number generator. In particular this is supposed to be used in situations where the seed is a globally known information.
The only expected property is: It should be difficult to find a seed such that the generated sequence is a given one.
type vdf_setup =
Tezos_protocol_environment_024_PtTALLiN.Vdf.discriminant
* Tezos_protocol_environment_024_PtTALLiN.Vdf.challengeA VDF discriminant and challenge
type vdf_solution =
Tezos_protocol_environment_024_PtTALLiN.Vdf.result
* Tezos_protocol_environment_024_PtTALLiN.Vdf.proofA VDF result, to derive a seed from
val pp_solution :
Tezos_protocol_environment_024_PtTALLiN.Format.formatter ->
vdf_solution ->
unitval compare_vdf_solution : vdf_solution -> vdf_solution -> intCompare only the first element of two vdf_solution, that are of Vdf.result.
val verify :
vdf_setup ->
Tezos_protocol_environment_024_PtTALLiN.Int64.t ->
vdf_solution ->
bool optionval vdf_to_seed : seed -> vdf_solution -> seedval make_nonce :
bytes ->
nonce Tezos_protocol_environment_024_PtTALLiN.Error_monad.tzresultUse a byte sequence as a nonce
val hash : nonce -> Nonce_hash.tCompute the hash of a nonce
val check_hash : nonce -> Nonce_hash.t -> boolcheck_hash nonce hash is true if the nonce correspond to the hash
val nonce_hash_key_part : Nonce_hash.t -> string list -> string listFor using nonce hashes as keys in the hierarchical database
val initial_seeds : ?initial_seed:State_hash.t -> int -> seed listinitial_seeds n generates the first n seeds for which there are no nonces. The first seed is a constant value. The kth seed is the hash of seed (k-1) concatenated with a constant. If an initial_seed is provided, the first seed is created using it as the first one.
val nonce_encoding :
nonce Tezos_protocol_environment_024_PtTALLiN.Data_encoding.tval seed_encoding :
seed Tezos_protocol_environment_024_PtTALLiN.Data_encoding.tval vdf_setup_encoding :
vdf_setup Tezos_protocol_environment_024_PtTALLiN.Data_encoding.tval vdf_solution_encoding :
vdf_solution Tezos_protocol_environment_024_PtTALLiN.Data_encoding.tval seed_status_encoding :
seed_status Tezos_protocol_environment_024_PtTALLiN.Data_encoding.t