Cairo is the first Turing-complete language for creating provable programs for general computation.
Rust
1,911
9,100 commits
updated Oct 12, 2026
Cairo is the first Turing-complete language for creating provable programs for general computation.
rustup override set stable && rustup update
Ensure Rust was installed correctly by running the following from the root project directory:
cargo test
Compile Cairo to Sierra:
cargo run --bin cairo-compile -- --single-file /path/to/input.cairo /path/to/output.sierra --replace-ids
Compile Sierra to casm (Cairo assembly):
cargo run --bin sierra-compile -- /path/to/input.sierra /path/to/output.casm
Run Cairo code directly:
cargo run --bin cairo-run -- --single-file /path/to/file.cairo
See more information here. You can also find Cairo examples in the examples directory.
For running tests specifically, see here: cairo-test
Compile a Starknet contract from a crate/project path to a Sierra ContractClass:
cargo run --bin starknet-compile -- /path/to/input/crate /path/to/output.json
If multiple contracts are defined in the same crate/project, specify --contract-path:
cargo run --bin starknet-compile -- /path/to/input/crate /path/to/output.json --contract-path path::to::contract
For a single-file .cairo input, use --single-file:
cargo run --bin starknet-compile -- --single-file /path/to/input.cairo /path/to/output.json
Compile a Sierra ContractClass to a CASM CompiledClass:
cargo run --bin starknet-sierra-compile -- /path/to/input.json /path/to/output.casm
If you want to say thank you and/or support active development of Cairo:
Together, we can make Cairo better!
First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please read our contribution guidelines, and thank you for being involved!
For a full list of all authors and contributors, see the contributors page.
Cairo follows good practices of security, but 100% security cannot be assured. Cairo is provided "as is" without any warranty. Use at your own risk.
For more information and to report security issues, please refer to our security documentation.
This project is licensed under the Apache 2.0 license.
See LICENSE for more information.
(top 24 of 30)
1,052 followers · starred Jan 2025
1,232 followers · starred Jun 2024
193 followers · starred Nov 2022
139 followers · starred Apr 2023
Cairo is the first Turing-complete language for creating provable programs for general computation.
Rust
1,911
9,100 commits
updated Oct 12, 2026
Cairo is the first Turing-complete language for creating provable programs for general computation.
rustup override set stable && rustup update
Ensure Rust was installed correctly by running the following from the root project directory:
cargo test
Compile Cairo to Sierra:
cargo run --bin cairo-compile -- --single-file /path/to/input.cairo /path/to/output.sierra --replace-ids
Compile Sierra to casm (Cairo assembly):
cargo run --bin sierra-compile -- /path/to/input.sierra /path/to/output.casm
Run Cairo code directly:
cargo run --bin cairo-run -- --single-file /path/to/file.cairo
See more information here. You can also find Cairo examples in the examples directory.
For running tests specifically, see here: cairo-test
Compile a Starknet contract from a crate/project path to a Sierra ContractClass:
cargo run --bin starknet-compile -- /path/to/input/crate /path/to/output.json
If multiple contracts are defined in the same crate/project, specify --contract-path:
cargo run --bin starknet-compile -- /path/to/input/crate /path/to/output.json --contract-path path::to::contract
For a single-file .cairo input, use --single-file:
cargo run --bin starknet-compile -- --single-file /path/to/input.cairo /path/to/output.json
Compile a Sierra ContractClass to a CASM CompiledClass:
cargo run --bin starknet-sierra-compile -- /path/to/input.json /path/to/output.casm
If you want to say thank you and/or support active development of Cairo:
Together, we can make Cairo better!
First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please read our contribution guidelines, and thank you for being involved!
For a full list of all authors and contributors, see the contributors page.
Cairo follows good practices of security, but 100% security cannot be assured. Cairo is provided "as is" without any warranty. Use at your own risk.
For more information and to report security issues, please refer to our security documentation.
This project is licensed under the Apache 2.0 license.
See LICENSE for more information.
(top 24 of 30)
1,052 followers · starred Jan 2025
1,232 followers · starred Jun 2024
193 followers · starred Nov 2022
139 followers · starred Apr 2023