Installation
How do I put Circom on my computer?
If you just want to play with basic circuits, you may find zkrepl.dev to be a lightweight option. Otherwise, you will need to install rust to build and install the Circom binary on your machine. This is the only time you will have to use Rust.
Install the Circom Binary
Installing dependenciesYou need several dependencies in your system to run
circomand its associated tools.
The core tool is the
circomcompiler which is written in Rust. To have Rust available in your system, you can installrustup. If you’re using Linux or macOS, open a terminal and enter the following command:curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
We also distribute a series of npm packages so
Node.jsand some package manager likenpmoryarnshould be available in your system. Recent versions ofNode.jsinclude big integer support and web assembly compilers that help run code faster, so to get a better performance, install version 10 or higher.
Installing circomTo install from our sources, clone the
circomrepository:git clone https://github.com/iden3/circom.gitEnter the circom directory and use the cargo build to compile:
cargo build --releaseThe installation takes around 3 minutes to be completed. When the command successfully finishes, it generates the
circombinary in the directorytarget/release. You can install this binary as follows:cargo install --path circomThe previous command will install the
circombinary in the directory$HOME/.cargo/bin.Now, you should be able to see all the options of the executable by using the
helpflag . ..
Installing SnarkJS for Development
The officially recommended installation for SnarkJS is use npm or yarn to install the package globally. This enables SnarkJS from the command line.
npm i -g snarkjs
snarkjs
// should show help output if installed correctly
snarkjs g16... // how commands are formed in bashFor the purpose of version control, we hold the opinion that it is better to install SnarkJS at the application level rather than globally. We will use this convention throughout awesome-circom.
yarn add snarkjs
yarn snarkjs
// should show help output if installed correctly
yarn snarkjs g16... // how commands are formed in bash See the SnarkJS section for more information on the usage of SnarkJS, including production installation.
SnarkJSLast updated