Skip to main content

Entry Gateway

Intro & Welcome to ZK Programming

This is the central gateway course for advanced technical education in Zero-Knowledge cryptographic protocols for blockchain, all the way from its mathematical foundations to advanced Rust implementations.

What is ZK & what does it offer in the blockchain? This is the first question that needs to be answered right before teaching and learning about the topic. ZKP stands for Zero Knowledge Proofs which is a cryptographic system that allows one party (the prover) to convince another party (the verifier) that a certain digital information or program is mathematically authentic and legitimate.

ZK solves two of the most challenging hurdles in the blockchain which are privacy & scalability.

  • Privacy: Thanks to ZK, for the first time we are able to interact with decentralized networks with the ability to maintain absolute anonymity; whether that means preserving your sovereign data on projects like ZK Identity, or shielding transaction values and asset lineages on privacy-centric protocols like ZCash & Tornado Cash (though the US bans it).

  • Scalability: Notable projects include ZkSync, Aztec and others. They leverage the ability of ZK to produce tiny cryptographic proofs that bundles together thousands of trasactions that each would have otherwise taken its own gas cost.

Are you qualified to take the course and learn ZK?​

Well, this is also another thing you have to take account into. First of all, nothing is hard to learn in this world. It is just matter of attitude, effort and if you were exposed to basic prior knowledge required to learn whatver you are learning. For this matter, ZK is not for everyone. It has a steep learning curve. It is certainly not for the dudes afraid of Math. However, this categories of experts tend to find more ease than the rest. This are poeple from Mathematics, Physics & Engineering and Computer Science. Don't worry, if you have basic high school or College math, then it is possible for you to grab contents though more efforts & research is needed from the learner.

Who am I to Pull this Off?​

I don't mind being called alien from Mars but i am known as Fahim on earth. I have been ever-fascinated by Math & Physics since my high school era. Thereafter, I did Undergraduate Degree in School of Engineering under the department of Energy(Not as mathy as i wanted it to be). Then i went after smart contract security audit, which had more amazing math built into code. Then upon seeing high & low dopamine floods associated with finding bugs, i decided to quit there and look for more research-inclined & math-heavy field. That is how i came to fall in love with ZK.

My ZK Journey & Why I am doing this stuffs here​

My first time coming to learn ZK was interesting. I came straight from Solidity and EVM stuffs directly to the scary Mathematical field of ZK. I went straight to lectures of Professors like Dan Boneh & Justin Thaler talking about Polynomial-IOPs. Woof! The concepts looked fantastic and i enjoyed but at the cost of not getting what is what, where is South and North. For 3 months, i just swallowed random heavy unkown academic jargons of math. After another 5 long & research-intense months, is when i figured out how ZK is structured right from the Foundational math ZK is built on, to advanced Systems like VMs.

ZK sits at the intersection of Computer Science, Finance and Mathematics. Currently it is one of the newest fields in cryptography. Because of this, its carriculum has not yet been formalized by the academic world especially its application on the blockchain. Because of this, I am putting together some of the best materials i came across in my fulltime reaserch on ZK so that no one should undergo indefinate mental fatigue again.

Remember my focus only is about Rust & Application of ZK on the Blockchain space.

🧭 The Core Learning Gates​

I have designed this curriculum into three separate structural paths. Every section builds directly upon the one before it. I am not claiming this to be the end-all & be-all course. Feel free to get the best out of It and tag me for comments and corrections.

If you are new to ZK, it is advisable to learn the concepts chronologically. As for advanced researchers, academicians and programmers, you can jump around like a frog.

Gate I: The Mathematical Bedrock of ZK​

This is the mathematical baseline for the whole course. It lays the foundation on which ZK Proving systems are built on. Since mathematics is the secret weapon ZK utilizes, it is essential to understand how mathematics renders computer science theory into reality. Treat this part as the most important part of the course!

My plan is to structure Gate I, in this manner.

  • Phase 1: The mathy ground like finite fields, modular operation, algebraic primitives etc.
  • Phase 2: These are compression and speedy mathematical tools like Lagrange interpolation, Schwartz-Zippel lemma, NTT etc.
  • Phase 3: This is all about circuit arithmetization that turns raw programming code to algebraic equations and polynomials. Examples are topics like R1CS, QAP, PLONKISH, AIR.
  • Phase 4: This are the final vaults where evrything is hidden in commitment schemes(KZG,IPA, FRI).

Phase 1 lays the safe mathematical ground for cryptographic proofs. Phase 2 dives into the tools for speed & compression, as we know that generating proofs involve millions of mathematical steps. arithmetization of Phase 3 comes here to turn code into set of polynomials since ZK compilers and engines do not understand Rust or any other programming syntax like if & else statements. Finally at phase 4, we need geometric wrappers to seal those polynomials inside elliptic curves and commitment schemes so that secret inputs stay invisible while the final proof shrinks to a few hundred bytes.

Gate II: Different ZK Proving Systems & Protocol Architectures​

A structural breakdown of different zero-knowledge protocol implementations. Here, i will analyze how real-world frameworks have been implemented in the blockchain.

  • Groth16 - Case Study: Tornado Cash
  • PLONK - Case Study: Aztec Network
  • STARKs - Case Study: Starkware
  • Bulletproofs - Case Study: Monero

Gate III: Virtual Machines & Execution Layers​

In this this layer, we shall delve into into some of the execution engines like VMs and zkEVMS. This are systems engineered to run independently and provide tiny crpytographic proofs without massive system overhead. Some of what we shall get into include:

  • General-Purpose zkVM : A general-purpose machine built to support standard, pre-existing software architectures that adapt the math to fit standard programming code (like Rust) and executes it inside an environment that can mathematically prove the code ran honestly. Example applications include RISC Zero & Succint Lab's SP1.
  • zkEVM Landscape: This are special VMs designed to mimic the EVM, so that it can execute Ethereum smart contracts while generating cryptographic proofs without massive gas cost effect. We shall evaluate Vitalik Buterin's Type-1 through Type-4 zkEVM architectures.
  • Custom Cryptographic VMs : A good example here is CAIRO VM, where they dodge the use standard CPU rules that makes the math proofs slower and heavier. Instead, they invented a brand-new assembly language (CASM) and virtual machine architecture, designed purely to make generating STARK proofs as fast as mathematically possible.

I am thinking of adding another Gate IV: Applied ZK Engineering & Circuit DSLs but let me give it time. I will see as time goes on.


Click Next below to advance to Lesson 1.