visit
Then go to ZoKrates plugin and click on example hyperlink and accept needed permissions.
Once ready, compile your program by clicking Compile.
On the right side of the compilation panel, you can choose to Copy Bytecode or Download compilation output.
The next step is the Setup. Click on setup to expand and then click Run Setup.
If setup was successful you will see this message. You can download proving and verifying the key by clicking the Download Keys button.
We can now proceed to the Export Verifier step.
By default, version 1 of the ABI is used. You can use version 2 by checking the Use ABI v2 checkbox before exporting the verifier.
If everything is successful, you can open the generated verifier in Remix Editor or Download the verifier. By clicking Open in Remix Editor button, the plugin will create and open verifier.sol file in Remix Editor. Verifier compilation and deployment is explained further on.
First, go to Solidity Compiler plugin and click on the compile verifier.sol.
Once that is finished go to Deploy & run transactions plugin and choose Verifier - browser/verifier.sol from the dropdown list and click deploy. (You can deploy it inside JavaScript VM or on any other testnet or mainnet. Be cautious, as these are big contracts and will consume a lot of gas.)
Once we’ve finished this, let’s return to Compute Witness and Generate Proof part in ZoKrates.
A Compute Witness will ask you for input parameters. Once you fill the fields, click on Compute button to generate the witness.
Last step is Generate Proof. Click on Generate. The output shown below should be shown.
If you remember from before, depending on the ABI version that we used on the export verifier step (ABI v1 vs ABI v2), the expected format of proof in the verifier is different. For ease of use, you can copy remix compatible parameters which is a correctly formatted proof we use in the next step.
You can Copy Output, Open in Remix Editor or Download it.
Now to validate the proof, go to Deploy & Run Transactions plugin and paste the remix compatible parameters into verifyTx field and click on the transact button.
After the transaction finishes executing, expand the logs and check the decoded output part. It should say "0": "bool: r true". That means that the transaction is successfully verified.
Thanks to dark64 for the help.