Blog
The technical content top engineers rely on to level up.
8 min read
Tickmath getSqrtRatioAtTick
This article explains how the getSqrtRatioAtTick() function in Uniswap V3 TickMath library works.
33 min read
Circle FFT — Part 1: Building the Circle Domain
Circle STARKs is a new zk-STARK scheme that has been implemented in Stwo and Plonky3, and it has been adopted by several zkVM projects.
22 min read
Multiplicative Subgroups and Primitive Elements
This chapter continues our study of group theory by exploring subgroups and generators. The concept of a primitive element will be introduced at the end.
8 min read
Square and Multiply Algorithm
The square and multiply algorithm computes integer exponents in O(log n) (logarithmic time).
7 min read
Computing the Current Tick Given sqrtPriceX96
In the previous chapters, we saw that the protocol stores the square root of the price instead of the price itself.
7 min read
Uniswap V3 Factory and the Relationship Between Tick Spacing and Fees
In early chapters, we introduced the concept of ticks, which discretize the price curve.
4 min read
ZK Proof of Selection Sort
Most computations of interest are generally “stateful” — that is, they need to go through a series of steps to produce the final result.
9 min read
How a ZKVM Works
A Zero-Knowledge Virtual Machine (ZKVM) is a virtual machine that can create a ZK-proof that verifies it executed a set of machine instructions correctly.
4 min read
Conditional Statements in Circom
Circom is very strict with the usage of if-statements. Effectively, they are not part of the underlying Rank 1 Constraint system (R1CS).
3 min read
Swapping Two Items in an Array in Circom
This chapter shows how to swap two signals in a list of signals. This is an important subroutine for a sorting algorithm.
3 min read
Quin Selector
The Quin Selector is a design pattern that allows us to use a signal as an index for an array of signals.
8 min read
32-Bit Emulation in ZK
The default datatype in ZK is the field element, where all arithmetic is done modulo a large prime number.