This repository goal is to provide a foundation for any developer that needs to implement a Circom circuit that could be used in the reduction phase of the Lurk programing language.
Lurk has a Circom Coprocessor implemented that allows the compilation of Circom circuit to Bellpepper, effectively enabling their usage in the reduction phase. The Circom coprocessor contains what we call a Circom Gadget, an interface acting as a bridge between the Circom circuit and the Circom coprocessor to compile it to Bellpepper.
This repository facilitates the access to the Circom circuit compiled files that the Gadget and the Coprocessor need.
├── .github
| └── workflows
| ├── release_publish.yml # Workflow that will run the tests, compile the circuit and create a release containing them.
| └── release_setup.yml # Workflow used to update the Changelog from Unreleased to the next release tag and create the release PR.
├── circuits # Folder containing our Circom circuits.
├── test # Holds the unit tests to run over our circuits.
└── CHANGELOG.md # Changelog of the project, containing an history of each release. Should always have an Unreleased section updated at each updates.
This repository is a template. You should be able to clone it into your own.
Once you have created your own repository, the first step is to change the different references of the template repository to yours:
- Update the
package.json
name and description. - In
.github/workflows/release_publish.yml
, update the environment variable so thatGITHUB_REPOSITORY
refers to your repository with the format<AUTHOR>/<NAME>
andCIRCUIT_NAME
refers to the<NAME>
of the repository.
❗ The name of the repository and the name of your target circuit file need to be the same (e.g.:
lurk-lab/template-circom-gadget
->template-circom-gadget.circom
).
You can develop new features are you are used to, no changes in that regard. However, it is also needed to update the CHANGELOG.md
Uneleased section when developing new features or making hotfix. This is needed because the workflow we provide will
directly use the content of that section to write the description of the next release.
In order for you to create releases of your Circom Gadget that can be used in Lurk we created to workflow to automate the task:
release_setup.yml
: This workflow takes the next release tag as an input. It should be run directly from the Actions tab of your repository. It will update the Unreleased section of theCHANGELOG.md
to the specified tag and create a release pull request.release_publish.yml
: Triggered once the release PR is closed. It will run the unit tests in the repository, compile the target circuit to generate the r1cs & wasm files, and finally create the release at the specified tag along with the generated files.
The biggest constraint that exists right now is that the name of the static files attached to the release must be the same ones as the repository. This implies one huge problem: there only be one circuit that can be turned in a Circom Gadget per repository.