mirror of
https://github.com/babybear-labs/benchmark.git
synced 2026-05-01 03:00:33 -04:00
Update README.md for circom
This commit is contained in:
@@ -1,40 +1,10 @@
|
||||
# Benchmark Circuits
|
||||
[](https://github.com/iden3/circom)
|
||||
[](https://github.com/iden3/snarkjs)
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
This repository is dedicated to a powerful and user-friendly framework designed for testing various circuits using Circom. Our main objective is to simplify the testing process, allowing developers to easily add new circuits and conduct reliable tests.
|
||||
|
||||
**Key features of the framework:**
|
||||
|
||||
1. **Extensibility:** The framework is highly extensible. To add new circuits, simply follow a few clear rules and place the circuits in the `circuits/base` folder. Additionally, provide a commented `main` file following the appropriate formatting.
|
||||
|
||||
2. **Easy Customization:** You can effortlessly customize circuit values using Python. Just make the necessary changes in the files `test_circuits.py` to adapt it to the new circuit.
|
||||
|
||||
|
||||
**Getting Started:**
|
||||
|
||||
1. Clone this repository to your local system.
|
||||
2. Add new circuits to the `circuits/base` folder.
|
||||
3. Modify the `main` line of the circuit with the correct formatting and values to be customized in Python.
|
||||
4. Edit the files `test_circuits.py` to adapt it to the new circuit, updating the circuit name, powersoftau, and other parameters as needed.
|
||||
5. Run the benchmark to ensure the circuit functions correctly.
|
||||
|
||||
**Troubleshooting**
|
||||
If you get any error, take care of properly set the following parameters:
|
||||
* In `scripts/compile_circuit.sh`, properly set `CIRCOMLIB_PATH` path. If `circomlib` is not installed, run: `npm install circomlib`.
|
||||
* In `test_circuits.py`, properly set `POT` variable with the path to the `*.ptau` file (download it from [here](https://github.com/iden3/snarkjs#7-prepare-phase-2)). It should be in `poweroftau` directory but it can be elsewhere.
|
||||
* In `scripts/proving_system/prover.sh`, properly set `RAPIDSNARK` variable with the path to the `build/prover` executable. For information on how to install Rapidsnark visit [here](https://github.com/iden3/rapidsnark)
|
||||
|
||||
**Contributions are Welcome:**
|
||||
|
||||
[](https://choosealicense.com/licenses/mit/)
|
||||
|
||||
We are open to contributions from the community to improve this framework and make it even more useful. Feel free to open issues, propose enhancements, or submit pull requests.
|
||||
|
||||
Thank you for choosing our framework. We hope it simplifies your Circom testing work and contributes to your success in developing secure and efficient circuits.
|
||||
|
||||
1. Run npm install.
|
||||
2. Download powersoftau file from [here](https://github.com/iden3/snarkjs#7-prepare-phase-2). It should be stored in `poweroftau` directory in this project.
|
||||
3. In `scripts/compile_circuit.sh`, properly set `CIRCOMLIB_PATH` path to npm_modules.
|
||||
4. Update the size of input for circuits in their test files.
|
||||
5. For benchmarking run the following code:
|
||||
Poseidon: python3 test_poseidon.py
|
||||
Fibonacci: python3 test_fibonacci.py
|
||||
SHA256: python3 test_sha256.py
|
||||
|
||||
Reference in New Issue
Block a user