A Plutus implementation of the Groth16 ZKP-verification algorithm.
Implemented and tested a zk-SNARK using a basic implementation of Miller's algorithm and the toy elliptic curve BLS6_6.
We assume that you have cloned Plutus-Apps and have Nix installed and configured with the proper substituters. At the Plutus-Apps directory, execute
git checkout v1.0.0
nix-shellAfter allowing enough time for the nix-shell to start, execute
cabal replThe REPL should open in module Test_BLS6_6.
Inside the REPL, execute:
testValidator1Directory src/BLS6_6 provides:
Params_BLS6_6: global parameters associated with elliptic curve BLS6_6.ZKPPVerification_BLS6_6: identical toZKPVerification.hsexcept that imports BLS6_6 parameters.Test_BLS6_6: allows convenient testing of the validator in the REPL.
-
Elliptic curve
BLS6_6is described in detail in [1]. -
Datum in file
Test_BLS6_6.hswas obtained from the ZK-SNARK setup and proof associated with the 3-factorization problem as explained in [1].