-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (38 loc) · 1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: all
all: install
.PHONY: install
install:
maturin build --release --out dist
pip3 install snarkpy --find-links dist
.PHONY: install-dev
install-dev:
maturin develop --release -E dev
.PHONY: test
test: install-dev
pytest tests -vv
.PHONY: test-data
test-data: zkey vkey wtns
.PHONY: clean
clean:
rm -f circom
rm -f ptau
rm -rf circuits
rm -f zkey
rm -f vkey
rm -f wtns
circom:
wget https://github.com/iden3/circom/releases/latest/download/circom-linux-amd64 -O circom
chmod u+x circom
ptau:
wget https://storage.googleapis.com/zkevm/ptau/powersOfTau28_hez_final_12.ptau -O ptau
circuits: circom
npm install
mkdir circuits
./circom circuit.circom --wasm --r1cs --sym -o circuits
zkey: circuits ptau
npx snarkjs plonk setup circuits/circuit.r1cs ptau zkey
vkey: circuits zkey
npx snarkjs zkey export verificationkey zkey vkey
wtns: circuits
echo '{ "inputs": 1337 }' > circuits/input.json
node circuits/circuit_js/generate_witness.js circuits/circuit_js/circuit.wasm circuits/input.json wtns