The technical content top engineers rely on to level up.
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}$....
4 min read
Vandermonde Matrices A Vandermonde matrix is a matrix that converts a polynomial from its coefficient representation into its value representation at a set of points. For a polynomial $f(x) = a_0...
20 min read
Roots of Unity in Finite Fields This article explains what Roots of Unity in a Finite Field are and how they are intertwined with multiplicative subgroups. The reader is expected to be familiar with...
12 min read
Interest Bearing Token Part 1 The Token-2022 interest-bearing extension enables a token mint to automatically accrue interest on all token accounts for that specific mint. It uses an annual rate...