The Poseidon Hash
Used for the different purposes
The Poseidon is a hash function designed for zero-knowledge proof systems like zkSNARKs. It operates over the prime field. The main advantage of the Poseidon hash is simplification in circuits building.
The Poseidon contains a series of rounds each based on input permutations (add constants, exponentiation and mixing). An S-box routine is just an exponentiation number in the field (the power of 5).
The round constants and S-box operations count depend on the parameter set. The Poseidon parameters are a tuple , where
is a number of S-box routines in one round. It also specifies an input dimension: hash function supports up to input numbers.
is a full rounds count ( S-box routines)
is a partial rounds count (single S-box routine)
is a round constants array ( dimension)
is a square array used for a mixing function ( dimension)
The Poseidon routine produces a resulting hash (over prime field) after rounds.
As mentioned previously there are different parameter sets used for hashes in the Merkle tree. These hash types are explained in the table below. The parameter set is presented in the reduced form (just a tuple):
Label | Parameters | Hash purpose | Inputs |
---|---|---|---|
| 2, 8, 56 | Key derivation ( and ) | Transaction verifier key or diversifier |
/ | 3, 8, 56 | Merkle tree's node; Nullifier | two child nodes or leafs; Account hash and intermediate nullifier hash (details) |
/ | 4, 8, 56 | EDDSA sign and verify; Intermediate nullifier hash (inh) | |
5, 8, 56 | Note hash | (details) | |
/ | 6, 8, 57 | Account hash; Transaction hash |
Poseidon specification
This page provides just a simple description of the Poseidon hash function. For additional details please refer to the original publication. It contains exhaustive materials, security investigations, implementation details, proof system applications and so on.
Last updated