finds.dev

starkware-libs/cairo

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

View on GitHub

★ 1,890RustApache-2.0updated Jun 2026

// the take

Cairo is StarkWare's smart contract language for the Starknet L2, designed so every program execution produces a cryptographic proof of correctness. The two-stage compilation pipeline (Cairo → Sierra → CASM) is the interesting part: Sierra is an intermediate representation that guarantees no unprovable panics reach the prover, which solves a real sequencer-griefing problem. This is primarily for Starknet contract developers, not general ZK hobbyists.

The Sierra layer is a genuinely clever design decision — by proving at the IR level that all paths are safe before lowering to assembly, you avoid the class of bugs where a malicious contract aborts mid-execution and wastes prover resources. The corelib is surprisingly complete for a young language: iterators with map/filter/zip/chain adapters, checked/wrapping/saturating arithmetic traits, Blake, Keccak, SHA-256/384/512, secp256k1/r1 — everything a contract author actually needs is already there. The compiler is written in Rust with a proper Salsa-style query database (cairo-lang-defs, cairo-lang-diagnostics etc.), so incremental recompilation and LSP support are first-class, not bolted on. ADRs in the repo (enum syntax, trait system design) show the team is making explicit tradeoffs and documenting them.

The README is a thin getting-started stub — there is no architectural overview explaining Sierra, what provable execution actually means, or when you'd pick Cairo over Solidity+ZK. Someone evaluating this cold will not understand why the two-step compilation exists. The 1,890-star count is low for a language that powers a multi-billion-dollar L2; most Cairo development happens through Scarb (the package manager) and the Starknet Foundry toolchain, neither of which live here, so the repo understates how much real infrastructure exists. The language is Starknet-specific despite the 'general computation' framing — the corelib is saturated with starknet:: modules and the gas model is tied to the Cairo VM cost table, making it a poor fit outside the Starknet ecosystem.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,890
Forks
765
Language
Rust
License
Apache-2.0
Last commit
11 Jun 2026

// nearby

If cairo isn't quite it.

All repos →