SNARK vs. STARK

from “prove this computation” to polynomial commitments, trusted setup, transparency, proof size, verification, recursion, and real proving-system architecture

Start with the actual problem

Suppose Alice performs a computation and obtains a result.

program(input) = output

Bob wants confidence that Alice really performed the computation correctly.

The obvious solution is for Bob to execute the program himself.

Bob → execute program → check output

But that can be expensive when the computation is enormous.

A zero-knowledge proof system changes the problem:

prover large computation small proof verifier

The verifier checks the proof instead of repeating the entire computation.

SNARKs and STARKs are families of cryptographic proof systems that solve this general problem.

The shortest possible distinction

SNARK

Succinct Non-interactive Argument of Knowledge. Many SNARK constructions achieve very small proofs and fast verification, often using polynomial commitments based on elliptic-curve cryptography.

STARK

Scalable Transparent Argument of Knowledge. STARKs use transparent setup and hash-based polynomial proof techniques such as FRI, making them naturally suited to large trace-based computations.

Important: SNARK and STARK are not single algorithms. They describe families of constructions with different assumptions, representations, commitment schemes, and performance characteristics.

What do the words actually mean?

SNARK

S — Succinct
N — Non-interactive
A — Argument
K — Knowledge

Succinct means the proof can be much smaller than the computation being proved.

Non-interactive means the final proof can be verified without an ongoing back-and-forth conversation between prover and verifier. In practical constructions, Fiat–Shamir is often used to turn an interactive protocol into a non-interactive one.

Argument generally means computational soundness: a computationally bounded cheating prover should not be able to convince the verifier of a false statement except with negligible probability.

Knowledge means the proof is intended to demonstrate knowledge of a witness satisfying the statement, under the construction's precise knowledge assumptions.

STARK

S — Scalable
T — Transparent
A — Argument
K — Knowledge

Scalable refers to proof systems designed to handle very large computations efficiently, with prover complexity intended to scale well with computation size.

Transparent means the protocol does not require a secret toxic-waste setup parameter. Publicly specified randomness and hash functions can be used instead.

Where does zero knowledge enter?

Imagine the statement:

“I know x such that f(x) = y.”

The prover wants to convince the verifier that such an x exists without revealing x.

We therefore distinguish:

public input

The information the verifier is allowed to know.

private witness

The secret information that makes the statement true.

A ZK proof aims to convince the verifier about correctness while revealing no additional useful information about the private witness beyond what is implied by the public statement.

Statement, witness, computation

Most modern proof systems can be viewed through the relation:

R(x, w) = true

where:

x = public statement
w = private witness

The prover knows w and wants to prove:

∃ w : R(x,w) = true

For a computation, the relation can encode the fact that an execution trace, circuit witness, or other representation satisfies all required constraints.

First bridge: computation becomes constraints

Neither a SNARK nor a STARK directly proves an arbitrary program written in Rust or Python.

There is an intermediate mathematical representation.

program computation constraints proof

For circuit-oriented systems, this might be R1CS or another circuit constraint system.

For STARK-style systems, this is commonly an execution trace plus AIR constraints.

SNARK path: R1CS as an example

Suppose:

z = x · y

We can create a witness vector:

W = [1, x, y, z]

An R1CS constraint can enforce:

(A · W)(B · W) = C · W

For example:

A = [0,1,0,0]
B = [0,0,1,0]
C = [0,0,0,1]

which gives:

x · y = z

A complete circuit produces many such constraints.

STARK path: AIR as an example

A zkVM naturally produces a sequence of machine states:

state₀ → state₁ → state₂ → … → stateₙ

These states form an execution trace.

AIR then describes the rules that every valid transition must satisfy.

For a toy register:

rᵢ₊₁ = rᵢ + 1
rᵢ₊₁ − rᵢ − 1 = 0

Boundary constraints specify where the computation starts or ends.

r₀ = 2

This trace-oriented structure is one reason STARKs fit naturally with zkVM architectures.

The common language: polynomials

Although SNARK and STARK constructions can look very different, polynomial algebra is central to many of them.

A polynomial is:

f(x) = a₀ + a₁x + a₂x² + … + aₙxⁿ

A proving system can transform computation into polynomial statements and then prove that those statements hold.

This is the deeper connection:

computation constraints polynomials proof

Polynomial commitments

Suppose the prover has a polynomial:

f(x)

The verifier should be able to reason about this polynomial without receiving all of its coefficients.

A polynomial commitment provides a compact cryptographic commitment to f.

KZG-style

Uses algebraic commitments based on elliptic curves and pairings. A structured reference string is commonly required.

FRI-style

Uses hash commitments to evaluations and recursively reduces polynomial degree through folding.

This is one of the most important architectural differences between many pairing-based SNARKs and STARKs.

KZG: the pairing-based path

Let the polynomial be:

f(X) = a₀ + a₁X + … + aₙXⁿ

Conceptually, a KZG commitment uses a secret setup value s and publishes group elements related to powers of it.

[1]G, [s]G, [s²]G, …

The commitment can then be formed conceptually as:

C = [f(s)]G

The verifier does not learn s. The cryptographic structure allows the verifier to check an evaluation proof using pairings.

Important: this is a conceptual explanation. Concrete KZG schemes have precise group, scalar-field, subgroup, serialization, and pairing requirements.

What is the trusted setup?

A trusted setup is a protocol that generates public parameters containing secret randomness that must not remain known to an attacker.

For a simple conceptual setup:

secret s → setup ceremony → public powers of s

If the toxic secret is destroyed correctly, users can safely use the public parameters.

The problem is not that every SNARK requires a trusted setup.

The accurate statement is:

precise distinction
Some SNARK constructions require a trusted setup; other SNARK constructions use transparent or different setup models.

Similarly, the STARK family is characterized by transparency and does not rely on a secret toxic-waste parameter in the same way.

FRI: the STARK path

FRI stands for Fast Reed–Solomon Interactive Oracle Proof of Proximity.

The high-level goal is to convince the verifier that a function represented by evaluations is close to a low-degree polynomial.

Conceptually:

high-degree candidate → fold → smaller-degree candidate → fold → …

At each stage, the prover commits to the relevant evaluations, and verifier challenges determine how the folding proceeds.

Fiat–Shamir can remove the need for an interactive verifier by deriving challenges from the transcript.

polynomial evaluations Merkle commitment challenge fold repeat

Why Merkle trees appear in STARKs

Suppose the prover has a huge list of field-element evaluations:

v₀, v₁, v₂, …, vₙ

Hashing each value gives leaves of a Merkle tree.

leaves → hashes → parent hashes → … → Merkle root

The root is a compact commitment to the entire list.

Later, the prover can reveal selected values together with Merkle authentication paths.

The verifier checks that the revealed values belong to the committed dataset without downloading the entire list.

Transparency

Transparency means the verifier does not have to trust a secret setup contribution.

A STARK-style system can use publicly specified:

  • finite fields;
  • hash functions;
  • evaluation domains;
  • protocol parameters;
  • Fiat–Shamir transcript rules.

There is no secret s that must be generated and destroyed as part of the core commitment mechanism.

Transparent does not mean “no cryptography.” STARKs still rely on cryptographic hash assumptions and the security of the underlying algebraic proof protocol.

Proof size

One of the most visible practical differences is proof size.

many pairing-based SNARKs

Can produce extremely small proofs, often roughly constant-sized with respect to the number of constraints, depending on the construction.

STARKs

Proofs are generally larger because they contain hash-based commitments, authentication paths, query information, and FRI data.

This creates a classic engineering trade-off:

smaller proof ↔ more algebraic / pairing-heavy machinery
larger proof ↔ transparent hash-based machinery

Verification

The verifier should perform substantially less work than re-running the original computation.

For a pairing-based SNARK, verification may involve a small number of elliptic-curve operations and pairings, depending on the construction.

For a STARK, verification typically involves:

  • hash computations;
  • Merkle authentication checks;
  • field arithmetic;
  • FRI verification;
  • constraint evaluations at queried points.

Both approaches aim for verification that is much cheaper than recomputing the full computation.

Prover cost

The prover is usually the party doing the expensive work.

A simplified picture is:

large computation expensive algebra proof

STARK provers often benefit from highly parallelizable operations such as:

  • large-scale field arithmetic;
  • FFT/NTT-like transforms;
  • hashing;
  • Merkle tree construction;
  • FRI folding.

Pairing-based SNARK provers also perform substantial work, commonly involving multiscalar multiplication, polynomial operations, and commitment-specific computations.

Security assumptions

This is one of the most important differences.

Pairing-based SNARKs

Many pairing-based SNARKs rely on algebraic assumptions related to elliptic-curve groups and their discrete-logarithm-style hardness.

The exact assumption depends on the construction.

STARKs

STARKs primarily rely on collision resistance and related security properties of cryptographic hash functions, together with the soundness of the underlying algebraic proof protocol.

Do not oversimplify this to “SNARKs use elliptic curves and STARKs use hashes.” That is a useful beginner's mental model for common constructions, but the families are broader than those two implementation choices.

Post-quantum considerations

Many commonly used pairing-based SNARK constructions rely on elliptic-curve assumptions that are vulnerable to sufficiently powerful quantum computers using Shor's algorithm.

Hash-based STARK constructions do not rely on elliptic-curve discrete logarithms in the same way, so they are generally regarded as having a more direct path toward post-quantum security, with appropriate hash-function security margins.

This does not mean “STARKs are automatically post-quantum secure.” The concrete protocol and parameters still matter.

Recursion

A recursive proof verifies another proof inside a proof.

proof₁ + proof₂ + … → recursive proof

This is useful when a system wants to compress or aggregate many computations.

Recursion can be built for both SNARK and STARK families, but the engineering techniques differ.

Pairing-friendly curves can make some recursive SNARK constructions efficient. STARK systems can use their algebraic and hash-based structure to build recursive or proof-composition systems as well.

Aggregation

Suppose a blockchain has many transactions, each with a proof.

proof₁, proof₂, proof₃, …, proofₙ

Instead of verifying every proof independently, a system may aggregate them into a smaller number of proofs.

This is important for rollups and scalable blockchain systems.

many proofs aggregation / recursion compact verification

Not every SNARK is the same

This distinction matters when reading ZK papers.

Groth16

A famous pairing-based zk-SNARK with very small proofs and efficient verification, but with circuit-specific setup requirements.

PLONK-style systems

Use polynomial-based arithmetization and can support more flexible circuit settings. Different variants have different setup and commitment choices.

transparent SNARKs

Some SNARK constructions avoid a traditional trusted setup, showing that “SNARK = trusted setup” is not a universal definition.

STARK systems

Use transparent, typically hash-based polynomial proof machinery and often pair naturally with AIR and execution traces.

The same computation through both lenses

Suppose we want to prove:

out = (a + b) · (c + d)

Circuit / R1CS style

t₁ = a + b
t₂ = c + d
out = t₁ · t₂

Then convert those relationships into R1CS-style constraints.

Trace / AIR style

If this expression is part of a long-running machine execution, record the relevant machine state at each step and define transition constraints that describe how the state changes.

The two approaches prove the same logical statement, but organize the algebra differently.

SNARK vs STARK at a glance

Property SNARK family STARK family
Meaning Succinct Non-interactive Argument of Knowledge Scalable Transparent Argument of Knowledge
Proof size Often extremely small in pairing-based constructions Generally larger
Transparency Depends on construction Core design characteristic
Trusted setup Some constructions require it No secret toxic-waste setup in the core STARK approach
Common commitment KZG or other algebraic commitments in many constructions Hash/Merkle commitments + FRI in common constructions
Common representation Circuits / R1CS / PLONK-like arithmetizations AIR / execution traces
Elliptic curves Common in pairing-based SNARKs Not required by the core STARK approach
Hash usage May be used, depending on construction Central to common transparent constructions
Post-quantum path Depends strongly on construction Hash-based assumptions provide a more direct path
zkVM fit Possible Very natural for trace-based zkVMs

Why are STARK proofs usually bigger?

A useful intuition is that STARKs expose more of the low-degree testing machinery to the verifier.

The proof may contain information associated with:

  • Merkle roots;
  • queried evaluation values;
  • Merkle authentication paths;
  • FRI commitments;
  • FRI query responses;
  • final low-degree information.

A pairing-based SNARK can compress a large amount of algebraic information into a small number of elliptic-curve group elements.

That is why comparing only proof size can be misleading: the systems make different cryptographic trade-offs.

Why can some SNARKs be so small?

Pairing-based constructions exploit algebraic structure in elliptic-curve groups.

A verifier can check a compact collection of group elements and pairing equations that encode the correctness of a much larger computation.

Conceptually:

huge computation → algebraic encoding → tiny group-element proof

The price is that the construction may depend on stronger algebraic assumptions and, for some schemes, trusted setup.

Rust: the difference at the representation level

Educational R1CS vs trace-style AIR
rust
// R1CS-style thinking:
// explicitly describe relationships among witness variables.

let witness = [1, x, y, z];

// x * y = z
let a = [0, 1, 0, 0];
let b = [0, 0, 1, 0];
let c = [0, 0, 0, 1];

// AIR-style thinking:
// record repeated machine states and constrain transitions.

let trace = [
    State { pc: 0, r0: 2, r1: 3, r2: 0 },
    State { pc: 4, r0: 2, r1: 3, r2: 5 },
];

// Conceptual transition:
// next.r2 = current.r0 + current.r1
// next.pc = current.pc + 4

The code is intentionally small. The real cryptographic machinery comes later: field elements, polynomial evaluation, commitments, transcript challenges, proof generation, and verification.

Why this matters for blockchains

A rollup may execute many transactions away from the base chain and then provide a proof that the resulting state transition is correct.

many transactions → execute → prove → verify → update state

The base chain does not need to replay every computation if it can efficiently verify the proof.

This is one of the major reasons proof systems matter for blockchain scalability.

SNARKs and STARKs in zkVMs

A zkVM tries to prove ordinary machine execution.

The conceptual pipeline is:

program → VM execution → trace → constraints → polynomial proof → verifier

For a trace-based STARK architecture:

execution trace → AIR → composition polynomial → Merkle commitments → FRI

A SNARK-based zkVM may instead transform the machine execution into a circuit or another arithmetization:

execution → circuit / constraints → polynomial commitment → SNARK proof

The same high-level objective can therefore be achieved using substantially different proving architectures.

The real engineering trade-off

SNARK advantage

Very compact proofs can be excellent when proof bandwidth and on-chain verification cost are critical.

SNARK cost

Some constructions require trusted setup and/or elliptic-curve assumptions, and circuit engineering can be complex.

STARK advantage

Transparent setup, hash-based commitments, strong scalability characteristics, and a natural trace model for large computations.

STARK cost

Proofs are typically larger and hash/FRI verification can require more data and computation than tiny pairing-based proofs.

Common misconceptions

“SNARK means trusted setup.”

Not universally. Some SNARK constructions are transparent or use different setup models.

“STARK means no setup at all.”

STARKs are transparent with respect to secret setup parameters, but they still have public protocol parameters and cryptographic assumptions.

“STARKs do not use polynomials.”

Polynomial algebra is central to the common STARK construction, especially AIR and FRI.

“SNARKs are always smaller and faster.”

Proof size and performance depend on the concrete proving system, circuit, hardware, recursion strategy, and verification environment.

“STARK = FRI.”

FRI is an important component of common STARK constructions, but STARK is the broader proof-system family.

“A proof hides everything.”

Zero knowledge hides the witness information specified by the security definition. Public inputs and the statement remain public.

Put everything together

Typical pairing-based SNARK-style mental model

program circuit R1CS / arithmetization polynomials KZG / commitment SNARK

Typical STARK-style mental model

program execution trace AIR polynomials Merkle FRI STARK

These are mental models, not universal blueprints. Modern systems often combine ideas from multiple proof-system families.

Interview-level questions you should be able to answer

Q1
Why are STARKs called transparent?

Because the core construction does not require a secret toxic-waste setup parameter; it can use public parameters and hash-based commitments.

Q2
Why are many SNARK proofs smaller than STARK proofs?

Pairing-based constructions can compress algebraic information into a small number of group elements, while STARKs expose more hash/Merkle/FRI information in the proof.

Q3
Why is AIR natural for zkVMs?

A VM produces a sequential execution trace, and AIR naturally expresses local relationships between consecutive machine states.

Q4
Does every SNARK require a trusted setup?

No. Trusted setup is construction-dependent, not part of the universal definition of SNARK.

Q5
What is FRI doing?

It provides a way to test that an oracle/function is close to a low-degree polynomial through recursive folding and queries.

Q6
Are STARKs automatically post-quantum secure?

No. Their common hash-based assumptions provide a more direct post-quantum path than elliptic-curve discrete-log assumptions, but concrete security still depends on the protocol and parameters.

The whole idea in one map

first-principles map
1. We want to prove a computation without re-running it.
2. The computation becomes a mathematical relation.
3. The relation is represented using constraints.
4. Constraints are transformed into algebraic / polynomial statements.
5. The prover commits to the relevant polynomial information.
6. The verifier uses cryptographic checks to test correctness.
7. SNARKs emphasize succinct proofs; concrete constructions vary.
8. STARKs emphasize scalability and transparency.
9. Pairing-based SNARKs commonly use elliptic curves and polynomial commitments such as KZG.
10. STARKs commonly use hash commitments, Merkle trees, AIR, and FRI.
11. SNARKs can have extremely small proofs.
12. STARKs generally have larger proofs but avoid a secret trusted setup.
13. Both can support zero knowledge, recursion, aggregation, and large-scale computation.
14. The correct comparison is between concrete constructions, not just the labels.

If you remember only one sentence, remember this: SNARKs and STARKs are both ways to prove large computations succinctly, but common SNARK constructions achieve compact proofs through strong algebraic cryptography, while STARKs use transparent, hash-based polynomial proof machinery that is especially natural for large execution traces.