ZkSNARKs (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) or sometimes called "black magic" by some developers are generally considered hard to get into. What if we told you that there is a tool that can make this flow as easy as writing smart contracts? Brace yourself, here comes ZoKrates as a Remix plugin. For documentation on ZoKrates open the . link From Zero to Hero (zkSNARKs edition) We will try to guide you step by step through the process of compiling, setuping, exporting verifier, computing witness and generating proofs. Let's go! First thing first, open in incognito mode. Remix IDE Navigate to plugin manager and activate the following plugins: ZoKrates Solidity Compiler Deploy & Run Transactions Then go to ZoKrates plugin and click on hyperlink and accept needed permissions. example Update the code as you wish (Check official ZoKrates documentation for language reference on ). link Compilation Once ready, compile your program by clicking . Compile If no errors occurred, you should see a successful compilation message. On the right side of the compilation panel, you can choose to or compilation output. Copy Bytecode Download Setup The next step is the . Click on setup to expand and then click . Setup Run Setup If setup was successful you will see this message. You can download and the key by clicking the button. proving verifying Download Keys Export Verifier We can now proceed to the step. Export Verifier By default, version 1 of the ABI is used. You can use version 2 by checking the checkbox before exporting the verifier. Use ABI v2 If everything is successful, you can open the generated verifier in or the verifier. By clicking button, the plugin will create and open file in Remix Editor. Verifier compilation and deployment is explained further on. Remix Editor Download Open in Remix Editor verifier.sol Compile and deploy a verifier.sol Now let’s compile and deploy a verifier.sol. First, go to plugin and click on the compile . Solidity Compiler verifier.sol Once that is finished go to plugin and choose 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.) Deploy & run transactions Verifier - browser/verifier.sol Once we’ve finished this, let’s return to and part in ZoKrates. Compute Witness Generate Proof Compute Witness A will ask you for input parameters. Once you fill the fields, click on button to generate the witness. Compute Witness Compute If executed without errors, a success message will appear. You can examine the witness by opening it in Remix Editor. You can also download the witness if you wish. Generate Proof Last step is . Click on . The output shown below should be shown. Generate Proof Generate 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 which is a correctly formatted proof we use in the next step. remix compatible parameters You can , or it. Copy Output Open in Remix Editor Download Verify Now to validate the proof, go to plugin and paste the remix compatible parameters into field and click on the transact button. Deploy & Run Transactions verifyTx After the transaction finishes executing, expand the logs and check the part. It should say . That means that the transaction is successfully verified. decoded output "0": "bool: r true" That's basically it. We've succeed! Now you are a ZoKrates ninja. Welcome to the club. It seems in the end that zkSNARKs are not that hard, don't you agree? ;) Thanks to for the help. dark64