package tezos-protocol-007-PsDELPH1

  1. Overview
  2. Docs
Tezos/Protocol: economic-protocol definition

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-17.3.tar.gz
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc

doc/tezos-protocol-007-PsDELPH1.raw/Tezos_raw_protocol_007_PsDELPH1/Seed_repr/index.html

Module Tezos_raw_protocol_007_PsDELPH1.Seed_reprSource

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

Sourcetype t

The state of the random number generator

Sourcetype seed

A random seed, to derive random sequences from

Sourcetype sequence

A random sequence, to derive random values from

initialize_new state ident returns a new generator

Sourceval sequence : t -> int32 -> sequence

sequence state n prepares the n-th sequence of a state

Generates the next random value in the sequence

Sourceval take_int32 : sequence -> int32 -> int32 * sequence

Generates the next random value as a bounded int32

Predefined seeds

Sourceval empty : seed
Sourceval deterministic_seed : seed -> seed

Returns a new seed by hashing the one passed with a constant.

Sourceval initial_seeds : 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.

Entropy

Sourcetype nonce

A nonce for adding entropy to the generator

Sourceval nonce : seed -> nonce -> seed

Add entropy to the seed generator

Compute the has of a nonce

Sourceval check_hash : nonce -> Nonce_hash.t -> bool

check_hash nonce hash is true if the nonce correspond to the hash

Sourceval nonce_hash_key_part : Nonce_hash.t -> string list -> string list

For using nonce hashes as keys in the hierarchical database

Predefined nonce

Sourceval initial_nonce_0 : nonce
Sourceval initial_nonce_hash_0 : Nonce_hash.t

Serializers

OCaml

Innovation. Community. Security.