Blog
The technical content top engineers rely on to level up.
11 min read
Structure of a Basic Contract
This article shows how to build a deployable Cairo contract for Starknet.
20 min read
Events in Starknet
Events emit data from contract execution into the transaction receipt.
3 min read
Access Control in Cairo
Access control defines who can call specific functions or modify contract behavior.
10 min read
Type Casting
Type casting in Cairo is the process of converting values from one data type to another.
17 min read
Cheatcodes in Starknet Foundry
A "cheatcode" in Foundry is a mechanism that allows contract tests to control environment variables such as caller address, the current timestamp, and so…
12 min read
Uniswap v3 Positions: How Liquidity Ranges Work
In Uniswap v3, liquidity providers open positions over a tick range instead of getting LP tokens. Learn how positions, fees, and the mint function work.
9 min read
NTT Algorithm By Hand
The NTT (Number Theoretic Transform) algorithm converts a polynomial in a finite field from coefficient form to point form.
6 min read
Evaluating multivalued functions by square root expansion
This “removes” one layer of square roots. Then, we evaluate each of the remaining square roots.
8 min read
The Image Preservation Theorem for Multivalued Functions
We’ll start this chapter on an unusual note — the NTT algorithm is quite simple and can be implemented in less than 20 lines of code.
5 min read
Square Roots of Roots of Unity
The square root of a number x is y such that y^2=x. When x is of the form x^m and m is even, then the square root is easy to compute: it’s simply x^(m/2).
4 min read
Roots of Unity raised to the k/2 power equals 1 or -1
Any k-th root of unity with even k raised to the k/2 power will result in 1 or -1.
4 min read
The square of a k-th root of unity is a k/2-th root of unity
If we take the set of k-th roots of unity (with k even) and square each element, the resulting set will be a set of half the size.