The last two lessons built modular addition, subtraction, multiplication, and — through modular inverses — division. Today all four get packaged into one idea with a name: a finite field.
What a field actually is
Strip away the “modular” part for a moment. A field is just a set of numbers where addition, subtraction, multiplication, and division all work, and the result never leaves that same set. The real numbers are the everyday example: add, subtract, multiply, or divide any two of them (division by zero aside, which is never allowed anywhere) and the answer is still a real number.
A set where all stay inside the set. The real numbers are one example — division by is the one operation that’s never defined, in any field.
Defining GF(p)
A finite field, written , is the exact same idea, just with a finite set to work in: the numbers through , with every operation done modulo .
Addition, subtraction, and multiplication mod were already covered two lessons back. Division works because of the lesson right before this one: every nonzero number has a modular inverse, as long as is prime — which is exactly why it’s , built on a prime, and not for just any modulus.
Closure: the property that makes it a field
The one property that defines a field is closure — no matter which of the four operations gets used, the result can never escape the set. Running the test against makes this concrete:
Every single result stays inside — including the division, which only works at all because has a modular inverse mod .
A full worked example: GF(5)
The smallest field worth looking at closely is — the set . Every nonzero element pairs up with exactly one other element as its inverse, with nothing left over:
is its own inverse, is its own inverse, and and pair up with each other — four numbers, two pairs, zero exceptions.
Why p has to be prime
The previous lesson already supplied the counter-example: has no inverse mod , because , not . Read as a field test, that single failure is enough to disqualify mod entirely.
One missing inverse is all it takes — if even a single nonzero element has no partner, division stops being defined for every input, and the set fails to be a field. That single requirement, that the modulus be prime, is why every ZK system builds its arithmetic on a prime.
Field elements are circuit signals
Here’s the payoff for all of this: in Circom, every signal in a circuit is a finite field element — a number somewhere between and , where is the same enormous BN254 prime introduced back in the divisibility lesson.
Every +, -, *, and / written in circuit code is, underneath, a finite field operation — the same four operations this lesson just finished defining, just running at a scale no one ever does by hand.
Why the field has to be huge
A small prime like or would satisfy every definition in this lesson just as well as BN254’s prime does — so why not use one? The field’s size is exactly what determines how much room exists for a secret value to hide in.
has elements — trivial to search by hand. The BN254 field has roughly elements: computationally invisible to search, even though it’s built from exactly the same clean structure as . Every idea in this lesson scales up unchanged; only the size of the haystack changes.
Addition, subtraction, multiplication, division, all closed, all built on a single prime — that’s the entire structure a Circom circuit runs on. The next lessons build on top of it: polynomials, which turn a field’s numbers into something that can encode an entire computation at once.