# Week 17 at BlocfuseLab: Diving into StarkNet & Cairo Programming
This week at BlocfuseLab, we started the StarkNet Masterclass, exploring the Cairo programming language, the backbone of provable programs on StarkNet. Coming from a more traditional web3 development stack, this was a deep dive into something quite different: zero-knowledge proofs and how they can power decentralized applications efficiently.
Hereβs a breakdown of the key things we learnt this week ππ½
## Why Cairo?
Cairo is a programming language developed for writing provable programs, specifically designed to work with StarkNet, a ZK-rollup scaling solution for Ethereum. The cool thing? You can write programs without needing to deeply understand ZK proofs, Cairo takes care of that for you.
### Benefits:
** No need to deeply understand zk proofs.
** Highly efficient for scalable L2 solutions.
** Offers native support for StarkNet development.
## π§ Setting Up Our Environment
We started by installing Cairo and setting up our local dev environment using the instructions from the official Cairo book. And we wrote our first Cairo program!

```cairo
fn main() {}
```
In Cairo, a valid file must include a main function. Even if the program does nothing, main must be present.
## Variables & Destructuring
We learned how to declare and use variables, and even destructure tuples! This is useful when you're working with multiple values bundled together.

**Example: Destructuring in Cairo**

## Operations
Cairo supports standard arithmetic operations. Hereβs a simple function that adds two numbers:
```cairo
fn add(a: felt, b: felt) -> felt {
return a + b;
}
#You can then call this function(add) from main:
fn main() {
let result = add(10, 5);
assert result == 15;
return ();
}
```
## Functions and Loops
We wrote reusable functions and experimented with basic loop
**Function Example:**
```cairo
fn multiply(x: felt, y: felt) -> felt {
return x * y;
}
```
## Tasks for the Week
β Set up Cairo on our devices
β Chapter 1β2 of the Cairo Book -> (https://book.cairo-lang.org/ch01-02-hello-world.html)
β Wrote simple programs using functions, variables, and loops
## Next Steps
Weβll continue with the Cairo Book and dive into more advanced topics such as:
*Enums
*Interacting with contracts
## Final Thoughts
Canβt wait to start writing smart contracts in Cairo and building cool stuff on StarkNet!