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

Cairo Tutorial

A guide to creating smart contracts on Starknet for Solidity developers.
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
22 November 2025
3 minutes

FFT Friendly Finite Fields

FFT Friendly Finite Fields In order to carry out the FFT algorithm in a finite field (the Number Theoretic Transform), there needs to be $k$-th roots of unity such that…

Read Article
17 November 2025
21 minutes

Components Part 2: OpenZeppelin ERC-20 Tutorial

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 CounterComponent from scratch and…

Read Article
17 November 2025
11 minutes

Cairo Components Part 1

Cairo Components Part 1 Components in Cairo behave like abstract contracts in Solidity. They can define and work with storage, events, and functions, but they can’t be deployed on their…

Read Article
17 November 2025
44 minutes

ERC-20 Token on Starknet

ERC-20 Token on Starknet ERC-20 tokens on Starknet work the same way as on Ethereum. In fact, STRK (Starknet’s fee token) is itself an ERC-20 token; there’s no special "native"…

Read Article
17 November 2025
32 minutes

Cheatcodes in Starknet Foundry

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…

Read Article
17 November 2025
30 minutes

Events in Starknet

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…

Read Article
17 November 2025
5 minutes

Access Control in Cairo

Access Control in Cairo Access control defines who can call specific functions or modify contract behavior. This article explains how Cairo implements access control using the assert macro. A Review…

Read Article
17 November 2025
12 minutes

Constructors in Cairo

Constructors in Cairo A constructor is a one-time-call function executed during contract deployment to initialize state variables, perform contract setup tasks, make cross-contract interactions and so on. In Cairo, constructors…

Read Article
17 November 2025
15 minutes

Type Casting

Type Casting Type casting in Cairo is the process of converting values from one data type to another. This becomes necessary when working with Cairo’s strict type system, where explicit…

Read Article
17 November 2025
24 minutes

Cairo Storage Variable Types

Cairo Storage Variable Types Before a type can be stored in Cairo contract storage, it must implement a trait called the starknet::Store trait. This trait defines how a type is…

Read Article
17 November 2025
13 minutes

Function Visibility in Cairo

Function Visibility in Cairo Cairo does not have "internal" and "pure" modifiers (or any other modifiers for that matter) like Solidity does. Recall that marking an impl block with #[abi(embed_v0)]…

Read Article
17 November 2025
17 minutes

Integers in Cairo

Integers in Cairo Cairo doesn’t offer the full range of integer sizes found in Solidity. While Solidity provides integer types for every multiple of 8 bits up to 256, Cairo…

Read Article
17 November 2025
13 minutes

Structure of a Basic Contract

Structure of a Basic Contract This article shows how to build a deployable Cairo contract for Starknet. Starting from a simple sketch, we will gradually add features to build a…

Read Article
17 November 2025
10 minutes

Cairo for Solidity Developers

Cairo for Solidity Developers Cairo is a Rust-inspired language that compiles to bytecode, which runs on the Cairo Virtual Machine. The Cairo Virtual Machine is a zero-knowledge virtual machine (ZKVM)…

Read Article
17 November 2025
25 minutes

Introduction to the Cairo Language

Introduction to the Cairo Language Cairo is a domain-specific programming language designed for provable, verifiable computation, particularly within the context of zero-knowledge systems like Starknet, a Layer 2 (L2) network…

Read Article
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
Load More Articles