Skip to content

Hash encoding

Hashes are encoded as the pair of a natural number identifier (specifying a particular hash function) and bytes (the output of the hash function).

type Hash := mkHash {
    hashIdentifier : Natural;
    hashBytes : []byte;
};
Identifier Hash function
0x00 - (reserved for the future)
0x01 - (reserved for the future)
0x02 SHA3

We then define the canonical hash function as a switch-case over these particular virtual machines.