Skip to content
Starknet By Example

Introduction

Starknet By Example provides practical examples for building smart contracts on Starknet using the Cairo programming language.

Starknet is a permissionless Validity-Rollup that operates as an Ethereum layer-2 scaling solution. It leverages STARK cryptographic proofs to achieve high security and scalability while maintaining Ethereum's security guarantees.

Smart contracts on Starknet are written in Cairo, a Turing-complete programming language specifically designed for creating provable programs. Cairo abstracts away the complexity of zk-STARK proofs, allowing developers to focus on writing smart contract logic.

Who is this for?

This guide is designed for developers with basic programming and blockchain knowledge who want to learn Starknet smart contract development using Cairo.

The content is structured progressively - early chapters cover Cairo and Starknet fundamentals, while later chapters explore advanced topics and complex smart contract patterns.

How to use this book?

Each chapter is self-contained and focuses on a specific Starknet feature or smart contract use case. While you can jump to any topic, we recommend following the chapters in order if you're new to Starknet.

Try out the examples instantly using the Starknet Remix Plugin.

Further reading

To deepen your knowledge:

Versions

The current version of this book uses:

cairo 2.9.2
edition 2024_07
scarb 2.9.2
starknet-foundry 0.35.0
sierra 1.6.0
Powered by
Nethermind
StarknetOnlydust
Ecosystem toolings
Voyager
Starknet RPCJunoStarknet Remix Plugin
Powered By Nethermind