
$\mathbb{Z}$NARKs - SNARKs for The Integers
Are SNARKs always for computation over finite fields? Turns out no.
Today, we will explore the techniques presented in our recent preprint
Fully-Succinct Arguments over the Integers from First Principles,
which investigates the construction of SNARKs for circuits over the integers.
This work provides a simple, but novel, approach to building efficient proof systems
for computations involving whole numbers which sidesteps most of the usual complications of dealing with integers.
The techniques enable us to "compile" existing (multilinear)
SNARKs into arguments over the integers using a new tool: polynomial commitments with modular remainder.
Applications
Existing SNARKs are (usually) designed for computations over finite fields:
satisfiability of circuits or execution of programs over finite fields.
A few works have also explored SNARKs over other finite rings, usually $\mathbb{Z}_{2^k}$ i.e. $k$-bit integers.
In both cases it means that every value in the computation has a finite a priori bounded size.
In this recent work, we introduce the first (fully succinct) SNARK for computations over the integers:
a SNARK over the integers allows the circuit assignment (or memory in the case of a program) to take any value in $\mathbb{Z}$.
The proof remains sound and succinct no matter how large the values in the computation are.
Computation over the integers has a number of potentially interesting applications,
including emulating (even very small) prime fields.
The usual reader of our blog is well aware of all the circuit "tricks" which apply for finite fields,
but might be less acquainted with computation/circuits over the integers,
let us start by exploring a few examples of applications where SNARKs over the integers might be particularly useful.
Efficient Range Checks using Sum-of-Squares
Range checks over the integers do not require decomposing the value into bits,
meaning the cost of the range check is independent of the size of the range.
The trick is the observation that all non-negative integers can be represented as the sum of four squares,
in other words, for any $n \geq 0$ the prover can (efficiently) find $a, b, c, d$ such that:
$$
n = a^2 + b^2 + c^2 + d^2
$$
Using this technique you can prove that $n \in [0, B]$ by proving you know $a_1, b_1, c_1, d_1$ and $a_2, b_2, c_2, d_2$ such that:
$$
n = a_1^2 + b_1^2 + c_1^2 + d_1^2
$$
$$
B - n = a_2^2 + b_2^2 + c_2^2 + d_2^2
$$
In other words, $n \geq 0$ and $B - n \geq 0$.
This can be optimized, Couteau, Peters and Pointcheval showed $n \in [\mathsf{low}, \mathsf{high}]$
is equivalent to the existence of $a, b, c$ such that:
$$
4 \cdot (n - \mathsf{low}) \cdot (\mathsf{high} - n) + 1 = a^2 + b^2 + c^2
$$
So you get range checks for a constant cost of 4 R1CS constraints, or a single PlonKish gate.
Efficient Mixed Field Emulation
We can emulate prime fields inside integer circuits very easily: the values $\bar{x} \in \mathbb{F}_p$
are represented as integers $x \in \mathbb{Z}$ such that $x \equiv \bar{x} \mod p$. Given two values $x, y \in \mathbb{Z}$,
we can constrain their product to be $z \equiv x \cdot y \mod p$ by requiring that:
$$
z = x \cdot y - q \cdot p
$$
For some $q \in \mathbb{Z}$ chosen by the prover. Similar deal for addition.
Note that we do not require that the prover fully reduces the result,
because there is no "modulus to overflow" the circuit behaves correctly even if the prover uses a large representative
of the equivalence class: he just makes everything slower for himself.
If a unique representative is required, you can simply use the (very efficient) range check from above to check that $z \in [0, p - 1]$.
This even allows emulating "dynamically" chosen fields $\mathbb{F}_p$ e.g. where $p$ is provided as a public input.
It also allows emulating fields of any size with the same number of constraints
and to emulate (and switch between) any number of different fields in the same circuit.
Verifying Computation in RSA Groups
In the example above, we chose the modulus $p$ to be a prime,
but it works equally well for composite moduli $N$, for instance RSA moduli $N = p \cdot q$.
This allows, for instance, verifying RSA signatures and RSA accumulators inside integer circuits efficiently.
An Intellectual Curiosity: $\mathbb{Q}$-Circuits
It is fairly easy to use a proof system for $\mathbb{Z}$ to prove statements about rational numbers $\mathbb{Q}$:
we represent rational numbers as pairs of integers $(n, d)$ representing the fraction $n / d$.
Whenever needed we can force $d \neq 0$ by enforcing $d \cdot \mathsf{sign} \in [1, \infty)$ for some $\mathsf{sign} \in \mathbb{Z}$ chosen by the prover
and using the "sum of squares" technique to enforce the range check.
Note that many non-zero checks can be batched by computing $d_1 \cdot d_2 \cdot \ldots \cdot d_n$ and enforcing that the product is non-zero.
To enforce a product of fractions $n_1 / d_1 \cdot n_2 / d_2 = n_3 / d_3$, we can require:
$$
\begin{aligned}
n_3 &= n_1 \cdot n_2 \\
d_3 &= d_1 \cdot d_2
\end{aligned}
$$
Division can be similarly enforced as:
$$
\begin{aligned}
n_3 &= n_1 \cdot d_2 \\
d_3 &= d_1 \cdot n_2
\end{aligned}
$$
Equality can be checked by enforcing:
$$d_1 \cdot n_2 = d_2 \cdot n_1$$
The hardest part is sums of fractions, which require a common denominator:
$$
\begin{aligned}
n_3 &= n_1 \cdot f_1 + n_2 \cdot f_2 \\
d_3 &= d_1 \cdot f_1 \\
d_1 \cdot f_1 &= d_2 \cdot f_2 \\
f_1 &\neq 0 \\
f_2 &\neq 0
\end{aligned}
$$
For $f_1, f_2$ chosen by the prover.
I am not aware of any practical use of $\mathbb{Q}$-circuits,
but it is kind of interesting that you can have a SNARK for a field of characteristic zero.
zkSecurity offers auditing, research, and development services for cryptographic systems including zero-knowledge proofs, MPCs, FHE, and consensus protocols.
Learn more →
Latest Posts
Sigma dance: commit, challenge, respond
teddav
November 18, 2025
educative
zk
Learn the fundamentals of Σ-protocols through the classic Schnorr protocol, exploring the three-step dance of commit, challenge, and respond. This post walks through knowledge soundness and witness extraction, then shows how to compose Sigma proofs with AND/OR logic and Pedersen commitments. See working SageMath implementations, discover how Fiat-Shamir transforms interactive proofs into non-interactive signatures, and understand the deeper mathematical structure as proofs of knowledge of homomorphism pre-images.
Circle STARKs: Part IV, Arithmetizing Circles
Varun Thakore
November 17, 2025
educative
zk
fri
In this final part of our series on Circle STARKs, we tie together concepts from Mersenne prime fields, circle curves and bivariate polynomials to showcase a comprehensive Circle STARK protocol. We detail the process of arithmetization over the circle curve, introducing Circle FRI as a low-degree test and walk through the complete Circle STARK construction. Readers will explore how trace commitments, constraint batching and low-degree proofs combine for efficient verifiable computation, delving into the nuances of proof validity and security analysis.
Proximity Gaps: What Happened and How Does It Affect our SNARKs
Nicolas Mohnblatt
November 14, 2025
educative
security
zk
A series of recent papers just disproved the proximity gaps conjecture, which has everyone wondering if hash-based SNARKs are in trouble. We break down what actually happened using some helpful visuals—think of it as understanding which parameter choices are safe versus which ones are now confirmed to be risky. The post walks you through the different security zones (proven safe, conjectured safe, and definitely not safe), explains how these new results connect to other open math problems, and shows what it means for real-world SNARKs in terms of proof sizes and performance trade-offs.
Recommended Reading
ZPrize Came To An End! Who And How Did They Win $500,000?
ZK/SEC
May 06, 2024
announcement
zk
In an exciting collaboration with ZPrize, we embarked on a journey to discover the fastest proofs for ECDSA signatures, ultimately crowning two standout approaches as winners. The blog post delves into the innovative solutions that captured the $500,000 prize by pushing the boundaries of zero-knowledge proofs. The story offers a fascinating glimpse into how these cutting-edge techniques might pave the way for privacy-focused applications. Curious to know which teams came out on top and how they did it? Dive in to explore the thrilling results and what's next in the ZK space!
zkSecurity partners with ZPrize to make you win hundreds of thousands of dollars!
ZK/SEC
August 27, 2023
announcement
zk
We're gearing up for this year's ZPrize competition, where we'll be hosting the High Throughput Signature Verification category. This challenge is all about creating the most efficient signature verification circuit using Aleo's Varuna proof system. Participants will work with ECDSA on the Bitcoin and Ethereum curve and the Ethereum hash function, keccak256. It's a great chance to dive into some of the hottest problems in arithmetic circuits and optimize cryptographic algorithms. If you're curious about pushing the boundaries in ZK, join us and share your feedback on our prize specification through our Discord channel.
A Year of ZK Security
David Wong
May 30, 2024
announcement
A year after launching, we've grown and evolved alongside the world of zero-knowledge proofs, uncovering bugs and learning the ins and outs of ZK technology. From circuit audits to developing our own tools like Circomscribe, it’s been a wild ride. We've discovered how easy it is to misstep with ZK code, especially as these systems grow complex and impact financial security. As zkVMs gain popularity, we're excited about the challenges ahead and are expanding our expertise. Want to dive into the world of ZK with us? Check out our latest projects and even take on our zkBank challenge!
More to Explore
Variants of KZG: Part I, Univariate
Varun Thakore
April 28, 2025
educative
zk
In this blog post, we dive into the world of polynomial commitment schemes (PCS), which are crucial for constructing most practical SNARKs. We cover the basics of how PCS works, focusing on KZG10, known for its efficiency in proof size and verification time. You'll learn about the essential properties of binding and hiding and explore technical concepts like homomorphism, batching, and unconditionally hiding. We break down various methods to achieve these features, offering insight into how PCS maintains the security and privacy of polynomials in cryptographic systems. Get ready to understand these powerful concepts and their applications in modern cryptography!
Partnership with StarkWare
ZK/SEC
April 05, 2024
announcement
zk
We're teaming up with StarkWare to enhance Ethereum's scalability using an exciting tool called the EVM adapter. This innovative open-source project takes proofs from the Stone Prover and makes them verifiable on Ethereum, showcasing the power of Cairo bootloader programs for Layer 2 scaling. By diving into our collaboration, you'll get a glimpse of StarkNet's ability to streamline transactions efficiently and how our joint efforts are driving this tech forward. Plus, our Stark Book offers a deeper technical dive for the curious minds!
BitVM: Unlocking Arbitrary Computation on Bitcoin Through Circuit Abstractions
Katat Choi
March 03, 2025
educative
zk
bitcoin
We're diving into the world of Bitcoin's UTXO model and how recent advancements like BitVM can overcome its limitations, allowing for more complex computations without changing Bitcoin's core. This blog post explores cutting-edge techniques like covenants, statefulness, and circuit models, showing how they enable intricate logic on Bitcoin. We'll break down how these innovations make trustless cross-chain transactions possible, and highlight the potential of optimistic protocols to optimize the on-chain footprint. If you're curious about the future of Bitcoin's capabilities, this is the deep dive you need!