# Cairo Level 3: Ownership & Memory

> Level 3: Ownership & Memory of the LoWisa Cairo course: Cairo Memory Model, References and Snapshots, Designing Safe Data Flow. 3 lessons and 9 ideas, each explained in one line.

Ownership & Memory is level 3 of 14 of the [LoWisa Cairo course](/courses/cairo/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Cairo Memory Model

- **Write-once memory.** Cairo memory is **immutable**: each cell written once, a property the proof system requires.
- **Linear types.** Values move **linearly**: used once unless the type says otherwise, ownership Rust-style.
- **Why the model exists.** The memory model is not style: it is what makes execution **provable** at all.

## References and Snapshots

- **Snapshots.** A **snapshot** (@value) is an immutable view: reading without consuming ownership.
- **ref arguments.** A **ref** argument lets a function mutate the caller’s variable: rebinding tracked explicitly.
- **Desnap.** The **desnap** operator reads through a snapshot: views opened where values are needed.

## Designing Safe Data Flow

- **Move by default.** Values **move** into calls: the compiler tracks every owner, double-use fails to compile.
- **Copy and Drop traits.** **Copy** and Drop derive where duplication and disposal are safe: declared, never assumed.
- **Ownership as design.** Data flow designs like Rust: one **owner**, borrows for reading, mutation explicit.

## Before and after this level

- **Before:** [Level 2: Data Structures](/courses/cairo/level-2-data-structures/): Structs and Enums, Pattern Matching, Collections.
- **Next:** [Level 4: Traits & Generics](/courses/cairo/level-4-traits-and-generics/): Traits, Generic Types, Reusable Cairo Abstractions.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does Cairo Level 3: Ownership & Memory cover?

Cairo Memory Model, References and Snapshots, Designing Safe Data Flow: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 2: Data Structures, which covers Structs and Enums, Pattern Matching, Collections.

## Learn Cairo on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/cairo/level-3-ownership-and-memory/ · Updated 2026-11-30
