Cairo is a Turing-complete programming language that enables you write provable programs, which can be used to demonstrate to one party that a specific computation was performed accurately. This feature makes Cairo and similar proof systems ideal for providing scalability to blockchain networks.
Recently Cairo 1.0, a total rehaul of the Cairo programming language was released. The tedious experience many developers faced whilst building programs with older versions of Cairo will be a thing of the past, as Cairo 1.0 makes writing code significantly easier and neater, featuring a Rust-like experience.
Starknet, is a decentralized ZK-rollup that operates as an Ethereum layer 2 chain. Starknet uses Cairo as the programming language for its infrastructure and for creating StarkNet contracts.
If you want to begin learning Cairo 1.0, we've curated simple guides to take you from setting up your first Starknet development environment, to deploying complex Starknet contracts.
- Introduction to Cairo
- Setting up a development environment
- Felt and other primitive types
- Cairo program, Starknet contract and Contract syntax
- Cairo data types I - Arrays, Structs, Mappings, Constants, Tuples
- Cairo data types II - Enums and Pattern matching
- Control flow - if-else, recursion
- Events
- Ownership, References, Snapshots I
- Ownership, References, Snapshots II
- Traits and implementations
- Options
- Generics
- Calling other contracts
- Writing tests for your Cairo Contract
- Declaring and Deploying Starknet Contracts
- Understanding Sierra