Zero-Knowledge Proofs Using SnarkJS and Circom

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • circom

    zkSnark circuit compiler

  • git clone https://github.com/iden3/circom.git cd circom cargo build --release cargo install --path circom

  • circomlib

    Library of basic circuits for circom

  • The other thing we need is the circomlib. Circomlib is a programming library with many useful predefined circuits. So, create an empty project, and install circomlib using this code:

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • snarkjs

    zkSNARK implementation in JavaScript & WASM

  • The generated wasm and r1cs files are available in the build folder. To generate the proof, we need a proving key file, and to generate this file, we need a ptau file. This ptau file can be generated by snarkjs, or you can download a pregenerated one (you can find the links in the snarkjs repo). For testing, the generated one is good for us, but in your production app, it’s recommended to do the ceremony and generate your own ptau file. (You can read about it in my previous article.)

  • circomlibjs

    Javascript library to work with circomlib circuits

  • Circomlib has a JS implementation that can be used for this. Let’s install it:

  • tornado-core

    Discontinued Tornado cash. Non-custodial private transactions on Ethereum.

  • This was my very short tutorial on using zk-SNARK in JavaScript. It’s not a full course, and you probably have many questions, but I hope I helped you to start your journey. Circom and snarkjs are well documented, and you can also learn a lot from existing projects like Tornado Cash.

  • zksnark-tutorial

    JavaScript tutorial for Zero-Knowledge Proofs using SnarkJS and Circom

  • The source codes for this tutorial are available in this GitHub repo.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts