A domain-specific language for expressing AIR constraints for STARKs, especially for STARK-based virtual machines like Miden VM.
An in-depth description of AirScript is available in the full AirScript documentation.
WARNING: This project is in an alpha stage. It has not been audited and may contain bugs and security flaws. This implementation is NOT ready for production use.
AirScript is a domain-specific language for writing AIR constraints for the STARK proving system. The primary goal of AirScript is to enable writing and auditing AIR constraints without the need to learn a specific programming language (e.g., Rust). The secondary goal is to perform automated optimizations of constraints and to output constraint evaluator code in multiple target languages (e.g., Rust, Miden assembly, Solidity etc.).
The project is organized into several crates as follows: | Crate | Description |
---|---|---|
Parser | Contains the parser for AirScript. The parser is used to parse the constraints written in AirScript into an AST. | |
IR | Contains the IR for AirScript, AirIR . AirIR is initialized with an AirScript AST, which it converts to an internal representation that can be optimized and used to generate code in multiple target languages. |
|
Winterfell code generator | Contains a code generator targeting the Winterfell prover Rust library. The Winterfell code generator converts a provided AirScript AirIR into Rust code that represents the AIR as a new custom struct that implements Winterfell's Air trait. |
|
AirScript Core | Exports commonly used constants and structs used by the other crates. | |
AirScript | Aggregates all components of the AirScript compiler into a single place and provides a CLI as an executable to transpile AIRs defined in AirScript to the specified target language. Also contains integration tests for AirScript. |
AirScript is an open project and we welcome everyone to contribute! If you are interested in contributing to AirScript, please have a look at our Contribution guidelines. If you want to work on a specific issue, please add a comment on the GitHub issue indicating you are interested before submitting a PR. This will help avoid duplicated effort. If you have thoughts on how to improve AirScript, we'd love to know them. So, please don't hesitate to open issues.
This project is MIT licensed.
git submodule update --init --recursive
cargo run --bin airc -- transpile -i examples/example.air
cp examples/example.rs examples/tests/winterfell/src/example.rs
cargo run --bin winterfell --release
cp examples/example.cairo examples/tests/cairo/
protostar -p unit test