The technical content top engineers rely on to level up.
20 min read
Events in Starknet Events emit data from contract execution into the transaction receipt. The receipt holds metadata about what happened during the execution, which can be queried or indexed by...
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 on. In this...
13 min read
Components Part 2: OpenZeppelin ERC-20 Tutorial In Component Part 1, we learned how to create and use a component within a single file. We built a from scratch and integrated its storage, events, and...
12 min read
Positions in Uniswap v3 Adding liquidity to an AMM means depositing tokens into the AMM pool. Liquidity providers do this in the hope of earning fees from users who swap with that pool. In Uniswap...
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. If a polynomial has degree $d$ then we evaluate it on...
6 min read
Evaluating multivalued functions by square root expansion In the previous chapter on Image Preservation of Multivalued Functions we saw that instead of evaluating $f(x)$ on the $k$-th roots of unity,...
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. This should not be confused with the similar-looking...
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. The...
4 min read
Visual representation of the roots of unity The property that if $\omega$ is a $k$-th root of unity, then $\omega^i$ and $\omega^{i+k/2}$ are additive inverses may seem a little abstract — this...
6 min read
Roots of unity ω have the property ω^(k/2) ≡ −1 In previous articles, we established that in the finite field $\mathbb{F}_q$, if $k$ divides $q-1$: There exists a unique subgroup of order $k$ - the...
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. However,...
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}$....