Zero-knowledge proofs, encoding Sudoku and Mario speedruns without semantic leak
vasekrozhon.wordpress.com
vasekrozhon.wordpress.com
I also like how it shows the 'power' of NP-completeness. Explaining zero-knowledge proofs for colouring is fairly easy. Explaining how to go from 3-SAT to colouring is some nice pictures. Explaining how to go from Sudoku to 3-SAT is 5 minutes work (assuming you understand both 3-SAT and Sudoku already).
Together, these things let you do zero-knowledge proofs for Sudoku with no more work, and by a similar process, zero-knowledge proofs for any problem in P.
I'd definitely recommend watching the video before reading the blog post, ideally!
That's useful in practice, because producing zero knowledge proofs is sooo slow. But getting non-deterministic 'hints' can speed up many computations. Crucially, the hints are arbitrary data and do not have to be computed inside the computation-to-be-proven.
The most cliche example is probably verifying that a number is compound: you could either run a complicated test, or you could just 'guess' the prime factors and verify your guess via multiplication.
Slightly more practical: you can sort in O(n log n) deterministic time. But that's easily beaten by Bogosort: you 'guess' a permutation, apply it to your data, and check if it's sorted. Not only does that finish in O(n) if you 'guess' right, the constant factors are also much better than for a standard sorting algorithm.
Of course, your zero-knowledge computation manages to 'guess' the right permutation right away, because it gets a hint from a deterministic computer outside the 'zero-knowledge box' running the classic O(n log n) algorithm.
That's still an advantage over running the O(n log n) algorithm directly, because proving computation is so expensive.
I didn't follow this. I also looked at the graph and found that the node labeled "x1 OR x2 OR x3" is in fact connected to a blue node, so it can't be blue?
I didn't manage to work out how the clause gadget is meant to work so I can't tell if the graph is wrong or the explanation.
> Our zero-knowledge proof was interactive—a back-and-forth conversation between the prover and the verifier.
I think possibly the section containing your zero knowledge proof got edited out by accident?
The 'x1 or x2 or x3' node can't be blue (as you say, it's connected to a blue node!)
It doesn't take too long to convince yourself that if we coloured the right-hand node of x1, x2 and x3 all blue, there is no valid colouring of the 'clause 1' bit of the graph where the 'x1 or x2 or x3' node is not blue -- which means there is no colouring of the whole graph.
On the other hand, if I make at least one of the right-hand nodes of x1, x2 or x3 red, then I can colour the 'clause 1' bit of the graph such that the 'x1 or x2 or x3' node isn't blue, so all is fine!
They are trying to explain that this graph correctly represents the SAT problem, because it has a valid colouring if and only if the SAT problem has a solution -- and we do this by checking the clauses one at a time.
But all sudoku puzzles have the same graph structure - a puzzle instance is a partial assignment of colors to nodes.
So can't a verifier can gain knowledge about the prover's solution by asking for edges that correspond to known values?
(I found a different ZKP protocol for sudoku, but I don't think it relates to the graph coloring protocol: https://www.wisdom.weizmann.ac.il/~naor/PAPERS/SUDOKU_DEMO/)
And any time you can think of something as a graph, you can benefit from the wealth of available mathematical and computational tools that apply to all graphs.
After all, an (undirected) graph is nothing more than a ground set and a collection of its two-element subsets.
It's the same reason why groups crop up so often: groups are also really simple structures, so it's really easy to satisfy their axioms 'by accident'. Same for numbers in general.
Not that they would crop up, if you somehow randomly generated mathematical structure. The real world, and especially the part of the real world that people engage with, seems to have a lot of simple structures.
For example, in some cases it can be useful to consider triangles in a 3D model as cyclic graphs of vertices. The edges of the triangle correspond to the edges in the graph.
However I can't think of any case where it's useful to think of a triangle as a hashmap.
However what you gain in the simplicity of the ZKP, you lose in the reduction to 3-coloring. So nowadays people use ZKPs that work with more realistic computation representations, like arithmetic circuits
Graphs are just a very simple generalization of lists. And many problems can be easily modelled as graphs