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
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
26 August 2025
24 minutes

How Ethereum address are derived (EOAs, CREATE, and CREATE2)

How Ethereum address are derived (EOAs, CREATE, and CREATE2) On Ethereum, smart contracts can be deployed in one of three ways: An Externally Owned Account (EOA) initiates the transaction where…

Read Article
26 August 2025
12 minutes

Real reserves in Uniswap v3

Real reserves in Uniswap v3 In the last chapter, we introduced two new concepts: real reserves and virtual reserves. The real reserves of a segment are the amount of tokens…

Read Article
26 August 2025
13 minutes

Real and virtual reserves in Uniswap v3

Real and virtual reserves in Uniswap v3 Uniswap v3 uses two types of reserves: real reserves and virtual reserves. Real reserves represent the actual amount of tokens present in a…

Read Article
22 July 2025
21 minutes

ERC-6551 Standard: Token Bound Accounts (TBA)

ERC-6551 Standard: Token Bound Accounts (TBA) Introduction NFTs were originally created to represent ownership of digital or physical assets, like collectibles. However, they were limited to tracking ownership of an…

Read Article
11 July 2025
11 minutes

Tickmath getSqrtRatioAtTick

Tickmath getSqrtRatioAtTick This article explains how the getSqrtRatioAtTick() function in Uniswap V3 TickMath library works. The getSqrtRatioAtTick() function takes a tick index and returns the square root price at that…

Read Article
08 July 2025
5 minutes

Public and Private Inputs

Public and Private Inputs A public input in Circom is a signal in the witness that will be revealed to the verifier. For example, suppose we want to create a…

Read Article
08 July 2025
36 minutes

Circle FFT — Part 1: Building the Circle Domain

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. Its…

Read Article
30 June 2025
10 minutes

Square and Multiply Algorithm

Square and Multiply Algorithm The square and multiply algorithm computes integer exponents in $\mathcal{O}(\log n)$ (logarithmic time). The naive way to compute an exponent $x^n$ is to multiply $x$ by…

Read Article
03 June 2025
9 minutes

Uniswap V2 Architecture: An Introduction to Automated Market Makers

Uniswap V2 Architecture: An Introduction to Automated Market Makers Uniswap is a DeFi app that enables traders to swap one token for another in a trustless manner. It was one…

Read Article
02 June 2025
18 minutes

Multiplicative Subgroups and Primitive Elements

Multiplicative Subgroups and Primitive Elements Introduction This chapter continues our study of group theory by exploring subgroups and generators. The concept of a primitive element will be introduced at the…

Read Article
06 May 2025
7 minutes

Computing the Current Tick Given sqrtPriceX96

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. Therefore, it is…

Read Article
25 April 2025
7 minutes

Uniswap V3 Factory and the Relationship Between Tick Spacing and Fees

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. A tick is a price…

Read Article
15 April 2025
11 minutes

ZK Proof of Selection Sort

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

Read Article
15 April 2025
15 minutes

How a ZKVM Works

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. This allows…

Read Article
15 April 2025
8 minutes

The Permutation Argument

The Permutation Argument A permutation argument is a proof that two lists hold the same elements, but possibly in a different order. For example, [2,3,1] is a permutation of [1,2,3]…

Read Article
15 April 2025
2 minutes

ZK Friendly Hash Functions

ZK Friendly Hash Functions ZK-friendly hash functions are hash functions that require much fewer constraints to prove and verify than traditional cryptographic hash functions. Hash functions such as SHA256 or…

Read Article
Load More Articles