You Could Have Invented ZK Proof - Alessandro Mazza - ETHMilan
ETHMilan 2025 · 8 Jul 2025 · 17:02
Alessandro Mazza shows that anyone facing the right problem could have invented a zero-knowledge proof. Using a prover who spent heavily to solve the partition problem and a verifier who must check the work without learning the solution, he builds the idea step by step: a witness, a Merkle root commitment and Merkle paths. He closes by explaining why ZK proofs matter for Ethereum, including the prospect of running a node on a phone.
Speakers
Topics
From ETHMilan 2025, hosted by ETH Milan.
Transcript
I'm now uh very proud to start this uh 2025 edition uh with uh an Italian of which I've been a fan for many years. So I'm very happy of having made sure that you all can enjoy Alessandro on the stage this morning. Um I I I've always loved his content because he manages to create content that anyone can understand even though he's extremely uh technical in the aspects they are always been very useful. Me myself in my life I've always watched his his videos uh regarding some topics to make sure that he that I could understand them deeper.
So I'm going to leave the stage to your Thank you very much. Okay, I just do one test. Okay. Okay, perfect. Hello everyone. In this speech today, I'm going to explain to you that when you think about ZK proof or in general like ZK technology, you think about a like math and complicated math like really complex math. But in reality, I mean, it's really complex math. But the high level it's very easy and everyone can understand zikk proof.
And so today I'm going to teach you that you could have invented zk proof. If you just have one problem and if you need to solve this problem then you probably would have invented zk proof yourself. So let's start. The first actor is Paul. Paul is an entrepreneur and he has spent a lot of money for buying a lot of computational power. So basically he bought a lot of computers GPU Azik and he did that because he has one job.
His job is called the partition problem. So what he has to do he's given a list of numbers and let's call this list S. So in in our example S contains 1 one 57. And what Paul has to do and this is his job like for for you know for earning money he has to do this job to do this job actually his job is to find s_ub_1 and s_ub_2 which are two subsets of the initial list such that the sum of the items of s1 equals the sum of the items of s2. In this
example, if you can see 1 + 1 + 5 equals 7. So s_sub_1 and s_ub_2 in this example satisfy the constraints. And so they are the solution for the partition problem given the initial list s. And basically Paul has to do this job. So he's given s and he has to find s1 and s2. And you may think this is very easy, but that's easy just because s is very small. This is actually a very hard problem. The partition problem is called an NP problem which means nonpolomial problem which just means it's very hard to do.
Okay. And so this is why Paul has spent a lot a lot of money into buying computational power because if he didn't have this much power he wouldn't be able to find S1 and S2. Okay. So that's why Paul spent a lot of money. Okay. And this is called the partition problem. Now, let's introduce another actor, an actress, Veronica. Veronica is a Polish woman. So, what like her job is to make sure that Paul um does his job correctly and doesn't lie. And what I mean is essentially Veronica has to make sure that S1 and S2 that Paul finds are actually a solution for the partition problem. Okay?
And this is her job. Like she's a Polish woman. should she just have to make sure Paul didn't lie doesn't lie and you know makes makes his job correctly and so you know how can Veronica verify that Paul does his job correctly okay this is the first question we have to ask you know they discuss a bit and then they find the first solution let's just send S1 and S2 to Veronica so Paul finds S1 and S2 and then sends S1 and S2 which the solution to Veronica and then with S1 and S2, Veronica can verify that they satisfy the constraint because the the hard problem is to find
S1 and S2. But if you already have S1 and S2, it's very easy to verify that it's correct and it's a valid solution. And that works. I mean, this protocol, you know, this protocol works because Veronica is able to verify that Paul has done his job correctly. But you know, can we do better? Cuz Paul is not happy. Veronica is happy. But Paul is not happy because Paul has spent a lot of money into buying computational power and then he has to give away his solution for free. And if he gives the solution to Veronica, all his competitors now know the solution and they can just use the solution he found without spending all the money, right? And so Paul said, can we do better because I don't like this
protocol. I don't like the fact that I spent my money and then everyone in the world has my have my solution and so let's try to change slightly change the you know the partition problem in a way that lets Paul find a different way to make sure that Veronic is also happy but Paul is also happy. So our partition problem can be also explained in this way. So we have the initial list s and then instead of the solution be s_sub_1 and s_sub_2 the solution can be a which is the satisfying assignment and we have three constraints. The length of s must equal the length of a
in this example four items for both all elements of a must be one or minus one. And then the docked product this I * S is the docked product must equal to zero. The docked product is essentially the multiplication between the first item of S for the first item of one plus second it second item of S time second item of A. We can do this 1 * 1 1 * 1 1. So 1 + 1 we are two. 5 * 1 5 * 2 so we are 7 and then 7 * -1 - 7 + 7 0 so that a satisfies all three constraints
and so that means that a is a solution is a valid solution for the partition problem. So we just tweak the problem instead of the solution being s_ub_1 and s_ub_2 and the constraint being like the sum of all the elements of s1 must equal the sum of all the elements of s2. Now the solution is the satisfying assignment a and the constraints are these ones. Okay, same problem. I just tweak the problem a bit because this is most more handful for more helpful for what we need.
And now Paul after finding A which is the solution I repeat also create W. W stands for the witness and W is very easy to calculate is the partial sum of the docked product between S and A. Essentially I'm going to create W with you. 1* 1 one. And so the first element is one. Then we have the second element 1 * 1 which is 1 plus the element before which is 1. So 1 + 1 2 and then we have 5 * 1 which is 5 plus the element before which is 2. So 5 + 5 + 2 7 and then again 7 * -1 - 7 + the
element before which is 7. So 7 - 7 0 and then what we do is just shifting all the elements of W to the left to the right and then the last item becomes the first one. Okay, so we have W 0127. Okay, this is also quite easy to do. I mean Paul doesn't have to do a lot of job because if Paul finds a it's trivial to go and create W. And it's very interesting like why did did we create W? Why Paul created W?
Because there is a very useful property between S the initial list and W which is this one. The absolute value of an item of S is equal to essentially the items where the index is summed with one minus the same item of the W. So let's do one example. It's very easy. Let's say I equ= 1. So s of 1 is 1. Let's remember that when you say s1 is not the first element is the second because s0 is the first s1 is the second. So we have one equals to w of i + 1 which is i of w of
2 and w2 is 012. So it's two minus w1 which is 1. So 2 - 1 is 1 equals 1. And this holds true for all the I. You can try. Okay, but we don't have a lot of time. So just trust me. And so right now we have a new protocol that lets Veronica verify the work that Paul did. Let's see this in practice. So S is the initial list. So anyone everyone knows S.
Instead of Paul sending the entire solution to Veronica, let's Veronica ask Paul for two consecutive numbers in this example 0 and one. And then what Paul does is sending to Veronica W0 and W1. So essentially Veronica sends two numbers, two consecutive numbers and Paul sends the value that W has in those numbers. Okay. And then Veronica can make sure that this property holds. Okay, this property here. If it does hold, then it means that Paul did his job correctly.
But the good property now is that Veronica doesn't know the solution A. It doesn't know W. But W is not the solution. Okay, there's like a there are two different things. So, we are very good right now. But there is still one problem. How can Veronica make sure that Paul is not just sending two random numbers that satisfy No. Okay. How can Veronica make sure that Paul is sending actually W0 and W1 and not just two random numbers that you know satisfy this assignment this constraint because Veronica here doesn't have any element so that he can trust Paul. Okay.
So we Paul needs to do one more thing needs to do a commitment to W before the protocol begins. And for example we can use a Merkel root to commit to all the elements of W. So we have our W and we put all the elements of W in the leaves in the leaves of the Merkel tree and then we create the Merkel tree and we find and we we generate the Merkel root. The miracle route is our commitment is the commitment that Paul does to all the elements of W. And so now the protocol is the one is the following one. So before even the protocol begins the shared knowledge that both Paul and
Veronica knows is S and the Merkel root of the commitment of all the elements of W. That's very important. And now it's equal to the it's the same protocol as before but there's a difference. When Paul sends back W0 and W1, he also sends back the Merkel path that it is essentially the way that Veronica can verify that W0 and W1 are actually part of the commitment. And with this kind of protocol, what we achieved what we achieved is that Paul has done his job which is very computational expensive and he has spent a lot of money into make sure that he's the only one that can do that.
And Veronica, which is a police woman, can still verify that Paul does his job correctly without knowing the solution. And that's the perfect, you know, the perfect solution for both Paul and for Veronica that has to make sure Paul is in line. So that's the perfect protocol. And essentially, we started with a problem. And since we did have to find a solution cuz that could be a real life problem, not just a mental problem. I'm explaining to you, okay, that's a real problem. Like complex math, complex cryptography doesn't isn't created just for the fun of the math. It's created because there are problems. And to fix and to solve those problems, you have to
think a lot, right? And then you can find solutions such as these ones. Of course, this is a simplified version. And there are like other things that Paul and Veronica has to do in the perfect ZK proof protocol. But that's just, you know, the high level of a ZK proof protocol. And so yeah, uh we are going to announce that later. So I'm going and don't want to spend too much time on it right now, but you can find me on YouTube and on X as Alessandro Matza. You can just search for me. And yeah, thank you for your attention. If you have some questions, even if even in Italian, that's okay. But in English, that's fine.
[Applause] For example, you could imagine, but that's hard. What's the problem in this protocol? But that's a that's a hard question. But you can try to say what's the problem with this. Sorry, what's the Okay. Uh there are a lot of them, but let's just be in the Ethereum ecosystem since this is ETH Milan. Uh for example, right now there's one big problem. Uh
you cannot run an Ethereum node in your cell phone. And the reason for that is that it essentially takes too much storage you know like two terabytes even even more even 12 terabytes for some nodes. Uh you need to have a very good connection internet connection you have to have a lot of computational power like a very powerful CPU and most iPhones even the most powerful iPhones isn't suited for that. Uh but with the ZK proof you can you can imagine a situation where you have like strong actors that builds the block builds all the blocks and together with building a block they also create a zk proof and they send both the block and the zk
proof when you receive the block right now all the nodes reexecute all the transactions inside the block so that they can make sure that you know this block is valid but with zk proof pro instead of re-executing all the transactions, you can just verify the proof and you can imagine the the verification of the proof is much much faster and doesn't require all the computational power that re-executing all the transactions take. So with Zika proof and this is actually the direction we are going toward uh you can for example there's a very cool uh website from the Ethereum Foundation I think it's called eroof.org or where you can actually see uh like where we are in
terms of you know uh technology because we are not there yet but we are very we are going very fast and so yeah you can imagine you can in five to 10 years you can have your Ethereum node in your cell phone because you don't need to re-execute transactions and still you can don't trust anyone I mean you're trusting the technology the cryptography of Zika proof but we are already trusting cryptography for you know digital signatures so That's fine.
Related talks
- Zero-Knowledge Proofs Panel
- DeFi Security 101 2025 - How Can I audit ZK circuits?
- Fundamentals of Zero-Knowledge Proofs Full Course
- Intro to SNARKs 1: What are SNARKs?
- What to know about Zero Knowledge | Devcon Bogotá
- Zero Knowledge Proofs: Avances en Ethereum, escalabilidad y privacidad en Web3
- Intro to MPC, Garbled Circuit and mpz -- ZK Jumpstart Series #1
- Alessandro Mazza - You could have invented ZK Proofs @alessandro-mazza
- Beginner's Guide to zkSNARKs 3: Math (to get to PLONK)
