Hasher circuit

The hasher circuit computes the Pedersen hash value of the given inputs.

Inputs

Both nullifier and secret values are generated when a user deposits a token into a voting contract.

Pseudocode namezk-SNARK input typeDescription
nullifierPublicA random 𝑘 value such that 𝑘 ∈ ð”đ248.
secretPublicA random 𝑟 value generated such that 𝑟 ∈ ð”đ248.

Outputs

The outputs of the Hasher circuit are computed outputs of hash function 𝘏1 such that 𝘏1:ð”đ → â„Īp.

Let 𝘏1 be the Pedersen hash function which is imported from circomlib library here.

Pesudocode namezk-SNARK input typeDescription
commitmentPublicA value ðķ such that ðķ = 𝘏1(𝑘âˆĨ𝑟).
nullifierHashPublicA value ℎ output of ℎ = 𝘏1(𝑘).