RINGS-TR-2026-04 · Open-Access Technical Report

ZKFly: CUDA-Accelerated Nova for Private Sparse-Graph Execution

Abstract

ZKFly binds a canonical sparse connectome to a Poseidon root and proves a chain of private weighted CSR evaluations with Nova. The public state is two field elements: a vector commitment and a fixed topology root. The implementation uses HyperKZG, GPU multi-scalar multiplication (MSM), and CUDA arithmetic for Nova's R1CS operations. Its main optimization vertically concatenates the three matrices \((A,B,C)\) and replaces three same-vector sparse products by one checked device batch. On a V100, a verified 1,024-step, 14,826-constraint fixture falls from 612.609 \mathrms to 329.535 \mathrms (\(1.859\times\)); fusion alone removes 4,092 synchronizations and 4,092 allocations relative to the resident-buffer version. For the 166,700-neuron, 25,582,938-edge artifact, we report exact execution measurements and circuit lower bounds, not an unmeasured full-network proof time.

1.Relation#

Let a canonical square CSR graph be

\[G=(N,p,j),\quad 0=p_0\leq\cdots\leq p_N=M,\quad 0\leq j_e<N.\]
(1)

Columns inside every row are sorted and unique. For private \(x\in\mathbb{F}^N,w\in\mathbb{F}^M\), one step constrains

\[y_r=\sum_{e=p_r}^{p_{r+1}-1} w_e x_{j_e},\qquad 0\leq r<N.\]
(2)

The data artifact also carries signed synapse counts \(c_e\) and uses

\[w_e=\frac{c_e}{\sum_{k=p_r}^{p_{r+1}-1}|c_k|}, \quad e\in[p_r,p_{r+1}),\]
(3)

for its deterministic floating-point execution oracle. In the proof relation, \(w\) is an arbitrary private field witness: no training or normalization rule is claimed.

1.1Canonical roots#

Seven little-endian u32 values are packed per BN254 field. With \(\mathsf{pack}_7\), the topology stream is

\[\begin{aligned} s_G={}&(L,N,N+1,M)\,\|\,\mathsf{pack}_7(p)\,\|\, \mathsf{pack}_7(j), \\ L={}&4+\left\lceil (N+1)/7\right\rceil+\left\lceil M/7\right\rceil. \end{aligned}\]

For rate \(\rho=11\), \(a_0=0\), zero-padded chunks \(q_i\in\mathbb{F}^{11}\), and domain \(D_T=\texttt{zkfly/poseidon/topology/v1}\),

\[a_{i+1}=\mathsf{Poseidon}_{D_T}(a_i,q_i),\qquad R_G=a_{\left\lceil L/11\right\rceil}.\]
(4)

The width-13, \(x^5\) Circom parameterization is fixed in host, circuit, and CUDA code. Input and output vectors use the same fold shape under a distinct domain \(D_F=\texttt{zkfly/poseidon/forward/v1}\); write the result as \(\mathsf{Com}_F(\cdot)\) [1].

Algorithm 1: Canonical topology commitment #
  1. 1Require \(N\), CSR arrays \(p[0..N]\), \(j[0..M)\)
  2. 2Ensure \(R_G\)
  3. 3assert \crefeq:csr and sorted-unique columns
  4. 4(s\gets(L,N,N+1,M)\|\mathsfpack_7(p)\|\mathsfpack_7(j)\)
  5. 5(a\gets0\)
  6. 6For\(q\gets\mathsf{chunks}_{11}(s)\)
  7. 7(a\gets\mathsfPoseidon_D_T(a,q\|0^11-|q|)\)
  8. 8Return \(a\)

1.2Recursive state#

For step \(t\), Nova carries

\[z_t=(u_t,R_G),\quad u_t=\mathsf{Com}_F(x_t),\quad z_{t+1}=(\mathsf{Com}_F(y_t),R_G).\]
(5)

The witness is \((x_t,w_t)\) and the circuit enforces

\[\mathcal R_G(z_t,z_{t+1};x_t,w_t)= \left\{ \begin{array}{l} u_t=\mathsf{Com}_F(x_t),\\ y_t=W_t x_t\text{ under \cref{eq:forward}},\\ u_{t+1}=\mathsf{Com}_F(y_t),\quad R'_G=R_G. \end{array}\right.\]
(6)

Consecutive witnesses satisfy \(\mathsf{Com}_F(x_{t+1})=\mathsf{Com}_F(y_t)\). Nova folds the resulting relaxed R1CS instances [2]. The primary commitment backend is HyperKZG, derived from the Gemini/KZG polynomial-commitment line [3, 4]; MSM is dispatched to Blitzar.

2.CUDA arithmetic boundary#

For R1CS matrices \(A,B,C\in\mathbb{F}^{m\times d}\) and packed \(z\in\mathbb{F}^d\), Nova repeatedly requests

\[(a,b,c)=(Az,Bz,Cz).\]
(7)

The compatibility interface has a three-product default; the CUDA override constructs

\[\bar M=\begin{bmatrix}A\\B\\C\end{bmatrix}\in\mathbb{F}^{3m\times d}, \qquad \bar Mz=\begin{bmatrix}Az\\Bz\\Cz\end{bmatrix}.\]
(8)
Algorithm 2: Exact-key fused \(A/B/C\) sparse product #
  1. 1Require CSR \(A,B,C\) with \(m\) rows; packed \(z\); field \((b_F,q_F)\)
  2. 2Ensure \(Az,Bz,Cz\)
  3. 3(K_X\gets(X.p,X.j,X.v,b_F,q_F)\) for \(X\in\{A,B,C\}\)
  4. 4(K\gets(K_A,K_B,K_C,m)\)
  5. 5if \(K\notin\mathcal C\) then
  6. 6(\bar p\gets A.p\|\bigl(\operatornamennz(A)+B.p[1:]\bigr)\)
  7. 7(\phantom\bar p\gets\|\bigl(\operatornamennz(A)+\operatornamennz(B)+C.p[1:]\bigr)\)
  8. 8(\bar j\gets A.j\|B.j\|C.j\); \(\bar v\gets A.v\|B.v\|C.v\)
  9. 9(\mathcal C[K]\gets\mathsfUpload(\bar p,\bar j,\bar v,\mathsfalloc(3m))\)
  10. 10(z_D\gets\mathsfUpload(\mathsfMontgomery(z))\)
  11. 11(o_D\gets\mathsfSpMV(\mathcal C[K],z_D)\)// one launch
  12. 12(o\gets\mathsfDownloadAndSync(o_D)\)// one boundary
  13. 13Return \((o[0:m],o[m:2m],o[2m:3m])\)

Cache identity.

No digest key is used:

\[K_M=(p_M,j_M,v_M,b_F,q_F),\qquad K=(K_A,K_B,K_C,m).\]
(9)

The bounded FIFO retains at most 8 fused CSR batches; reusable arithmetic outputs are keyed by exact field-element length.

Equivalence.

For \(0\leq r<m\), the first, second, and third row intervals of \(\bar M\) are exactly rows \(r\) of \(A,B,C\), while all column indices remain unchanged. Therefore \crefeq:vstack holds entrywise. Equality in \crefeq:key implies byte-identical canonical CSR input, field width, and modulus; hence a cache hit selects the same device matrix. A regression test checks offset shifting and ordering; every timed recursive proof is verified against its public root and endpoint commitments.

3.Operation model#

Let \(n\geq1\) be recursive steps and \(k=n-1\). Each non-base Nova fold performs two R1CS evaluations. Thus

\[\begin{aligned} N_{\mathrm{SpMV}}^{\mathrm{logical}}&=6k,& N_{\mathrm{SpMV}}^{\mathrm{batch}}&=2k,\nonumber\\ N_{\mathrm{lin}}&=4k,&N_{\mathrm{cross}}&=2k. \end{aligned}\]

Resident, unfused execution has

\[S_{v2}=B_{v2}=12k,\quad A_{v2}=22k,\]
(10)

while fused execution has

\[S_{v3}=B_{v3}=8k,\quad A_{v3}=18k.\]
(11)

Here \(S,B,A\) are synchronizations, physical arithmetic batches, and device buffer allocations. At \(n=1024\), fusion removes \(4k=4,092\) synchronizations and allocations.

Figure 1: HyperKZG + GPU-MSM proving time; all outputs verified. #

4.Measurements#

Platform.

Tesla V100-SXM3-32GB (SM 7.0), CUDA 12.6.85, driver 580.159.03. Compiler: rustc 1.96.0-nightly; cuda-oxide 0.2.0. Profiling uses a single serialized CUDA context and reusable Nova parameters. Setup is excluded from prove/verify columns.

Table 1: Verified fixed-circuit profile (\(C=14,826\), \(V=14,825\)). #
\(n\)exclusive (s)resident (s)fused (s)\(v3\) verify (s)
10.0670.0640.0640.301
83.7932.3632.2060.126
6436.81422.24120.3880.127
1024612.609373.514329.5350.127
Table 2: Fused \(n=1024\) prover telemetry. #
operationlogical callsphysical batchestime (s)
\(A/B/C\) SpMV6,1382,04677.657
vector linear combination4,0924,09286.097
cross term2,0462,04667.736
MSM2,0472,04736.268
MSM scalars30,347,798
CSR cache6,138 hit / 0 miss
output cache6,138 hit / 0 miss
allocations / synchronizations18,414 / 8,184

4.1Full artifact: execution, then capacity#

The source connectome reports 166,700 neurons [5]. The derived deterministic artifact has

\[\begin{aligned} N&=166{,}700,\qquad M=25{,}582{,}938,\nonumber\\ |\mathsf{CSR}|&=205{,}330{,}308\ \text{bytes}. \end{aligned}\]

and topology root

\[\texttt{413eb9f07080ce45...46caaa9a01b0f323}.\]
(12)
Table 3: Full-graph numeric forward pass; this is not proving time. #
CUDA executorkernel (ms)end-to-end (ms)Gedge/s
resident row/thread13.57513.7221.864
edge products + row reduce4.6304.7705.363

The implemented estimator uses a conservative lower bound \(C_H=2,174\) constraints per width-13 Poseidon permutation. Therefore

\[\begin{aligned} L_T&=4+\left\lceil (N+1)/7\right\rceil+\left\lceil M/7\right\rceil=3{,}678{,}525,\nonumber\\ S_T&=\left\lceil L_T/11\right\rceil=334{,}412,\nonumber\\ C_T&=S_TC_H=727{,}011{,}688, \\ Q&=\left\lceil N/11\right\rceil=15{,}155,\qquad P_F=2Q=30{,}310,\nonumber\\ C_F&=P_FC_H+M+N=91{,}643{,}578, \\ W_F&=M+2N=25{,}916{,}338\ \text{fields}\nonumber\\ &=829{,}322{,}816\ \text{bytes (canonical)}. \end{aligned}\]

One topology registration plus \(T\) forward ticks has

\[\begin{aligned} C_{\mathrm{total}}(T)&\geq C_T+TC_F,\nonumber\\ C_{\mathrm{total}}(1000)&=92{,}370{,}589{,}688. \end{aligned}\]
Table 4: Measured vs. projected proof scope. #
quantitymeasured fixturefull artifact
neurons / edges3 / 4166,700 / 25,582,938
primary constraints14,826\(\geq\)91,643,578
constraint ratio\(1\times\)\(\geq\)6,181.27\(\times\)
Poseidon vector chunks115,155
Powers-of-Tau scale\(2^{15}\) available\(\geq2^{27}\) projected
recursive proofverifiednot run
wall-clock proof timemeasurednot claimed

5.Result boundary#

\begintabularx\columnwidth@lX@ proved: & \(z_0\xRightarrow[\mathcal R_G^n]{\mathrm{Nova}}z_n\);\\ measured: & \(n\leq1024\), \(C=14{,}826\), HyperKZG + GPU-MSM + CUDA;\\ estimated: & \(C_T,C_F,W_F\) for \crefeq:scale;\\ not claimed: & full-artifact or distributed proof, training, weight commitment, or 4.770 \mathrmms proof.\\ \endtabularx Nova's recursive chain is sequential in the current implementation. Graph tiles, Poseidon chunks, and MSMs admit parallel sub-work, but no distributed proof aggregation protocol is implemented or measured. A full forward proof also requires a larger commitment key, a memory study, and an end-to-end run; the small-circuit timing in \creftab:proof-profile is not extrapolated.

Receipt integrity.

The fused standard and smoke receipts have SHA-256 prefixes/suffixes 72859e53...7e6c6716 and 0930b641...c30b26, respectively. The profile schema records logical SpMV calls separately from physical batches; all standard cases and the 12-neuron, two-commitment-chunk regression verified.

References#

  1. [1]
    Lorenzo Grassi and Dmitry Khovratovich and Christian Rechberger and Arnab Roy and Markus Schofnegger, “Poseidon: A New Hash Function for Zero-Knowledge Proof Systems,” 30th USENIX Security Symposium, pp. 519–535, 2021, https://www.usenix.org/conference/usenixsecurity21/presentation/grassi.
  2. [2]
    Abhiram Kothapalli and Srinath Setty and Ioanna Tzialla, “Nova: Recursive Zero-Knowledge Arguments from Folding Schemes,” Cryptology ePrint Archive, Paper 2021/370, 2021, https://eprint.iacr.org/2021/370.
  3. [3]
    Jonathan Bootle and Alessandro Chiesa and Yuncong Hu and Michele Orr\`u, “Gemini: Elastic SNARKs for Diverse Environments,” Cryptology ePrint Archive, Paper 2022/420, 2022, https://eprint.iacr.org/2022/420.
  4. [4]
    Aniket Kate and Gregory M. Zaverucha and Ian Goldberg, “Constant-Size Commitments to Polynomials and Their Applications,” Advances in Cryptology – ASIACRYPT 2010, pp. 177–194, 2010, DOI: 10.1007/978-3-642-17373-8_11.
  5. [5]
    Stuart Berg and Isabella R. Beckett and Marta Costa and Philipp Schlegel and Michal Januszewski and Elizabeth C. Marin and Aljoscha Nern and Stephan Preibisch and Wei Qiu and Shin-ya Takemura and others, “Sexual dimorphism in the complete Drosophila male central nervous system connectome,” Cell, 2026, DOI: 10.1016/j.cell.2026.08.015.