fluidex / circuits

GNU Affero General Public License v3.0
10 stars 5 forks source link

research/perf on hash #178

Open lispc opened 3 years ago

lispc commented 3 years ago

poseidon(2):

 $ plonkit analyse  -c testdata/Poseidon_2/circuit.r1cs
[2021-08-12T08:55:46Z INFO  plonkit] Loading circuit from testdata/Poseidon_2/circuit.r1cs...
[2021-08-12T08:55:46Z INFO  plonkit] analyse result: {
      "num_inputs": 4,
      "num_aux": 239,
      "num_variables": 243,
      "num_constraints": 240,
      "num_nontrivial_constraints": 240,
      "num_gates": 935,
      "num_hints": 240
    }
[2021-08-12T08:55:46Z INFO  plonkit] output to analyse.json
[  4:55PM ]  [ zhangzhuo@MacBook-Air-3:~/repos/fluidex/circuits(master✗) ]
 $ npx snarkjs info testdata/Poseidon_2/circuit.r1cs
[INFO]  snarkJS: Curve: bn-128
[INFO]  snarkJS: # of Wires: 243
[INFO]  snarkJS: # of Constraints: 240
[INFO]  snarkJS: # of Private Inputs: 0
[INFO]  snarkJS: # of Public Inputs: 2
[INFO]  snarkJS: # of Labels: 1108
[INFO]  snarkJS: # of Outputs: 1
lispc commented 3 years ago

Rescue(2)

 $ npx snarkjs info testdata/Rescue_2/circuit.r1cs
[INFO]  snarkJS: Curve: bn-128
[INFO]  snarkJS: # of Wires: 399
[INFO]  snarkJS: # of Constraints: 396
[INFO]  snarkJS: # of Private Inputs: 0
[INFO]  snarkJS: # of Public Inputs: 2
[INFO]  snarkJS: # of Labels: 1612
[INFO]  snarkJS: # of Outputs: 1
[  5:02PM ]  [ zhangzhuo@MacBook-Air-3:~/repos/fluidex/circuits(master✗) ]
 $ plonkit analyse  -c testdata/Rescue_2/circuit.r1cs
[2021-08-12T09:02:30Z INFO  plonkit] Loading circuit from testdata/Rescue_2/circuit.r1cs...
[2021-08-12T09:02:30Z INFO  plonkit] analyse result: {
      "num_inputs": 4,
      "num_aux": 395,
      "num_variables": 399,
      "num_constraints": 396,
      "num_nontrivial_constraints": 396,
      "num_gates": 662,
      "num_hints": 396
    }
lispc commented 3 years ago

sha3 of data availability may cost a lot of constraints...

lispc commented 3 years ago

custom gate may help a lot