Mavryk_raw_protocol_001_PtAtLas.Seed_repr
Tezos 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 =
Mavryk_protocol_environment_001_PtAtLas.Vdf.discriminant
* Mavryk_protocol_environment_001_PtAtLas.Vdf.challenge
A VDF discriminant and challenge
type vdf_solution =
Mavryk_protocol_environment_001_PtAtLas.Vdf.result
* Mavryk_protocol_environment_001_PtAtLas.Vdf.proof
A VDF result, to derive a seed from
val pp_solution :
Mavryk_protocol_environment_001_PtAtLas.Format.formatter ->
vdf_solution ->
unit
val compare_vdf_solution : vdf_solution -> vdf_solution -> int
Compare only the first element of two vdf_solution, that are of Vdf.result
.
val verify :
vdf_setup ->
Mavryk_protocol_environment_001_PtAtLas.Int64.t ->
vdf_solution ->
bool option
val vdf_to_seed : seed -> vdf_solution -> seed
take_int32 s bound
generates the next random value as a bounded int32
take_int64 s bound
generates the next random value as a bounded int64
val make_nonce :
bytes ->
nonce Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Use a byte sequence as a nonce
val hash : nonce -> Nonce_hash.t
Compute the hash of a nonce
val check_hash : nonce -> Nonce_hash.t -> bool
check_hash nonce hash
is true if the nonce correspond to the hash
val nonce_hash_key_part : Nonce_hash.t -> string list -> string list
For using nonce hashes as keys in the hierarchical database
val initial_seeds : ?initial_seed:State_hash.t -> int -> seed list
initial_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 initial_nonce_0 : nonce
val initial_nonce_hash_0 : Nonce_hash.t
val nonce_encoding :
nonce Mavryk_protocol_environment_001_PtAtLas.Data_encoding.t
val seed_encoding :
seed Mavryk_protocol_environment_001_PtAtLas.Data_encoding.t
val vdf_setup_encoding :
vdf_setup Mavryk_protocol_environment_001_PtAtLas.Data_encoding.t
val vdf_solution_encoding :
vdf_solution Mavryk_protocol_environment_001_PtAtLas.Data_encoding.t
val seed_status_encoding :
seed_status Mavryk_protocol_environment_001_PtAtLas.Data_encoding.t