Of everything in this track, this is the one idea everything else sits on top of. Every ZK proof system, every elliptic curve, every Circom circuit runs its arithmetic inside a modulus — and the surprising part is that you already use the same idea daily, just under a more familiar name.
The clock analogy
A clock only has 12 hours on its face. Past 12, it doesn’t keep counting up to 13 — it wraps back to 1. If it’s 9:00 and 4 hours pass, the clock doesn’t read 13:00, it reads 1:00:
The number you wrap around — , for a clock — is called the modulus. In a ZK proof system, the modulus is a single, enormous prime number, but the wraparound behaves exactly the same way.
The mod operation
Formally, the mod operation gives you the remainder left over after dividing by the modulus. It’s worth seeing the same sum three ways, so the difference from plain arithmetic is unmistakable:
A few more, so the pattern sets in:
A result of just means the division was exact — nothing left over.
Congruence notation
Math has its own shorthand for “these two numbers leave the same remainder”: congruence, written with three bars instead of the usual two.
Read as ” is congruent to , modulo .” It doesn’t claim and are the same number — only that dividing either one by leaves the same remainder. lands in that same statement for exactly the same reason: three genuinely different numbers, all behaving identically inside mod .
The three-bar symbol is doing real work here: two bars () means identical values; three bars () means “same remainder, possibly very different numbers.”
Arithmetic inside a modulus
Addition, subtraction, and multiplication all work inside a modulus too — compute normally, then reduce by the modulus. Whatever you started with, the answer always lands back inside , which is what makes this a closed system: the operations can never produce a result that escapes the range.
Negative numbers aren’t allowed in this range, so add the modulus back on until the result turns positive: . That’s the actual result — subtraction mod of is , not .
Add, subtract, or multiply — the output is always back inside range, every time. That guarantee is the entire point.
Why Circom lives inside this
Every Circom circuit does its arithmetic modulo , the same enormous prime from the previous lesson. Every signal a circuit touches is a number somewhere in , and every addition, subtraction, or multiplication wraps back into that same range, exactly like the examples above just at a far larger scale. This structure — modular arithmetic over a prime — has its own name: a finite field, written . That’s the entire reason a circuit’s arithmetic stays predictable instead of spiraling into arbitrarily large numbers, and it’s the subject the next-but-one lesson in this track covers in full. First, though, there’s one more piece modular arithmetic needs: what it means to divide inside a modulus, which is where modular inverses and Fermat’s little theorem come in.