themighty1 dfd27d8e1c add diagram
2022-06-03 22:27:42 +03:00
2022-06-03 22:27:42 +03:00
2022-06-02 14:44:35 +03:00
2022-06-02 14:44:35 +03:00
2022-06-02 14:44:35 +03:00
2022-06-02 14:56:32 +03:00
2022-06-02 14:44:35 +03:00

This repo generates a circom circuit which is used to decode output labels from GC.

Install snarkjs https://github.com/iden3/snarkjs
Download powers of tau^14 https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_14.ptau

Run:
python3 script.py 10
# 10 is how much plaintext (in Field elements of ~32 bytes) we want
# to decode inside the snark. (For tau^14 max is 21)
# if you need more than 21, you'll need to download another ptau file from 
# https://github.com/iden3/snarkjs#7-prepare-phase-2
circom circuit.circom --r1cs --wasm --sym
snarkjs r1cs export json circuit.r1cs circuit.r1cs.json
cd circuit_js/ && node generate_witness.js circuit.wasm ../input.json ../witness.wtns && cd .. 
snarkjs groth16 setup circuit.r1cs powersOfTau28_hez_final_14.ptau circuit_0000.zkey
snarkjs zkey contribute circuit_0000.zkey circuit_0001.zkey --name="1st" -v -e="kkk" # 10 sec one-time
snarkjs zkey contribute circuit_0001.zkey circuit_final.zkey --name="2nd" -v -e="Another"
snarkjs zkey export verificationkey circuit_final.zkey verification_key.json
snarkjs groth16 prove circuit_final.zkey witness.wtns proof.json public.json
snarkjs groth16 verify verification_key.json public.json proof.json
Description
No description provided
Readme 22 MiB
Languages
Circom 85.1%
Rust 14.5%
JavaScript 0.4%