BattleZips
  • Awesome Circom
  • πŸ”¬Theory
    • Prerequisite Knowledge
    • Resources
      • White Papers & PDF's
      • Blogs and Writeups
      • Videos
      • Important Entities
      • Communities
    • Proving Schemes
    • Primitives
      • Hash Functions
      • Public Key Cryptosystems
        • Note on L1 key registry β†’ L2 hot key + callback to circuit-optimized hash functions
        • ECDSA & secp256k1
        • EdDSA
      • Merkle Trees
        • What is a Merkle Tree?
        • What is a merkle proof of inclusion?
        • zk-kit
        • Incremental Merkle Trees
        • Sparse Merkle Trees
        • Tree Arity (Binary, Quinary)
      • Semaphore
      • Arithmetic Circuits
  • πŸ—οΈDevelopment
    • Circom Language
      • Installation
      • IDE
      • Signals and Variables
      • Signal Assignment and Constraint Generation
      • Conditional Statements
      • Components and Templates
      • Circuit Compilation
      • Syntax
    • SnarkJS
      • Proving Schemes
      • Powers of Tau
      • ZK Keys
      • Zero Knowledge Proofs
      • On-Chain ZKP
      • Page 2
    • circomlib
      • Basic Math Constraints
      • Multiplexing
      • Hashing
      • EdDSA
      • circomlibjs
    • circom-tester
    • hardhat-circom
    • SHIELD
    • Circomspect
  • πŸŒ†Ecosystem
    • Circom vs Other Solutions
      • Domain-Specific Languages
      • ZK Virtual Machines
      • ZK Ethereum Virtual Machines
    • Communities to Join
    • Recorded Content
    • Projects
  • πŸ›³οΈExamples
    • BattleZips V1
      • On the BattleZips Project
      • Docs holder
        • Join Game UML Sequence Diagram
        • Play Game UML Sequence Diagram
        • End Game UML Sequence Diagram
      • ZK Privacy Stack
      • Deploying Artifacts to Prod
      • Browser Client
    • RollupNC
      • Smart Contracts
      • Account/ State Tree
      • Transaction Tree
      • Layer 1 Deposits to Layer 2
      • Layer 2 Transacting
      • Layer 2 Withdrawals to Layer 1
Powered by GitBook
On this page
  • Install the Circom Binary
  • Installing SnarkJS for Development
  1. Development
  2. Circom Language

Installation

How do I put Circom on my computer?

PreviousCircom LanguageNextIDE

Last updated 2 years ago

If you just want to play with basic circuits, you may find 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 dependencies

You need several dependencies in your system to run circom and its associated tools.

  • The core tool is the circom compiler which is written in Rust. To have Rust available in your system, you can install rustup. 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.js and some package manager like npm or yarn should be available in your system. Recent versions of Node.js include big integer support and web assembly compilers that help run code faster, so to get a better performance, install version 10 or higher.

Installing circom

To install from our sources, clone the circom repository:

git clone https://github.com/iden3/circom.git

Enter the circom directory and use the cargo build to compile:

cargo build --release

The installation takes around 3 minutes to be completed. When the command successfully finishes, it generates the circom binary in the directory target/release. You can install this binary as follows:

cargo install --path circom

The previous command will install the circom binary in the directory $HOME/.cargo/bin.

Now, you should be able to see all the options of the executable by using the help flag . .

.

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 bash

For 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.

πŸ—οΈ
SnarkJS
Quoted from the Circom docs
zkrepl.dev