The last few lessons showed how rigid polynomials really are: a low-degree one is pinned down by just a few points, and two different ones can only agree in a few places. This lesson puts that rigidity to work on a very practical problem — sending information when some of it gets lost or damaged along the way. This is coding theory, and its star is the Reed–Solomon code: it protects QR codes, CDs, and satellite links, and it sits underneath modern proof systems and blockchain data availability. One notation note carried over from the last lesson: there, meant a polynomial’s degree; here, means a code’s distance.
Why send extra numbers?
Sending a message plainly leaves no way to tell that anything went wrong. Redundancy — extra numbers computed from the message — is what makes mistakes visible, and distance is what decides how many mistakes survive.
The Hamming distance between two words is the number of positions where they differ. A code’s distance is the smallest Hamming distance between any two of its codewords. With distance , a receiver can always detect up to errors, and correct up to errors whenever — picture a circle of radius around each codeword; as long as those circles don’t overlap, a corrupted word still lands closest to the codeword it came from.
Reed–Solomon: a message as a line
Reed–Solomon’s trick is to turn the message itself into a low-degree polynomial, then send its value at several agreed points instead of the raw numbers.
A message of numbers becomes a degree- polynomial, and the codeword is that polynomial’s value at agreed points, with . The rate tells you how much of what’s sent actually carries the message — here, . Because any points pin down a degree- polynomial exactly, any of the transmitted numbers are enough to reconstruct it.
Recovering lost numbers
When some numbers go missing but the receiver knows exactly which positions were lost — an erasure — the surviving points are still enough to rebuild the line.
An erasure is a lost value at a known position — different from an error, where a value is wrong but its position looks fine. Because points determine the message, a Reed–Solomon code with total points tolerates losing up to of them and still recovers everything exactly, the same way two points determine a line here.
How far apart are two codewords?
The error-correcting power of this code all traces back to one fact already familiar from Schwartz–Zippel: two different low-degree polynomials can only agree at a handful of points.
Two different polynomials of degree below can agree in at most points — subtract one from the other and the result is a nonzero polynomial of degree below , which has at most roots. So out of evaluation points, at most ever agree, meaning at least always differ. Reed–Solomon codes hit this bound exactly, which is why they’re called maximum distance separable.
Finding a corrupted number
Erasures are the easy case, because the receiver knows where to look. A plain error is harder — one value is simply wrong, with no flag attached — but the same distance argument still finds it.
Decoding means finding the codeword closest to what was received. Since any two codewords differ in at least places, a received word with fewer than errors is always closer to the true codeword than to any other — that’s exactly the rule from Fig. 1. Push past that limit, as with two errors here, and two codewords can tie, which is why that rule is a hard ceiling, not just a rule of thumb.
Where zero-knowledge uses these codes
Two ideas from earlier lessons meet here: the NTT makes Reed–Solomon encoding fast, and the same distance bound becomes a soundness argument for proof systems and a resilience guarantee for distributed data.
Encoding a message is padding it to length and running the NTT — the same fast transform from Topic 23, repurposed as a Reed–Solomon encoder. In proof systems like STARKs, a cheating prover’s list of values sits far from every valid codeword, so checking a handful of random positions catches it with overwhelming probability. In distributed storage and blockchain data availability, the same code is spread across many nodes, so any of the stored pieces reconstruct the original data even if the rest disappear.
- Redundancy turns a corrupted message into something detectable: the Hamming distance between two words counts the positions where they differ, and a code’s minimum distance decides how much damage it survives.
- Reed–Solomon encodes a -number message as a degree- polynomial and sends its value at agreed points; any of those points recover the message exactly.
- The same root-counting fact behind Schwartz–Zippel forces any two different codewords to differ in at least places — the best any code of that size can do.
- A received word survives up to erasures (lost values at known positions) and up to plain errors whenever , by always decoding to the nearest codeword.
- The NTT makes Reed–Solomon encoding fast, and the resulting distance bound underlies both the soundness of spot-checks in proof systems like STARKs and data-availability guarantees in blockchains.