zk-SNARK

Research
Introduced by
Eli Ben-Sasson
Year
2014
Type
zero-knowledge argument of knowledge
Family
Cryptographic proof systems

What does it do?

A zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) is a cryptographic proof system in which a prover convinces a verifier that a statement is true without revealing the secret data behind it.

The acronym names its properties: zero knowledge, succinctness, a non-interactive proof, and soundness as an argument of knowledge. The construction became widely known through the Zerocash paper, which used zk-SNARKs to build a private payment scheme, and it is now also used for the Zcash cryptocurrency, blockchain scaling, and verifiable computation.

The intuition behind the method

A zk-SNARK turns a statement about a computation into an algebraic check on polynomials. The statement is first encoded as a set of constraints that a valid secret, called the witness, must satisfy. The prover then produces a short proof that the constraints hold, built from polynomial evaluations, without disclosing the witness. In common pairing-based constructions, the verifier checks this proof with a small number of elliptic-curve pairing operations, and the algebra is arranged so that the proof reveals only that a valid witness exists. Formally, the proof establishes that a witness w exists such that R(x, w) holds for the public input x, where R is the relation that encodes the statement. Setup requirements and security assumptions differ across zk-SNARK constructions, so the requirements described below apply to the specific construction being used.

History

The theoretical basis lies in interactive proof systems and zero-knowledge proofs, the foundational work of Goldwasser, Micali, and Rackoff. The practical zk-SNARK constructions were developed around 2013 to 2014. The Zerocash paper (2014), by Ben-Sasson and colleagues, applied zk-SNARKs to a decentralized anonymous payment scheme. Later variants include updatable universal setups and different pairing-based foundations, and the 2018 Bulletproofs paper introduced a non-interactive alternative without a trusted setup.

When to use it

Choose a zk-SNARK when a verifier must check that a prover holds a valid secret or performed a computation correctly, when verification must be cheap, and when the verifier should learn nothing about the private inputs. This suits blockchain settings, where many nodes verify each proof, and confidential computation checks. Do not choose it when the prover must generate proofs quickly for very large computations, since proof generation is the costly step, or when no trusted setup is acceptable for the construction under consideration. In that case, compare transparent alternatives. zk-STARKs do not require a trusted setup. Bulletproofs (Bünz et al., 2018) are non-interactive zero-knowledge proofs that need no trusted setup, have proof size logarithmic in the witness size, and are well suited to range proofs on committed values. Before choosing, check the following: whether a trusted setup is acceptable and, if it is, whether the construction needs a separate setup for each computation or a universal one that can be reused; the proof size the transmission channel can carry; the verifier's cost budget; the prover's time budget; and whether zero knowledge is required at all. If the verifier does not need to hide the witness, a proof without the zero-knowledge property may meet the requirement.

Limitations and considerations

  • Trusted setup: the parameters depend on random values generated during setup. If those values are retained, the holder can produce proofs that verify, and the forgery cannot be detected from the proof itself. Whether a setup is required, and whether it is specific to one computation or reusable across several, depends on the construction.
  • Expensive proving: generating a proof is the costly step, and its cost depends strongly on the size of the statement and on the implementation, so the cost for a given application should be measured before deployment. Verification remains fast. The cost falls on the prover.
  • Encoding effort: the computation must be rewritten as polynomial constraints, which is non-trivial. An error in the encoding can make the system accept statements that are false.
  • Implementation complexity: the underlying mathematics and tooling are harder to review than simpler schemes such as ordinary signatures or hashing.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Zero knowledge: under the cryptographic assumptions of the chosen construction, the verifier learns that a valid witness exists but nothing about the witness itself.
  • Succinctness: proofs are short relative to the computation they certify, which makes them cheap to store and transmit. The Zerocash paper reports transactions of less than 1 kB; this is a figure for that system, not a general size for zk-SNARKs.
  • Fast verification: checking a proof requires a small, fixed set of cryptographic operations, far fewer than re-running the computation. The Zerocash paper reports verification under 6 ms for its transactions.
  • Non-interactive: the prover sends a single proof with no challenge-response rounds, so one proof can be posted once and checked by any party.

Applications

  • Zcash, a privacy-preserving cryptocurrency that uses zk-SNARKs for confidential transactions
  • ZK-rollups on Ethereum, which post a validity proof for a batch of transactions so that the chain can verify the batch instead of re-executing every transaction. The on-chain check consists of a small, fixed set of cryptographic operations per proof, so the chain does not need to repeat the computation of each transaction.
  • Confidential computation verification, where a party proves that a computation on private data was carried out correctly
  • Verifiable computation, where a client checks the result of a computation without recomputing it
  • Identity and credential systems, where a holder proves an attribute without disclosing the underlying credential

How it works

How it works

1

A trusted setup generates public parameters that encode the constraint structure of the statement, from which proving and verifying keys are derived. The random values used in this phase must be discarded, because anyone who keeps them could forge proofs.

2

The prover evaluates the statement on its private inputs to obtain the witness, the secret data that satisfies the constraints. Since the constraints encode the computation, an error in that encoding is carried into every proof built on it.

3

Using the witness and the proving key, the prover constructs a short proof that the constraints are satisfied, without including the witness itself. This is the computationally expensive step of the scheme.

4

The verifier checks the proof against the verifying key and the public inputs, using a small fixed set of cryptographic operations. Acceptance means that the statement holds for some witness; the verifier does not learn the witness.

Common pitfalls

  • Compromised setup randomness: multi-party setup ceremonies reduce this risk by splitting the random values among several participants, so that secrecy depends on at least one participant being honest. They do not remove the dependence on the ceremony being carried out correctly.
  • Encoding the wrong relation: if the constraint system is weaker than the intended statement, it accepts inputs that should be rejected, so proofs of false claims can verify.
  • Exposing private values as public inputs: data that must stay hidden has to be part of the witness. Placing it among the public inputs publishes it together with the statement.
  • Assuming zero knowledge without checking it: the zero-knowledge property depends on the specific construction and its assumptions. A design that relies on it should verify that property for the scheme in use rather than assume it.

Frequently asked questions

What is the trusted setup, and why is it needed?

The trusted setup generates public parameters that encode the structure of the problem, together with random values that must then be discarded. Whoever keeps those values can forge proofs. Multi-party ceremonies reduce this risk by splitting the random values among several participants: a forgery requires every participant to have retained its share, so one participant who honestly destroys its share is enough to keep the setup secure. The ceremony itself must still be carried out correctly.

How long does it take to generate a zk-SNARK proof?

Proof generation cost depends on the size and structure of the computation being proved and on the implementation, so no single figure applies. Proof generation is the costly side of the scheme. Verification is fast: the Zerocash paper reports verification under 6 ms for its transactions, a figure specific to that system. Timings for a particular application should be measured on the intended hardware.

Is zk-SNARK truly zero-knowledge?

The zero-knowledge property holds under the cryptographic assumptions of the specific construction. For pairing-based constructions these typically include the hardness of the discrete logarithm problem in the underlying elliptic-curve group, together with assumptions particular to the construction. Under those assumptions, the verifier learns that the prover knows a witness satisfying the relation, and no information about the witness itself.

What is the difference between zk-SNARKs and zk-STARKs?

zk-STARKs do not require a trusted setup. Their proof size and verification cost differ from those of zk-SNARKs, so the two should be compared for the application. The choice depends on whether a trusted setup is acceptable and on the required proof size and verification cost.

Can zk-SNARKs be used for general computation?

Yes. Any polynomial-time computation can be expressed as a constraint system that a zk-SNARK can verify. Encoding complex computations is nontrivial, and specialized tools such as Circom are typically used for it.

Related methods

Sources

  1. Ben-Sasson, E., Chiesa, A., Garman, C., Green, M., Miers, I., Tromer, E., & Virza, M. (2014). Zerocash: Decentralized Anonymous Payments from Bitcoin. In IEEE Symposium on Security and Privacy (SP), pp. 459-474.

    Open DOI reference
  2. Bünz, B., Bootle, J., Boneh, D., Poelstra, A., Wuille, P., & Maxwell, G. (2018). Bulletproofs: Short proofs for confidential transactions and more. In IEEE S&P 2018, pp. 315-334.

    Open DOI reference