Written by Steve Miller
zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) are used to verify possession without revealing any further details regarding the owner to preserve their privacy
While potentially applicable to a wide variety of information, zk-SNARKs were developed by Zcash to preserve the privacy of users conducting transactions with Zcash’s native token, ZEC. Employing zk-Snarks requires a prover, verifier, and witness. The verifier is seeking to confirm the prover possesses knowledge of the witness, often referred to as a secret key. Typically, the prover would be the seller of the asset, transferring the asset to the verifier, who is buying the asset. With the witness confirming the seller possesses the asset and is able to transfer it to the buyer. One advantage of zk-SNARKs versus other zero knowledge proofs is their non-interactivity. So the prover does not need to be actively involved in the verification process for transfers to be completed.
Constructing zk-SNARKs requires three algorithms:
Key Generator – Used to create the proving key and verification key required to generate a proof
Prover – Combines the proving key with the witness to create the proof confirming the prover knows the witness
Verifier – Combines the verification key with the proof verifying the prover knows the witness
A critical element for security purposes is the trusted set up of the key generator. If the key generator is compromised malicious actors can set up fake proofs and undermine the legitimacy of transactions taking place across the network. Because the set up generates the common reference string, CSR, used by the key generator to create the proving and verification keys for proofs.
zkSNARKs in a nutshell by Christian Reitwiessner
Introduction to zk-SNARKs with Examples by Christian Lundkvist