Cairo is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly. Cairo and similar proof systems can be used to provide scalability to blockchains.
StarkNet uses the Cairo programming language both for its infrastructure and for writing StarkNet contracts. If you are looking for StarkNet specific documentation then please see here.
Here we provide two tutorials:
“Hello, Cairo” describes Cairo for the programmer who wishes to understand what Cairo can do hands-on, and start writing programs in Cairo. “How Cairo Works” starts from the low-level assembly-like version of Cairo and explains the syntactic sugar mechanisms applied by the Cairo compiler, which turns Cairo to a high-level-like language.
The “Hello, Cairo” tutorial contains several references to “How Cairo Works” for those who want to get a better understanding of those topics.
Where should I start? If you want to write Cairo programs, independent of StarkNet, start with “Hello, Cairo”.
If you are looking for an introduction to StarkNet specifically, then you can visit the StarkNet documentation here.
Finally, if you want to understand Cairo’s internals from the ground up, start with “How Cairo Works” and then follow with “Hello, Cairo”.
- Hello, StarkNet
- Setting up a StarkNet account
- Writing StarkNet contracts
- More CLI commands
- Adding User Authentication
- More Features
- Calling another contract
- Deploying a contract by another contract
- Interacting with L1 contracts
- Default entry point
- Writing unit tests
- Signature verification
- A simple Automated Market Maker (AMM)
- Some useful links
- StarkNet Alpha on Mainnet
- StarkNet Alpha version 4 on Goerli
- Hello, Cairo
- How Cairo Works
- Using SHARP (Shared Prover)