Mavros is a toolchain for compiling Noir to R1CS with additional functionality for use with Spartan. It provides a complete pipeline from Noir source to the output of the eventual circuit, and is designed with mobile proving workflows in mind.
This project uses Nix flakes to provide a
pinned build environment with all the tools you need to build the project. Assuming you have nix
installed, simply make shell to drop into your user shell inside the build environment, or run
nix develop --command <your-command-here> to run a specific command in the build environment.
You can use one of the two following methods to experiment with Mavros.
- Running
make installwill build and install Mavros to your cargo binary directory. - Running
make releasewill build Mavros to./target/release/mavros.
Run make to get an overview of the available utilities and targets. For complete guidance please
see our contributing guidelines. See usage below for more
information on how to use Mavros.
To use Mavros, navigate to the root of a Noir project (the directory containing Nargo.toml) in
your shell. Then run mavros compile.
This will produce the following two files inside the project's target/ directory:
| File | Contents |
|---|---|
target/basic.json |
ABI, witness-generation binary (witgen_binary), and AD binary (ad_binary) |
target/r1cs.bin |
Serialised R1CS constraint system (bincode) |
For advanced usage and the CLI options, run mavros --help. To output the witness generation binary
for WASM-capable platforms, please see the WASM output
section in our contributing docs.
cd my-noir-project
mavros compile
# → target/basic.json
# → target/r1cs.binFor the current status of Mavros' support for various Noir constructs, see the status doc that is generated by CI on every update. This provides information on how far the Mavros pipeline gets for each Noir test.