RareSkills Blog

Zero Knowledge Proofs

The most programmer-friendly guide to building ZK-SNARKs from scratch.
Read Tutorial

Uniswap V2

A deep dive into the source code, tokenomics, and math behind the most copied DeFi Protocol.
Read Tutorial

Compound V3

Learn the Compound Finance codebase and tokenomics in depth.
Read Tutorial

Uniswap V3

The math and code behind concentrated liquidity.
Read Tutorial

Proxy Patterns

The most comprehensive guide to smart contract upgradeability.
Read Tutorial

Solidity Gas Optimisation

The web’s most authoritative and complete guide to Solidity Gas Optimization.
Read Tutorial

Tornado Cash Book

The most comprehensive line-by-line guide to the iconic mixer - with animations.
Read Tutorial

60 Days of Solana

The Solana course is designed for engineers with a beginner or intermediate background.
Read Tutorial

Smart Contract Security

A 2023 survey of how smart contracts break - over 12,000 words long.
Read Tutorial

Huff Puzzles

Learn the EVM hands on by programming in the most loved assembly language.
Read Tutorial

RareSkills Riddles

Capture the flag security exercises that even top security auditors struggle with.
Read Tutorial

Zero Knowledge Puzzles

Zero knowledge puzzles to learn writing circuits in circom lang.
Read Tutorial

Solidity Interview Questions

Interview questions top companies actually ask.
Read Tutorial

Learn Solidity 0.8 with Foundry

The complete Solidity course.
Read Tutorial

Yul Puzzles

Learn Solidity assembly by solving 80 problems of increasing difficulty. Hints and resources included.
Read Tutorial
13 November 2025
13 minutes

Positions in Uniswap v3

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…

Read Article
12 November 2025
9 minutes

NTT Algorithm By Hand

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…

Read Article
12 November 2025
5 minutes

Roots of Unity raised to the k/2 power equals 1 or -1

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…

Read Article
12 November 2025
6 minutes

Evaluating multivalued functions by square root expansion

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,…

Read Article
12 November 2025
9 minutes

The Image Preservation Theorem for Multivalued Functions

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…

Read Article
12 November 2025
5 minutes

Square Roots of Roots of Unity

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…

Read Article
12 November 2025
5 minutes

The square of a k-th root of unity is a k/2-th root of unity

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…

Read Article
12 November 2025
4 minutes

Visual representation of the roots of unity

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…

Read Article
12 November 2025
6 minutes

Roots of unity ω have the property ω^(k/2) ≡ −1

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…

Read Article
12 November 2025
4 minutes

Vandermonde Matrices

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 +a_1x + a_2x^2+\dots+a_{k-1}x^{k-1}$ with its…

Read Article
27 October 2025
21 minutes

Roots of Unity in Finite Fields

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…

Read Article
17 October 2025
25 minutes

Interest Bearing Token Part 2

Interest Bearing Token Part 2The interest-bearing extension adds the ability for a token mint to accrue interest over time. In our previous discussion of Token-2022, we introduced the interest-bearing extension…

Read Article
17 October 2025
15 minutes

Interest Bearing Token Part 1

Interest Bearing Token Part 1The 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 defined…

Read Article
16 October 2025
24 minutes

Ed25519 Signature Verification in Solana

Ed25519 Signature Verification in Solana Verifying Ed25519 Signatures in Solana Anchor Programs This tutorial shows how to verify an off-chain Ed25519 signature in a Solana program. In Solana, custom programs…

Read Article
16 October 2025
15 minutes

Solana Instruction Introspection

Solana Instruction Introspection Instruction introspection enables a Solana program to read an instruction other than its own within the same transaction. Normally, a program can only read the instruction targeted…

Read Article
16 October 2025
21 minutes

Multiplication of Polynomials in Point Form

Multiplication of Polynomials in Point Form Polynomial multiplication is widely used in zero-knowledge proofs and mathematical cryptography. But the brute force or traditional approach for multiplying polynomials runs in $\mathcal{O}(n^2)$,…

Read Article
15 October 2025
21 minutes

The Solana Token 2022 Specification

The Solana Token 2022 Specification Token-2022 is a new backward-compatible version of the SPL Token program that supports additional features in the form of extensions. The bytecode for these extensions…

Read Article
15 October 2025
21 minutes

Time Travel Testing with LiteSVM

Time Travel Testing with LiteSVM In Solana, writing test cases that depend on the passing of time is tricky. We might want to test that something happens in our code…

Read Article
14 October 2025
15 minutes

Implementing Token Metadata with Metaplex

Implementing Token Metadata with Metaplex We introduced the Metaplex metadata standard in the previous tutorial. In this one, we’ll create an SPL token and attach metadata to it using the…

Read Article
14 October 2025
12 minutes

How Metaplex Metadata for Tokens Works

How Metaplex Metadata for Tokens Works We have deployed and interacted with SPL tokens, but none of them had a name, symbol, or any metadata attached. Instead, we identified each…

Read Article
14 October 2025
18 minutes

Basic Bank Tutorial

Basic Bank Tutorial with SPL Tokens and Anchor In this tutorial, we’ll build a simple bank program on Solana with the basic features you’d expect from a regular bank. Users…

Read Article
14 October 2025
18 minutes

Token Sale with Total Supply Tutorial

Token Sale with Total Supply Tutorial A token sale program is a smart contract that sells a specific token, usually in exchange for a native token like SOL, at a…

Read Article
13 October 2025
24 minutes

Transferring SPL Tokens with Anchor and Web3.js

Transferring SPL Tokens with Anchor and Web3.js In the previous tutorial, we learned how SPL tokens work. In this tutorial, we’ll implement a full SPL token lifecycle: create, mint, transfer,…

Read Article
13 October 2025
21 minutes

How the SPL Token Works

How the SPL Token Works Solana Program Library Token (SPL Token) is Solana’s standard for tokens: how to create tokens and how they should behave. It is Solana’s equivalent to…

Read Article
06 October 2025
8 minutes

Calculating the real reserves between two prices in the Uniswap V3 codebase

Calculating the real reserves between two prices in the Uniswap V3 codebase In previous chapters, we derived formulas to calculate the real reserves of tokens X and Y between two…

Read Article
24 September 2025
13 minutes

The Fundamental Theorem of Finite Cyclic Groups

The Fundamental Theorem of Finite Cyclic Groups The Fundamental Theorem of Cyclic Groups provides guarantees about the existence of cyclic subgroups within a cyclic group. In the context of the…

Read Article
15 September 2025
12 minutes

The constant product formula in Uniswap v3

The constant product formula in Uniswap v3 Our goal is to derive the constant product formula based on real reserves for a segment, given by $$ L^2 = (x_r+\frac{L}{\sqrt{p_u}})(y_r+L\sqrt{p_l})$$ and…

Read Article
Load More Articles