Zero-Knowledge Proof of SHA256 Hash using zkSNARK

This article provides you sufficient commands to run zkSNARK algorithm with circom circuits on a Ubuntu Docker image to prove SHA256 hash.

Binod Karunanayake
2 min readApr 30, 2024

If you are just testing for educational purposes, I recommend to use Docker for cleaner setup. However, if you wish to run the zkSNARK program on your machine, you can start from Install Prerequisites section.

Setup Ubuntu Instance on Docker

  1. docker run -it ubuntu:jammy
  2. apt update
  3. apt install curl
  4. apt install nano

Install Prerequisites

  1. apt install build-essential
  2. curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh (proceed with standard installation)
  3. . "$HOME/.cargo/env"
  4. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  5. nvm install 20
  6. export NVM_DIR="$HOME/.nvm"
  7. [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
  8. apt install git-all
  9. git clone https://github.com/iden3/circom.git

--

--

Binod Karunanayake
Binod Karunanayake

Written by Binod Karunanayake

PhD Candidate @RMIT University | Former Software Engineer @WSO2 | BSc Engineering (Hons) University of Moratuwa

No responses yet