百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

cairo

> 编程语言
开源

Cairo 是第一种 Turing 完备的语言,用于创建可证明的通用计算程序。

1.9K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Cairo 是第一种 Turing 完备的语言,用于创建可证明的通用计算程序。

Table of Contents
  • About
  • Getting Started
    • Prerequisites
    • Compiling and running Cairo files
    • Compiling Starknet Contracts
  • Support
  • Project assistance
  • Contributing
  • Authors & contributors
  • Security
  • License

About

Cairo is the first Turing-complete language for creating provable programs for general computation.

Getting Started

Prerequisites

  • Install Rust
  • Set up Rust:
rustup override set stable && rustup update

Ensure Rust was installed correctly by running the following from the root project directory:

cargo test

Compiling and running Cairo files

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

Compiling Starknet Contracts

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

Support

  • We encourage developers to ask and answer questions on Stack Overflow.
  • Contact options are listed on this GitHub profile

Project assistance

If you want to say thank you and/or support active development of Cairo:

  • Add a GitHub Star to the project.
  • Tweet about your Cairo work.
  • Write interesting articles about the project on Dev.to, Medium or your personal blog.

Together, we can make Cairo better!

Contributing

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!

Authors & contributors

For a full list of all authors and contributors, see the contributors page.

Security

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.

License

This project is licensed under the Apache 2.0 license.

See LICENSE for more information.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustcairocomputational-integritystarknetzero-knowledge-proofs

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言