Inferensys

Glossary

Folding Scheme

A cryptographic method that reduces the task of checking two instances of a constraint system into the task of checking a single instance, enabling efficient recursive proving in systems like Nova.
Developer building agentic RAG system, retrieval pipeline diagram on laptop, technical workspace with notes.
RECURSIVE PROOF COMPOSITION

What is a Folding Scheme?

A folding scheme is a cryptographic primitive that reduces the task of verifying two independent instances of a constraint system into the task of verifying a single, combined instance, enabling efficient recursive proving without expensive cryptographic operations at each step.

A folding scheme is a cryptographic method that compresses two instances of a constraint system—each representing a computational step—into a single instance that is equivalent to the conjunction of both. Rather than verifying each step independently, the prover and verifier interactively fold the witnesses and public inputs together using random linear combinations, producing a new instance that is only marginally larger than the original. This operation is purely algebraic, relying on homomorphic properties of the commitment scheme rather than generating a full zero-knowledge proof at each recursion step.

Folding schemes form the core of the Nova proving system, where they enable incrementally verifiable computation (IVC) by deferring expensive cryptographic operations to a final step. At each iteration, the prover folds the current instance with the previous accumulator, maintaining a running witness that grows only logarithmically in size. This approach achieves fast prover times because the folding step avoids costly polynomial commitments and pairing checks, reserving those operations for a single final zkSNARK that attests to the entire computation's correctness.

RECURSIVE PROOF COMPOSITION

Key Characteristics of Folding Schemes

Folding schemes are a novel cryptographic primitive that reduces the task of checking two instances of a constraint system into the task of checking a single instance. This enables highly efficient incrementally verifiable computation (IVC) by deferring expensive cryptographic operations.

01

Instance Reduction via Random Linear Combination

The core mechanism of a folding scheme is to take two independent instances of a constraint system (e.g., two R1CS instances) and compress them into a single, new instance. The prover and verifier interactively compute a random linear combination of the two witnesses and public inputs. The security relies on the fact that if the new, combined instance is satisfiable, then both original instances were satisfiable with high probability. This is fundamentally different from proof recursion, which verifies a proof inside a circuit.

02

Deferred Algebraic Work

Folding schemes achieve efficiency by deferring expensive group operations to the very end of a computation chain. Instead of performing costly elliptic curve multiplications or pairings at every step of a recursive proof, folding only performs lightweight field arithmetic to combine instances. The heavy cryptographic lifting—such as computing a polynomial commitment—is done only once on the final folded instance. This is the key insight that makes provers like Nova an order of magnitude faster than traditional recursive SNARKs.

03

Non-Uniform Incrementally Verifiable Computation (NIVC)

A powerful extension of standard IVC, folding schemes enable Non-Uniform IVC (NIVC). In standard IVC, the same function F is applied repeatedly. With NIVC, a folding scheme can prove the correct execution of a chain of different functions F_1, F_2, ..., F_n. This is crucial for real-world applications like a zkVM, where each step of the virtual machine might execute a different opcode (ADD, MUL, STORE), each represented by a distinct circuit that gets folded into the running accumulator.

04

Relaxed Constraint Systems

To enable efficient random linear combination, folding schemes often operate on a relaxed version of the original constraint system. A standard R1CS requires an exact equality check. A relaxed R1CS introduces a slack term or error vector, allowing the combined instance to absorb the cross-terms that arise from the linear combination of two valid witnesses. The final proof then demonstrates that the slack term is correctly accounted for, ensuring the integrity of the original computation without requiring a perfectly homogeneous algebraic structure.

05

Fiat-Shamir for Non-Interactive Folding

While the core folding interaction is a public-coin protocol, it is transformed into a non-interactive scheme using the Fiat-Shamir heuristic. The prover derives the random challenge for the linear combination by hashing the current accumulator instance and the new incoming instance. This produces a deterministic, verifiable challenge without requiring a live verifier. The resulting non-interactive folding proof is a single, compressed instance that can be verified directly or further folded, forming the backbone of systems like Nova.

06

Comparison to Recursive SNARKs

Traditional recursive SNARKs (e.g., using Groth16 or Plonk wrappers) verify an entire proof inside a circuit, which is extremely expensive due to the non-native arithmetic of cryptographic operations. Folding schemes avoid this by never verifying a proof. Instead, they fold the instances themselves. This results in:

  • Prover time: Dominated by field multiplications, not group exponentiations.
  • Recursion overhead: Near-constant, rather than logarithmic or linear.
  • Circuit size: The step circuit is just the computation itself, not a proof verifier.
FOLDING SCHEME FAQ

Frequently Asked Questions

Clear, technical answers to the most common questions about folding schemes, their relationship to recursive proving, and their role in systems like Nova.

A folding scheme is a cryptographic primitive that reduces the task of checking two instances of a constraint system into the task of checking a single instance. It works by taking two witness-instance pairs, (w1, u1) and (w2, u2), and producing a new pair (w', u') such that if the original pairs are valid, the folded pair is also valid. The key innovation is that this folding operation is performed by the prover using only lightweight, non-cryptographic operations—typically a random linear combination of the inputs. The expensive cryptographic work, such as generating a polynomial commitment or a zkSNARK, is deferred until a final proof is needed. This enables Incrementally Verifiable Computation (IVC) where a prover can process a long chain of state transitions, folding each new step into a running accumulator, and only produce a single constant-size proof at the very end.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.