Noob Guide to ZKP

Hey anon, I know navigating the zk world can be quite daunting of a task so i want to use this as a reference for myself anytime i need to revisit the basics again to find my footing. I hope you find it useful on your journey as well.

What are ZKPs(Zero Knowledge Proofs)

There are a bunch of definitions out there but the one that resonates with me more is ZKPs allows a prover to convince a verifier that they know an item without revealing what the item is.

What this means basically is that you can make a claim to know a certain secret without revealing more than your assertion.

Example:

  1. I work at Facebook

  2. I have a Bachelor’s degree

Looking at both examples above you can’t get more than what’s revealed in my claim, for example one you don’t know my name or the department i work, and for the second example you can’t figure out my University or Discipline. ZKP allows communication of knowledge or data without revealing more than what is needed. So in our example ZKPs allows you to veirfy that i work at Facebook or own a degree without revealing any further details.

There are 3 parties involved in this system

a. Prover: A party claiming to know the witness.

b. Verifier: The party verifying the prover’s claim to know witness.

c. Witness: The secret value.

Using the first example as a reference I am the prover claiming to work at Facebook, the other details not revealed is the witness, while you are the verifier trying to check the validity of my claim.

Properties of a ZKP System

A ZKP system should satisfy the following conditions
Completeness : If the proof is valid, it must be accepted by the verifier

Soundness: If the proof is invalid, it must be rejected by the verifier

Zero-Knowledge: The verifier does not learn any information about the witness other than the assertion that the prover knows it.

Use cases

  • Scaling solutions: ZKPs can be used in compressing the data that needs to be stored on-chain. By submitting only the proof rather than the full transaction data, the blockchain’s storage requirements are significantly reduced.

  • Voting systems: ZKPS can be used to create highly secure and verifiable voting mechanisms that enable individuals to cast votes without compromising their identity or revealing who they voted for.

  • Digital Identities: Verification of user identity without revealing any personal information.

Lifecycle of a ZKP

  1. Program: This is where the statements that needs to be proven is implemented as a computation program, you make use of high level programming languages specifically designed for ZKP for this stage e.g Circom, Cairo, Leo, etc.

  2. Arithmetization: By default the computation generated from the High level program are not suitable to generate proofs. So your program gets converted to a typical polynomial equation to facilitate proof generation at this stage.

  3. Constraint satisfaction Problem: This stage checks if there are solutions (values) that satisfy the set of equations from the arithmetization stage. The goal is to demonstrate that the prover knows a solution without revealing it e.g Rank1 Constraints(R1CS).

  4. Information-theoretic protocol: The interactive protocol needed to facilitate communication between the prover and verifier are generated here. e.g Interactive Oracle Proofs(IOPs), Zk-Snarks.

  5. Crypto compiler: This stage is where the information-theoretic protocol is transformed into a cryptographic protocol, the necessary security components are added to make it practical for real world applications.

  6. Proof system: Finally, the cryptographic protocol is implemented in a proof system. This system allows the prover to generate proofs and the verifier to check them efficiently and securely.

The first 3 steps are usually referred to as the frontend component of the ZKP tech stack while the last 3 steps are called the backend component.

I hope this helps trigger some nerves in you to leap more into the wild, see you in the jungle anon.
Drop a comment is you want more of this contents.

Let’s Connect:
Twitter: @mr_abims
Linkedin: Abimbola Adebayo