Lab preparation

Let's go through the steps to get started in circuit creation. We just need to create a rust repo (don't forget to ensure you are using the nightly toolchain) and add the relevant dependencies to the cargo.toml file

  1. Open your code editor and go to folder where you will want to create your repo, then in the terminal you can run cargo init repo_name

  2. Now you will have a repo with a cargo.toml file and a src folder (with a main file in it)

  3. In the cargo.toml file, copy in the dependencies and dev-dependencies in the code block below

  4. Now your repo is ready to go, all other relevant code will be provided along the way in the labs


These dependencies may change over time due to breaking changes - if they do not work then check the github tutorial code to see if they match. If they don't match then try the dependencies from github (if those don't work then you might have to debug yourself...)

Another thing to check is the nightly version you are using, there is a rust-toolchain file in the repo too.

[dependencies]
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2022_10_22"   }
halo2wrong = { git = "https://github.com/privacy-scaling-explorations/halo2wrong.git", default-features = false, tag = "v2022_10_22"  }
ecdsa = { git = "https://github.com/privacy-scaling-explorations/halo2wrong.git", tag = "v2022_10_22"  }
ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong.git", tag = "v2022_10_22"  }
integer = { git = "https://github.com/privacy-scaling-explorations/halo2wrong.git", tag = "v2022_10_22"  }
maingate = { git = "https://github.com/privacy-scaling-explorations/halo2wrong.git", tag = "v2022_10_22"  }
zkevm-circuits = { git = "https://github.com/EDGDrummond/zkevm-circuits.git", rev="1e8637233bb53c12f1b12937e73f863c444e4e9e" }
rayon = "1.5.1"
rand_core = { version = "0.6", default-features = false }
pairing = { git = 'https://github.com/EDGDrummond/pairing', package = "pairing_bn256"} 
num-integer = "0.1.45"
num-bigint = "0.4.3"
num-traits = "0.2.15"
group = "0.12.0"
rand = "0.8.5"
ff = "0.12"

[dev-dependencies]
assert_matches = "1.5"
criterion = "0.3"

Last updated