Circom
Browse all Circom articles.
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.
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.
4 min read
Introduction to Stateful Computations in ZK
When carrying out iterative computations such as powers, factorials, or computing the Fibonacci sequence, we need to “stop the computation” after a…
4 min read
MD5 Hash In Circom
In this tutorial, we will implement the MD5 hash in Circom both to compute the hash and to constrain in Circom that it was computed 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
Quin Selector
The Quin Selector is a design pattern that allows us to use a signal as an index for an array of signals.
6 min read
The Permutation Argument
A permutation argument is a proof that two lists hold the same elements, but possibly in a different order.
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.
24 min read
Modeling the Stack Data Structure in ZK
This tutorial shows how to create a stack in Circom. Be warned — this chapter is long.
6 min read
Circom Template Parameters, Variables, Loops, If Statements, Assert
This chapter covers essential syntax, which you'll see in most Circom programs.
3 min read
Circom Components in a Loop
Circom does not allow for components to be directly instantiated in a loop. For example, compiling the following code results in the error below.