Gas and circuit constraint benchmarks of binary and quinary incremental Merkle trees using the Poseidon hash function

Recently, circomlib updated its Poseidon hash functions to conform to the reference implementation: https://github.com/iden3/circomlib/pull/47.

With circomlib v0.2.4, which provides a script to generate Poseidion hash bytecode, the new gas costs and relevant parameters are as follows:

Number of inputs t nRoundsF nRoundsP Gas cost
2 3 8 57 53189
5 6 8 60 121984

The code I used to obtain these measurements is here:

HasherBenchmarks.sol
HasherBenchmarks.test.ts

1 Like