finds.dev← search

// the find

starkware-libs/cairo

★ 1,890 · Rust · Apache-2.0 · updated Jun 2026

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

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.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →