The genesis document contains a set of parameters that outline the initial state of the consensus layer and its services.
For more details about the actual genesis document’s API, see genesis API documentation.
Genesis Document’s Hash
The genesis document’s hash is computed as:
Base16()represents the hex encoding function,
SHA512-256()represents the SHA-512/256 hash function as described in Cryptography documentation,
CBOR()represents the canonical CBOR encoding function as described in Serialization documentation, and
<genesis-document>represents a given genesis document.
This should not be confused with a SHA-1 or a SHA-256 checksum of a genesis file that is used to check if the downloaded genesis file is correct.
A genesis file is a JSON file corresponding to a serialized genesis document.
For a high-level overview of the genesis file, its sections, parameters and the parameter values that are used for the Oasis Network, see: Genesis File Overview.
The canonical form of a genesis file is the pretty-printed JSON file with 2-space indents ending with a newline, where:
- Struct fields are encoded in the order in which they are defined in the corresponding struct definitions.The genesis document is defined by the
genesis/api.Documentstruct which contains pointers to other structs defining the genesis state of all consensus layer services.
- Maps have their keys converted to strings which are then encoded in lexicographical order.This is Go’s default behavior. For more details, see
This should not be confused with the canonical CBOR encoding of the genesis document that is used to derive the domain separation context as described in the Genesis Document’s Hash section.
This form is used to enable simple diffing/patching with the standard Unix tools (i.e.