air-script

air-script

A domain-specific language for writing AIR constraints for STARKs

Stars: 90

Visit
 screenshot

AirScript is a domain-specific language for expressing AIR constraints for STARKs, with the goal of enabling writing and auditing constraints without the need to learn a specific programming language. It also aims to perform automated optimizations and output constraint evaluator code in multiple target languages. The project is organized into several crates including Parser, MIR, AIR, Winterfell code generator, ACE code generator, and AirScript CLI for transpiling AIRs to target languages.

README:

AirScript

LICENSE test build RUST_VERSION Crates.io

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.

Overview

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.).

Project Structure

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.
MIR Contains the middle intermediate representation (MIR). The purpose of the MIR is to provide a representation of an AirScript program that allows for optimization and translation to AirIR containing the AlgebraicGraph.
AIR Contains the IR for AirScript, AirIR. AirIR is initialized with an AirScript MIR, 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.
ACE code generator Contains a code generator targeting Miden VM's ACE (Arithmetic Circuit Evaluation) chiplet. Converts AirScript constraints into arithmetic circuits optimized for recursive STARK proof verification within Miden assembly programs.
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.

Contributing to 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.

References

  1. Logos: Library for generating fast lexers in Rust.
  2. LALRPOP: LR(1) Rust parser generator framework.
  3. Codegen: Library for generating Rust code.
  4. mdBook: Utility for creating online documentation books.

License

This project is MIT licensed.

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for air-script

Similar Open Source Tools

For similar tasks

For similar jobs