Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Latest commit

 

History

History
30 lines (24 loc) · 2.28 KB

1. Introduction to Cairo.md

File metadata and controls

30 lines (24 loc) · 2.28 KB

Introduction to Cairo

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.

What is Starknet?

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.

Getting Started With Cairo 1.0

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.

  1. Introduction to Cairo
  2. Setting up a development environment
  3. Felt and other primitive types
  4. Cairo program, Starknet contract and Contract syntax
  5. Cairo data types I - Arrays, Structs, Mappings, Constants, Tuples
  6. Cairo data types II - Enums and Pattern matching
  7. Control flow - if-else, recursion
  8. Events
  9. Ownership, References, Snapshots I
  10. Ownership, References, Snapshots II
  11. Traits and implementations
  12. Options
  13. Generics
  14. Calling other contracts
  15. Writing tests for your Cairo Contract
  16. Declaring and Deploying Starknet Contracts
  17. Understanding Sierra