Background
A while ago I was given a product exercise to brainstorm the potential applications of a small device that can track your location down to 1 meter. While mostly an activity to test my ability to reason through a vague problem systematically, I realized that it’s a useful way of creatively approaching emerging technologies. Blockchains and zk-SNARKs are two key technologies that require this sort of perspective.
The goal of this post is to describe what a SNARK is and how it can be leveraged to build useful products. Most content that I’ve consumed in this space is either too high level or not technical enough; I want to bridge that gap and inspire entrepreneurs and engineers to build on top of zero knowledge proofs. I personally think that this technology is nothing short of magic and am excited to see what gets built in the next 5 to 10 years.
What is a zk-SNARK?
A zero knowledge proof is a mathematical method by which you can prove that you know a fact without revealing the fact itself. Imagine if you were observing a game of hide and seek and wanted to prove to the seeker you knew where everyone was hiding. You don’t want to point out the locations because that would ruin the game, but you also don’t want to sound like a liar. This post gives an example of how you could create a zero knowledge proof in a real life situation.
zk-SNARKs (sometimes referred to as just SNARKs) is a type of zero knowledge proof that give you something even better than a proof of knowledge; they enable you to prove that you computed something honestly and correctly. zk-SNARKs stand for zero-knowledge succinct non-interactive argument of knowledge which means they:
hide the knowledge itself (zero knowledge)
are small in size and easy to verify (succinct)
enable anyone to verify it without communicating with you back and forth (non-interactive)
are proof that you did the math right (argument of knowledge)
You can think of a SNARK as being the result of a special computation whereby private inputs that are secret and public inputs that are known to all are entered into a black box of computation, and an output and proof are produced. The output is the result of the computation and the proof indicates that you did it properly.
Real life example
Let’s say you were in the 10th grade and had this problem assigned:
Find x such that: x^3 + x + 5 = 35
Now imagine that you spent all night calculating the answer and want to prove to your rival classmate that you got it for bragging rights. You could simply tell him the answer is 3, but you don’t want him to copy it. Even if you did share the answer he might accuse you of getting your older sister to do the math for you. With a zk-SNARK, you can prove to your rival that you know the input 3 (private input) that makes the equation (public input) true. SNARKs enable you to provide an output to a computation, and prove that you actually did the computation.
Dark Forest
Let’s look at a product that’s using this tech today which helped me understand the power of SNARKs. Dark Forest is a game whereby hundreds of players fly in space and colonize planets for resources. Each time a player wants to move, they select a new coordinate and submit it to a blockchain record of all player moves. DAI (a cryptocurrency similar to USD) is awarded to players that gain the most resources.
The catch is that nobody knows where other players are, not even the game developers! Much like real space exploration, each player is unaware of the other’s location. This is made possible with zk-SNARKs. From the development team
“A central mechanic in Dark Forest is that the cryptographic “fog of war.” The fog of war ensures that you don’t automatically know where all players, planets, and other points of interests are in the universe; you have to spend computational resources to discover them. This mechanic is secured by zkSNARKs.”
Let’s explain this with an example. Any time a player wants to move to a new location, they submit 2 things to the Ethereum blockchain:
An encoded record of their new location that nobody can decipher (a hashed x and y coordinate)
Proof that a valid move was made, meaning that:
They are departing from a valid coordinate (prevents people from teleporting across the galaxy)
The player doesn’t move too far (prevents players from having infinite rocket fuel)
The player is able to provide all this proof without revealing their actual location.
Why does it matter?
zk-SNARKs have existed for a while but got more attention recently with blockchain applications. Today’s there’s 2 types of blockchain applications of SNARKs in use:
Confidential cryptocurrencies
Here one can anonymously send money to a confidential recipient while proving that the transfer was completed honestly and correctly. ZCash is a great example.
Scaling blockchains through zk rollups.
Hundreds of blockchain transactions can be bundled together and a new state is computed along with a proof. This enables nodes to check the proof instead of needing to run the computations themselves to verify the state update, which is a lot faster. Examples of this include zk Sync.
For a more detailed view of what else is being researched and developed see here.
I believe there are still many new and exciting applications that can and will be built using this technology. In the same way that blockchains were initially used for creating digital money but evolved to support collectibles through NFTs, I expect that novel ideas will emerge from SNARKs. Fundamentally, this technology enables users to have true privacy which will create a unique mental and expectation for products.
Applications
Before diving into the potential applications, it’s crucial to identify the value of a zero knowledge system from a user perspective. Specifically, zk-SNARKs enable users:
To prove a fact on data that they want to keep private
To get access to something anonymously
Additionally, it’s important to state some assumptions:
The computation and verification can happen quickly, even if the program is complex
The computation platform is Turing complete
Advertising
Today’s consumer products are able to remain free because they monetize through advertising. Advertisers pay to display ads to targeted users based on profiles constructed from usage data. This system requires users to give up raw personal data to central systems who decide which ads to show.
But what if ads could be provided in a way that leveraged zk-SNARKs that respected privacy and while keeping the product free? One could build a zero knowledge system by which users voluntarily offer up their anonymized personal data (age, occupation, interests, etc.) in exchange for high quality, targeted ads. This system would be managed by a decentralized app on a blockchain, not a company. Users might even be willing to offer more intimate data such as browser history if it meant better privacy, higher quality ads while still keeping the product free. This model could apply to any content recommendation system including suggested videos and articles.
Job matching
A zero knowledge system could help match job seekers to occupations without revealing intimate details about the individual. For example, a company may want to know if applicants work well with others, so they ask “what is your greatest failure?”. An applicant may work well with others, but be hesitant to respond given that they’re ashamed of a project that missed a deadline for. A potential applicant may not apply even through the company doesn’t care too much about that fact. A zero knowledge system can help people match to jobs in a more authentic way.
A similar concept could be applied to any system where people are to be matched where only partial information is required. For example one could create a dating app built on the principle that a lot more personal data is required upfront, and will be processed by a zero knowledge algorithm to find out if you’re compatible with someone else.
Credit
Today we use a myriad of factors to determine one’s credit score of which include payment history to credit cards and mortgages. Intimate details about all the merchants that we’ve interacted with are available for a credit company to observe. One could build a zero knowledge based system to provide proof of credit, without publishing the transaction history. For example, let’s say that the credit calculation was dependent on a public definition that only included whether full payments were made on a mortgage. In this scenario, other personal purchase history is irrelevant. A SNARK could be used to prove that you qualify for a new credit card without revealing your entire purchase history.
Fandom
Zero knowledge proofs can help us build new social media applications. Take Bitclout for example, which is a protocol that allows you to invest in individual people. If a person that you invested in ever became famous, you could prove that you were a trend setter and knew about them early. That’s possible with today’s technology; I can see someone one else’s follows/likes on Twitter. But in a zero knowledge system you could enable users to invest without worrying about their past investments being visible. This might enable more authentic expression of who/what people find valuable.
Similarly, NFTs can serve as a means for showcasing your fandom, but it’s hard to have privacy with today’s products. If I share my nbatopshot user name with my friends, they can see all my moments and determine my collection’s worth in dollars. Zero knowledge proofs can enable us to prove that we own a type of moment without revealing our whole collection. For example, imagine if an exclusive NBA fan club on Discord required that you own at least 1 rare LeBron moment. You could use a zero knowledge proof to indicate that you have one without revealing your expensive collection containing thousands of dollars worth of moments.
Conclusion
Hopefully this post gave you an appreciation for what zk-SNARKs are and what they’re capable of. I’m curious about what sort of new emergent behaviors we might see in a world where these zero knowledge apps are common. Perhaps people may be more authentic online if they know with 100% certainty that their data and privacy is being protected. Additionally, it’s essential to consider how to market and message these products. People shouldn’t need to know the math details behind these systems in order to be able to trust and use it.
We’re just at the beginning of this space and I can’t wait to see what the future has in store.
If you’re interested in going deeper here are some great resources:
To stay up to date with the latest, join this community
To build a web app app with this tech, checkout this library
To learn the theory behind how this works read this explanation and this blog, watch this youtube video and read this paper
Subscribe to Cryptechary for more content on crypto, tech and general musings!