package tezos-protocol-017-PtNairob

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Tezos_raw_protocol_017_PtNairob.Nonce_storageSource

This module provides types and functions to manipulate nonces.

A nonce is a byte sequence of fixed length, which is supposed to be random and used only once, provided by a block producer and used to generate a random seed (see Seed_repr).

Sourcetype nonce = t
Sourcetype Tezos_protocol_environment_017_PtNairob.Error_monad.error +=
  1. | Too_late_revelation
  2. | Too_early_revelation
  3. | Already_revealed_nonce
  4. | Inconsistent_nonce
Sourcetype status =
  1. | Unrevealed of unrevealed
  2. | Revealed of Seed_repr.nonce
Sourcetype nonce_presence =
  1. | No_nonce_expected
  2. | Nonce_expected of status

Checks that a nonce revelation operation can be safely applied.

  • returns

    Error Too_early_revelation if the current cycle is the cycle 0 or if the previous cycle is lesser than the cycle of the input level.

  • returns

    Error Too_late_revelation if the previous cycle is greater than the cycle of the input level. This error is also returned if the current level cycle position is greater or equal to the nonce revelation threshold.

  • returns

    Error Already_revealed_nonce if a nonce is already revealed in the context for the input level.

  • returns

    Error Inconsistent_nonce if the hash of the input nonce does not correspond to the nonce recover from the context for the given level.

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

Innovation. Community. Security.