Install Solidity
brew install solidity
Install Go:
brew install golang
Install abigen:
go install github.com/ethereum/go-ethereum/cmd/[email protected]
-
Look at
circuit/circuit.go
, this is the circuit definition -
Generate gnark internal representation of the circuit:
go run main.go generate
-
View the solidity smart contract
RSA.G16.sol
andRSA.PLONK.sol
(other files with same prefix are proving key, veriyfing key and compiled arithmetisation) -
Generate ABI and bytecode:
make all
-
Run the tests:
go run main.go testGroth16 go run main.go testPlonk
You can have a look at
main.go
on how to compile, deploy and run. -
For cleanup, run:
make clean
-
To cleanup setup files, run:
make clean-setup
This makes it impossible to generate proofs anymore for any smart contract deployed with the verifying key. Use with care
This is only an example how to verify gnark proofs. In practice the setups can be split into smaller parts and the keys should be generated using MPC.