Kenneth Scott Smith

A Zero Knowledge story

Stardate: 2024-06-289 min

An adventure story of my journey through a six-week ZK educational bootcamp

Captains Log | A ZK Story

Cosmic Encounter with Alien Cryptography

The void whispers. In the endless dark between stars, something ancient stirs. As our ship drifted through the cosmic silence, proximity alarms shrieked to life. Before us loomed a colossal structure— a derelict space station perhaps, or something far older. Its geometry defied comprehension, surfaces twisting in ways that hurt the eyes and mind alike.


We had no choice. Our fuel reserves were critical; we needed to dock. As the airlock hissed open, dread settled in my stomach like a cold, heavy stone. The air inside was stale, carrying the weight of eons. Our flashlights revealed corridors lined with alien script, pulsing with a sickly bioluminescence. Each character seemed to writhe and shift when observed directly, as if alive and aware. This was no mere language— it was something far more ominous. Something that could alter reality itself. "Zero-Knowledge Proofs," whispered our xenolinguist. Her name was Evey Hammond and her voice was trembling. "We've stumbled upon the Cryptographic Forge of the Ancients." Legend spoke of a long-dead civilization that had mastered the art of proving without revealing, of validating truth while shrouding it in impenetrable mystery. We thought it mere myth, a cosmic fairy tale. How wrong we were.


As we ventured deeper into the station's bowels, we encountered terminals humming with eldritch energy. Screens flickered to life, displaying mathematical formulas so complex they seemed to fold space-time around themselves. Our engineer, Fawkes, reached out to touch a console. His fingertips had barely grazed the surface when his eyes rolled back, mouth agape in a silent scream. When he collapsed, his neural implant was fried, circuits slagged by an overload of raw, alien data. We were in over our heads, trapped in a realm where information was both weapon and shield, where knowing too much could shatter a mind, and knowing too little meant certain doom.


There was no turning back. To survive, we had to decipher this cosmic cryptography, to bend our minds around concepts that threatened to unmake them. Six weeks, we estimated. Six weeks to either master this alien science or be consumed by it. And so began our descent into the abyss of Zero-Knowledge Proofs, a journey that would push us to the very edge of sanity and beyond. Week 1 loomed before us, a gaping maw of enigmas and paradoxes...


Week 1-2: The Initiation

The first two weeks were a brutal assault on our senses and sanity. The station's AI, a ghostly presence that seemed to seep from the very walls, bombarded us with alien concepts: the foundations of cryptography, the twisted logic of ZKP theory, the whispers of something called "ZoKrates." This was the first alien language for creating proofs on the Ethereum Network. The language allowed for verifiable computation to generate proofs and to verify those proofs in the common Ethereum tongue of Solidity.


What the hell is this?, we suddently found ourselves wondering when we happened upon some hieroglyphic alien writing. It appears to be a diagram showing transformations for earlier versions of the alien SNARKS. It appeared to describe a general process. I shined my flashlight over it's remarkable detailings of its two processes:


Arithmetization

  • A public program is converted into a constraint system, a set of rules a prover must satisfy.
  • The prover can only satisfy the constraint system with knowledge of the public inputs and the secret.

Polynomial Commitment/Evaluation

  • The prover encrypts the polynomial such that it leaks no information about the secret.
  • A verifier can then evaluate it to ascertain that it indeed satisfies the specified constraints.

zk-snarks

Transformations of early versions of SNARKS


We continued on our way, stumbling through corridors that seemed to rearrange themselves, each turn revealing new horrors of mathematical complexity. The Starknet Nebula pulsed in the viewports, its swirling gases forming equations that burned themselves into our retinas. Cairo, we learned, was not just an ancient Earth city, but a programming language that could bend reality itself. As we grappled with these eldritch tools, we felt our minds expanding, painfully, like balloons ready to burst. But there was no time for respite. The station's defenses were adaptive, becoming more challenging with each passing day. We had to evolve or perish...


Week 3-4: The Metamorphosis

By the third week, we were no longer the same beings who had entered this cryptographic nightmare. Our eyes had grown accustomed to the darkness, seeing patterns in the void that we once would have dismissed as impossible. We traversed the Noir Constellation, its black holes serving as gateways to simplified ZKP development. The binary pulsar of the Mina System became our lodestar, guiding us through the compression of entire blockchains into quantum singularities.


But it was in the fourth week that we truly began to grasp the horrifying beauty of our surroundings. The gravitational forces of ZK-SNARKs and STARKs warped our perception, showing us truths that existed in the spaces between reality. We were no longer merely observers of this alien technology; we were becoming one with it.


The Noir Constellation... In all of its glory was awe-inspiring. We marveled at it's magnificence. Evey, our xenolinguist, was as brilliant a sketch artist as she was a polyglot. She charted down this constellation in all of its remarkable detail. She shaded the color to be as tantalizing as her skill with a quill, but in truth the constellation was as black as it's mysterious aurora, thus the name Evey gave it that evening, as she spoke in a delecate French accent, Noir:


noir

Noir Compilation Flow


Fawkes, our equally brilliant engineer, took the liberty of deciphering the constellation's flow, revealing the language it wanted to speak out into the galaxy:


Application Layer

  • The voyage begins with writing a Noir program. This high-level code defines the logic and constraints of our ZK proof

Intermediate Representation

  • The Noir program is compiled into an ACIR (Abstract Circuit Intermediate Representation). ACIR's act as a bridge for backend systems. They can easily be transformed into different circuit-based contraint systems used by zkSNARK systems

Backend Proving systems

  • The ACIR connects with different backend proving systems. These systems (i.e. Plonk, Barrentenberg, Halo2, etc.) are responsible for generating the actual ZK proofs. Each backend system has its own strengths and optimizations.

Verifier Contract

  • Once the proof is generated, it needs to be verified. This is where we invoke the Solidity verifier contract. The verifier contract, written in Solidity, ensures the proof's validity on the blockchain.

Blockchains

  • Finally, the verifier contract is deployed on a blockchain (Ethereum, Optimism, Arbitrum, Solana, Cosmos, etc.). The verifier contract can be used to validate proofs across these chains.

Week 5-6: The Final Countdown

As we entered the final stretch, the station's core opened before us—a swirling maelstrom of pure information. Here, in this digital hell, we faced our ultimate challenge: the creation of our own Zero-Knowledge artifact.


Inspiration struck like a cosmic ray, searing a vision into my mind: we must fly our ship to a nearby star system. There lied a planet known to us to have oil we can refine into fuel; an alien world to us but nonetheless a safehaven for us to refuel and hope for us to return home. But.... The key to doing so was to find a path without revealing what that path was. We must not let our secret path be known to our alien technological adversaries, for surely they will seek to thwart us. Using the deciphered language spoken to us by the shining light of the Noir constellation, I began to craft a proof system that could verify the ship's path without revealing its cosmic trajectory.


The ship's secret path became a metaphor for our journey, a hidden truth known only to the prover, like the twisted passages between wormholes. The verification process emerged as an immutable law of this new universe we were creating, confirming the truth without exposing the eldritch horrors that lurked beneath.


space_chessSecret Path to Alien Planet

As the final hours ticked away, I wove together the frontend and backend of our creation, my fingers flying across keyboards that seemed to pulse with alien life. NoirJS became my familiar, a daemon that bridged the yawning chasm between the ZKP engine room and the user interface that would be our last line of defense against the encroaching void. At last, we had a Proof Generator. We mapped a course to our destination and used this alien cryptography to conceal the journey itself. We could prove we knew how to get there and verify our path, all without leaking information about the path itself.


user interfaceUser Inteface to Generate Proof

The Reckoning

When the last line of code fell into place, an eerie silence descended upon the station. The humming of alien machinery faded, replaced by an expectant quiet. We held our breath as we initiated the final compile sequence.


For a moment, nothing happened. Then, with a sound like the birth of a universe, our creation sprang to life. Screens throughout the station lit up with a cosmic dance of proof generation and verification, more intricate than the fabric of space-time itself. We had done it. We had harnessed the power of Zero-Knowledge Proofs, bent the laws of information to our will.


The airlock cycles open. Beyond lies the fuel needed for our ship, and beyond that, the vast expanse of a universe now strange and new to our transformed perceptions. We carry with us the power of ZK Proofs, a force that can reshape the very foundations of trust and privacy across the digital cosmos.


The journey of the cosmic coder never truly ends. It merely evolves, taking us deeper into the beautiful, terrifying unknown of the cryptographic universe.


Ad astra per aspera. To the stars, through hardships.