mirror of
https://github.com/selfxyz/self.git
synced 2026-02-10 06:15:26 -05:00
23 lines
901 B
Bash
Executable File
23 lines
901 B
Bash
Executable File
|
|
mkdir -p build
|
|
cd build
|
|
if [ ! -f powersOfTau28_hez_final_20.ptau ]; then
|
|
echo "Download power of tau...."
|
|
wget https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_20.ptau
|
|
echo "Finished download!"
|
|
else
|
|
echo "Powers of tau file already downloaded... Skip download action!"
|
|
fi
|
|
cd ..
|
|
|
|
echo "compiling circuit"
|
|
circom circuits/proof_of_passport.circom --r1cs --sym --wasm --output build
|
|
|
|
echo "building zkey"
|
|
yarn snarkjs groth16 setup build/proof_of_passport.r1cs build/powersOfTau28_hez_final_20.ptau build/proof_of_passport.zkey
|
|
|
|
echo "building vkey"
|
|
echo "test random" | yarn snarkjs zkey contribute build/proof_of_passport.zkey build/proof_of_passport_final.zkey
|
|
yarn snarkjs zkey export verificationkey build/proof_of_passport_final.zkey build/verification_key.json
|
|
|
|
yarn snarkjs zkey export solidityverifier build/proof_of_passport_final.zkey build/Verifier.sol |