# ZK Proofs Part II: ZK Maths **Published by:** [0xDanki ( Tin Erispe )](https://paragraph.com/@tinerispe/) **Published on:** 2023-05-09 **URL:** https://paragraph.com/@tinerispe/zk-proofs-part-ii-zk-maths ## Content Standing before Danki today are ghosts of the audit reports I haven’t read and dat job hunt I’ve been meaning to do for weeks now… but in the name of mighty procrastination, let’s write something totally fun but completely unrelated to everything I needed to do: ZK maths frens. If you have no idea what this is all about and why danki is so happy as my hooves type dis post, then check out Part I. But if you’re too lazy to click… ZKP or Zero Knowledge Proofs is a cryptographic mechanism that allows you to prove that something is true without revealing any more information other than the fact that it is true. It sounds like magic, so today I’ll demystify how this happens under the hood.Consider this problem…Let’s say Marites has ten million data points of hot gossip (it’s a really huge set) and told it to a person inside a confession box. That person is Becky, but Marites doesn’t know that. How does Marites ensure that Becky is the person who heard all her 10 million hot gossips? Well, der are a few ways that Marites can verify from Becky:Option 1: Ask Becky to recite all the 10 million gossipsNow, this frens, requires a martyr out of Marites and Becky. Because who has time to recite ten-facken-million gossips? It requires so much time and computational power from both of them that it’s impractical.Option 2: Ask Becky to just recite one gossip from the setFast, but it doesn’t prove that Becky really has all of the gossips. Becky might just have a lucky guess.Option 3: Make a polynomial whose graph go through all the 10 million numbers that represent each gossipHoly schmoly. This is probably the answer, but you’re now thinkin, “whuuut--?” Okay, calm down. Just look at this:Image by Porter Adams whose class introduced me to ZKNotice that any two different polynomials go through different points most of the time. There may be a few points where their curves intersect, but that’s about it. Now, let’s say dat this is the polynomial that goes through Marites’ 10 million gossips. Of course just imagine the real one will be much, much complicated but for da sake of visualization:Image from Interactive MathematicsIf Becky knows the 10 million gossips, she can recreate this polynomial. But the polynomial will be complex and it is still too lengthy to recite to Marites… Besides, from Becky’s point of view, she doesn’t know if Marites is a actually the person who told her the 10 million gossips while she’s inside the confession box. If she gives Marites the full polynomial, she practically risks leaking all the gossips to some random stranger. So Marites, instead of asking Becky for the polynomial, will give Becky a number and ask her to compute for the value of the polynomial at that number. If Becky answers correctly, then Marites is convinced that Becky knows the polynomial and is really the person who heard all her 10 million gossips. And voila, that is ZK Maths in a nutshell my frens.Non-interactive ZK ProofsWhat if there are many people claiming to be Becky? Marites will soon find that it’s tiring to pick a number and it’s taking so much of her energy to ask the same cursed question everytime. So everyone agrees to just evaluate the polynomial at x = 123. Cool. Now Marites doesn’t even need to ask the question. Anyone who claims to be Becky can just post their answer and a robotic verifier can check. But there’s a problem with this. If everyone has the power to set the question and they already know the question beforehand, it will be easier for someone to cheat on the exam innit? Presenting ZK Snarks-- dis neat little non interactive ZK creates a trusted setup for picking the number. In the trusted setup, no one knows the number beforehand because it will be generated as the verifier interacts with the setup. If you’re curious what this trusted setup is, it’s just an algorithm. And the algorithm is created randomly in a trusted setup ceremony. Anyway, an example of a trusted setup works like this:Image from WikipediaThis math or mechanism where the prover uses a trusted setup to create a digital signature from their proof is called the Fiat-Shamir Transformation.Ok, dis has gotten longer than I thoughtSomry fren, but we have to continue dis some other time. Danki iz hungry now, and the next one will be about ways a ZK-SNARK improves all these polynomial verifying via polynomial commitment and recursion, which iz a topic of its own. So wait for it. Mor mor math once Danki haz been fed. つづく ## Publication Information - [0xDanki ( Tin Erispe )](https://paragraph.com/@tinerispe/): Publication homepage - [All Posts](https://paragraph.com/@tinerispe/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@tinerispe): Subscribe to updates