Zero Knowledge privacy without mathematics

Lauri Peltonen
Coinmonks
5 min readNov 1, 2023

--

Zero Knowledge privacy is like magic. Only the greatest of magicians can master or understand it.

Well, screw that. Let’s change that today.

Zero Knowledge materials

Zero Knowledge privacy allows one to prove that they have some information without revealing what the information is. Introductory articles to ZK tend to fall into either of these two categories:

  1. They start nice but suddenly plunge deep into mathematical theory to prove their claims. I daresay that most people don’t even try to understand the mathematics, get scared and just run away. And that’s very natural.
  2. They hand-wave their way around the difficult parts and basically ask us to just trust that it works as advertised.
Hand-waving around. Image source: Bing Dall-E

Without scary mathematics, it’s not possible to prove anything as complicated as ZK, but we can still demonstrate how ZK privacy is possible. So let’s go!

We all know Sudoku. Or do we?

Let’s use the Sudoku puzzle as an example. Just in case you’re unfamiliar with how Sudoku works, here’s an overview.

A typical initial setup for a Sudoku

There’s a grid of 9x9 tiles. Each tile is meant for one number between 1 and 9. The aim is to fill the grid with numbers using the following three rules:

  1. Each row has each of the numbers only once.
  2. Each column has each of the numbers only once.
  3. Each 3x3 square (formed by rows & columns 1–3, 4–6 and 7–9) has each of the numbers only once.

Initially, depending on the setup, about 25 of the tiles have numbers. Your task is to figure out the rest of the numbers.

I know a solution, but I’m not gonna tell you!

Say we have a sudoku grid with the initial numbers filled in. This is public information.

You then work your ass off, consult your friend ChatGPT, spend countless sleepless nights, and eventually find a solution. And you’re so proud of yourself — good job!

The problem is that your friend, Dumbie, doesn’t believe that you did it. But you don’t want to give him the solution. Darn.

This sounds like you need some privacy properties to solve your dilemma. And this is where ZK comes in!

What do we need to prove, exactly?

At this point, it helps to stop for a while to really consider what we want to prove.

Proving a Sudoku solution with ZK

We want to prove that we have a solution to a puzzle that follows certain rules. The solution as a whole is not relevant directly — we only need to prove that the following is correct:

  • We followed each of the three rules.
  • We used the correct initial setup.

We can therefore separate the proof into different parts.

Prepare the table for your awesome proofs

We prepare the table so that you are committed to your solution. After this, you can’t change your solution anymore.

First ask Dumbie to wait outside, and then:

  1. Replace each of your solution's numbers with a piece of paper with the same number.
Your sudoku after the first phase
  1. Flip each of the papers around so the number isn’t visible anymore but remains in the correct place in the grid.
  2. Create three more 9x9 grids with exactly the same layout and papers.
  3. Ask Dumbie to come in.
One sudoku grid after the preparations

Dazzle your friend

You now have four tasks to complete together. One grid is for one task. Dumbie is free to choose whichever grid for whichever task.

The tasks are:

  1. Collect all of the papers in each row into their own pile. This results in nine piles of nine cards.
One sudoku grid after phase 1
  1. Collect all of the papers in each column into their own pile. This results in nine piles of nine cards.
  2. Collect all of the papers in each 3x3 grid into their own pile. This results in nine piles of nine cards.
  3. You reveal the initial position numbers on the remaining grid to prove that you used the correct initial position.

It doesn’t matter if the piles get mixed up, as long as papers are not mixed between piles. Once the piles are collected, each pile is shuffled.

At this point, Dumbie can check each of the piles. If all of them contain numbers from 1 to 9, he knows the solution is correct. If any pile has anything else, he knows the solution is incorrect.

If Dumbie is worried that not all of the grids were identical and you just got lucky, you can repeat this protocol until Dumbie is satisfied.

Zero Knowledge

Dumbie didn’t find out any extra information about the actual solution; he only found out that the solution was correct. So Dumbie only learns what we want him to learn. In this case, this information is that our solution is correct.

Or, to say this differently, he gained zero (extra) knowledge about the original solution. And this is exactly what Zero Knowledge privacy offers: you can prove you have some data but don’t want to give out any extra information about it.

Typically, this kind of demonstration is done in an electronic format. The same principles apply there, but the process itself is naturally a bit different.

Does ZK make a bit more sense now?

About the author

I’m a ZK & EVM freelancer. I do development, organize ZK courses, and try to educate people about ZK. Always on the lookout for new projects.

Questions, comments, wanna rant at someone? Get in touch!

This post was encouraged by the Ethereum Writers cohort and the sudoku example is inspired by Ingonyama.

--

--