package octez-proto-libs

  1. Overview
  2. Docs
Octez protocol libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V6/Make/Timelock/index.html

Module Make.TimelockSource

type chest = Tezos_crypto.Timelock_legacy.chest

Contains a value (the decryption of the ciphertext) that can be provably recovered in time sequential operation or with the rsa secret.

val chest_encoding : chest Data_encoding.t
type chest_key = Tezos_crypto.Timelock_legacy.chest_key

Provably opens a chest in a short time.

val chest_key_encoding : chest_key Data_encoding.t
type opening_result = Tezos_crypto.Timelock_legacy.opening_result =
  1. | Correct of Bytes.t
  2. | Bogus_cipher
  3. | Bogus_opening

Result of the opening of a chest. The opening can fail in two way which we distinguish to blame the right person. One can provide a false unlocked_value or unlocked_proof, in which case we return Bogus_opening and the provider of the chest key is at fault. Otherwise, one can lock the wrong key or put garbage in the ciphertext in which case we return Bogus_cipher and the provider of the chest is at fault. Otherwise we return Correct payload where payload was what had originally been put in the chest.

val open_chest : chest -> chest_key -> time:int -> opening_result

Takes a chest, chest key and time and tries to recover the underlying plaintext. See the documentation of opening_result.

val get_plaintext_size : chest -> int

Gives the size of the underlying plaintext in a chest in bytes. Used for gas accounting

OCaml

Innovation. Community. Security.