package tezos-protocol-alpha
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/tezos_raw_protocol_alpha/Tezos_raw_protocol_alpha/Seed_repr/index.html
Module Tezos_raw_protocol_alpha.Seed_repr
Source
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.
Random Generation
A random seed, to derive random sequences from
type vdf_setup =
Tezos_protocol_environment_alpha.Vdf.discriminant
* Tezos_protocol_environment_alpha.Vdf.challenge
A VDF discriminant and challenge
type vdf_solution =
Tezos_protocol_environment_alpha.Vdf.result
* Tezos_protocol_environment_alpha.Vdf.proof
A VDF result, to derive a seed from
Compare only the first element of two vdf_solution, that are of Vdf.result
.
val verify :
vdf_setup ->
Tezos_protocol_environment_alpha.Int64.t ->
vdf_solution ->
bool option
Entropy
A nonce for adding entropy to the generator
Use a byte sequence as a nonce
Compute the hash of a nonce
check_hash nonce hash
is true if the nonce correspond to the hash
For using nonce hashes as keys in the hierarchical database
Returns a new seed by hashing the one passed with a constant.
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.