This repo contains an example of how to manage zk applications with purescript-web3 and arkworks-bridge. The r1cs, witness, and public variable assignment artifacts correspond to the Snarkl sudoku tutorial.
You will need an arkworks-bridge binary in your path in order to generate the verifying smart contract and proof.
We use cliquebait to run the tests. You can use hardhat or foundry/anvil if that suits your needs.
> arkworks-bridge create-trusted-setup --r1cs ./proof-data/sudoku-r1cs.jsonl --proving-key ./proof-data/sudoku-pk --verifying-key ./proof-data/sudoku-vk --ethereum
> arkworks-bridge generate-contract --contract ./contracts/Verifier.sol --verifying-key ./proof-data/sudoku-vk --inputs ./proof-data/sudoku-assignments.jsonl
> npm i
> npm run chanterelle-build
> arkworks-bridge create-proof --proof ./proof-data/sudoku-proof --proving-key ./proof-data/sudoku-pk --r1cs ./proof-data/sudoku-r1cs.jsonl --witness ./proof-data/sudoku-witness.jsonl --ethereum
> docker run --rm -it -p 8545:8545 -d foamspace/cliquebait:latest
> npm run test