Even though cryptocurrency transactions aren't tied to anyone's identity, they're normally traceable because they're publicly recorded on a blockchain. If you want to avoid this, you'll need a specific type of cryptocurrency called a privacy coin. One of the methods privacy coins use to keep transactions anonymous is with a technology called zk-SNARKs.

Blockchain crypto technology symbolizing chain of block in digital ledger for cryptocurrency like bitcoin or ethereum. Data security and encryption. Connected nodes, fintech. Abstract background.
Source: Getty images

For those who are considering privacy coins for personal use or as a cryptocurrency investment, it's important to understand the technology behind them. While zk-SNARKs is somewhat complicated, we'll cover exactly what it does in this guide.

What is zk-SNARK?

What is zk-SNARK?

A zk-SNARK is a zero-knowledge proof protocol where one can prove they possess certain information without revealing it and without any interaction between the parties proving and verifying the information.

The term "zk-SNARK" is an acronym that stands for "Zero-Knowledge Succinct Non-Interactive Argument of Knowledge." Each part of the name refers to a characteristic of zk-SNARKs, so it helps to look at each component separately:

  • Zero-Knowledge: The prover can show the verifier that they have a piece of information without providing the information itself.
  • Succinct: The proof can be verified within a few milliseconds since the proof length is only a few hundred bytes at most.
  • Non-Interactive: The proof consists of a single message from the prover to the verifier.
  • Argument: Argument is the term used for these proofs because they don't quite fit the traditional definition of proofs, but they effectively serve the same purpose.
  • Knowledge: Knowledge refers to the information possessed by the prover.

In cryptocurrency, zk-SNARKs are a way for transactions to be private and fully encrypted on the blockchain while still being validated using the network's consensus rules. zk-SNARKs can show that the sender has the amount of funds they want to transfer without making that information public.

zk-SNARKs explained

zk-SNARKs explained

zk-SNARKs comes from the concept of the zero-knowledge proof, which was first introduced in a 1985 paper written by Shafi Goldwasser, Silvio Micali, and Charles Rackoff. As previously explained, a zero-knowledge proof is a method that allows one party to show only that they have a piece of information without revealing the information itself or any additional information.

Early zero-knowledge protocols required the prover and verifier to send messages back and forth. A 2012 paper by Nir Bitansky, Ran Canetti, Alessandro Chiesa, and Eran Tromer coined the term "zk-SNARK" to describe a new zero-knowledge protocol. Unlike prior methods, it wouldn't require interaction between the prover and verifier outside of a single message.

Co-author Chiesa would go on to help found Zcash (ZEC 7.34%), a privacy coin that launched in 2016. It uses zk-SNARKs technology to enable private transactions.

How zk-SNARKs work

How zk-SNARKs work

With most types of cryptocurrency, a transaction is validated by the network checking that certain conditions have been met. Specifically, the conditions are that the sender has the funds available and that they've provided the correct private key to show that the funds are theirs.

zk-SNARKs allow the sender of a transaction to prove all that without revealing any of the addresses or amounts involved. To offer this, the blockchain network encodes some of its consensus rules in zk-SNARKs.

During the transaction process, zk-SNARKs turn the information that needs to be proved into equations. These equations can be evaluated and solved without disclosing the information itself.

Pros and cons of zk-SNARKs

Pros and cons of zk-SNARKs

The primary benefits of zk-SNARKs are the privacy and efficiency they offer. They shield sensitive information, it takes just milliseconds to verify them, and they don't require extended interaction between the parties involved. All that's needed is one message from the prover to the verifier.

Although zk-SNARKs don't have any glaring drawbacks, if someone has the private key used to set up the protocol, they'd be able to create false proofs and counterfeit funds. Privacy coins that use zk-SNARKs must take steps to ensure no single party has access to that private key.

zk-SNARK vs. zk-Rollup

zk-SNARK vs. zk-Rollup

zk-SNARK is far from the only type of zero-knowledge proof used by cryptocurrencies. Another common technology is the zk-Rollup, a scaling solution to help Ethereum (ETH 3.66%) process transactions more efficiently.

A rollup bundles a large group of transactions and validates them off-chain, meaning all the computations are handled off the main Ethereum blockchain. They're then rolled up into a single transaction that's sent to Ethereum's execution layer.

There are different types of rollups available. For example, Optimistic rollups assume transactions are valid until they're proven false. zk-Rollups, on the other hand, instantly verify transactions and generate cryptographic validity proofs. The proofs can be generated using zk-SNARKs or another type of zero-knowledge proof technology, zk-STARKs.

zk-SNARK examples

zk-SNARK examples

The most well-known example of zk-SNARKs is their use in shielding cryptocurrency transactions. Zcash is the first widespread application of zk-SNARKs. This privacy coin allows users to choose between private and transparent addresses. When a user chooses a private address, zk-SNARKs shield the transaction data.

Other blockchain projects are also using zk-SNARKs. Ethereum started working on integrating Zcash and zk-SNARKs in 2017. That same year, Zcash partnered with JP Morgan Chase (JPM 2.51%) on building a blockchain-based payment system with zk-STARKs.

While zk-SNARKs are currently used to privatize financial transactions, that's not their only application. In the future, we could see them used to protect people's data during online activity.

Related Investing Topics

How zk-SNARKs are applied

How zk-SNARKs are applied

zk-SNARKs are applied by turning the information that needs to be proven into a mathematical equation. The sender of the transaction constructs a proof that demonstrates:

  • The transfer's input and output values match.
  • The sender has the private spending keys for the input.
  • Those private keys are cryptographically linked to a digital signature for the transaction, ensuring that it can't be modified by anyone who doesn't have the private keys.

The exact way this works depends on the cryptocurrency. For example, Zcash tracks unspent transaction outputs using what it calls "commitments" and requires revealing a "nullifier" to spend these commitments. To keep commitments and nullifiers private, they're stored as hashes.

zk-SNARKs are a useful technology, and cryptocurrencies that incorporate them have become popular investments. While privacy coins have a clear use case, keep in mind that they're volatile, and the level of privacy they offer could lead to regulatory issues in the future. If you decide to invest in a privacy coin, take a conservative approach and avoid putting in more money than you could afford to lose.

JPMorgan Chase is an advertising partner of The Ascent, a Motley Fool company. Lyle Daly has positions in Ethereum. The Motley Fool has positions in and recommends Ethereum and JPMorgan Chase. The Motley Fool has a disclosure policy.