From eea8443841ed4a701bf84a9f6415aa9415d6250d Mon Sep 17 00:00:00 2001 From: Freya Date: Wed, 29 Jul 2026 20:41:48 -0400 Subject: [PATCH 01/17] docs(book): add field-to-ring reduction page and rewrite sumcheck stages Adds the field-to-ring evaluation reduction chapter, rewrites the Stage-1 sumcheck-stages page (Stage 1 digit range check, Stage 2 fused relation, Stage 3 setup product), and links the new page from SUMMARY.md. Review fixes: hand terminal-fold anatomy to proving.md, repoint the opening- consistency link to field-ring-reduction.md, and pin all code references to a single snapshot. Co-Authored-By: Claude Opus 4.8 --- book/src/SUMMARY.md | 1 + book/src/how/proving/field-ring-reduction.md | 540 +++++++++++++++ book/src/how/proving/sumcheck-stages.md | 662 ++++++++++++++++++- 3 files changed, 1193 insertions(+), 10 deletions(-) create mode 100644 book/src/how/proving/field-ring-reduction.md diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 29f2a675e..4ebebeab7 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -21,6 +21,7 @@ - [Setup and commitment](./how/commitment.md) - [Transcript and instance binding](./how/transcript.md) - [The proving protocol](./how/proving/proving.md) + - [Field-to-ring evaluation reduction](./how/proving/field-ring-reduction.md) - [Opening points and digit-innermost layout](./how/proving/opening-points-layout.md) - [Root fold and ring switching](./how/proving/root-fold-ring-switch.md) - [Sumcheck stages](./how/proving/sumcheck-stages.md) diff --git a/book/src/how/proving/field-ring-reduction.md b/book/src/how/proving/field-ring-reduction.md new file mode 100644 index 000000000..3541b70a3 --- /dev/null +++ b/book/src/how/proving/field-ring-reduction.md @@ -0,0 +1,540 @@ +# Field-to-ring evaluation reduction + +This page considers one base-field evaluation claim: + +$$ +f:\{0,1\}^n\rightarrow F, +\qquad +r\in F^n, +\qquad +\widetilde f(r)=v. +$$ + +Both the polynomial table and the opening point are defined over the base +field $F$. Akita commits the table through the cyclotomic ring + +$$ +R=F[X]/(X^D+1). +$$ + +The goal is to turn the multilinear evaluation into a multiplication of two +ring elements, define that multiplication as a `TraceOpen` operation, and then +write the same evaluation claim directly as a linear relation on the committed +fold witness. + +Base-field polynomials evaluated at extension-field points are left as a stub +at the end of the page. + +## The evaluation problem + +Choose a ring dimension $D=2^d$ and a power-of-two number of positions per +block. Re-index the polynomial table as + +$$ +f[\ell,p,b], +$$ + +where: + +- $\ell\in[D]$ is an inner index that will become a ring coefficient; +- $p$ is a position inside a block; and +- $b$ is a block index. + +Missing entries in a partial final block are public zeros. + +Split the opening point in the same order: + +$$ +r=(r_{\mathrm{in}},r_{\mathrm{pos}},r_{\mathrm{blk}}). +$$ + +Write the corresponding interpolation weights as + +$$ +I_\ell, +\qquad +Q_p, +\qquad +B_b. +$$ + +For a multilinear opening in the Lagrange basis, these are equality weights: + +$$ +I_\ell=\operatorname{eq}(r_{\mathrm{in}},\ell), +\qquad +Q_p=\operatorname{eq}(r_{\mathrm{pos}},p), +\qquad +B_b=\operatorname{eq}(r_{\mathrm{blk}},b). +$$ + +The evaluation claim is therefore + +$$ +\widetilde f(r) += +\sum_{\ell,p,b}I_\ell Q_pB_bf[\ell,p,b]. +\tag{1} +$$ + +Akita evaluates the three axes in the order + +$$ +\text{position}\longrightarrow\text{block}\longrightarrow\text{inner}. +$$ + +## Reduce to a ring-valued evaluation + +### Pack the inner axis into ring coefficients + +For each position $p$ and block $b$, pack the inner slice into a ring: + +$$ +F_{p,b}(X) += +\sum_{\ell=0}^{D-1}f[\ell,p,b]X^\ell +\in R. +\tag{2} +$$ + +This is only a change of representation. The table entry +$f[\ell,p,b]$ becomes the coefficient of $X^\ell$. + +Equivalently, the values $F_{p,b}$ form a ring-valued multilinear table + +$$ +f_R:\{0,1\}^{n-d}\rightarrow R, +\qquad +f_R[p,b]:=F_{p,b}. +$$ + +This is the same underlying table under a lossless coefficient packing, not a +new witness. The ring polynomial has $d=\log_2D$ fewer variables and is opened +at + +$$ +r_R=(r_{\mathrm{pos}},r_{\mathrm{blk}}), +$$ + +whose base-field coordinates act as constant elements of $R$. + +### Evaluate the ring polynomial + +First evaluate the position coordinate independently inside every block: + +$$ +E_b(X) += +\sum_pQ_pF_{p,b}(X). +\tag{3} +$$ + +The coefficient of $X^\ell$ in $E_b$ is + +$$ +[E_b]_\ell += +\sum_pQ_pf[\ell,p,b]. +$$ + +Next evaluate the block coordinate: + +$$ +Y(X) += +\sum_bB_bE_b(X). +\tag{4} +$$ + +Thus Equation (4) is the ring-based evaluation claim + +$$ +\boxed{ +\widetilde f_R(r_R)=Y. +} +$$ + +Now + +$$ +[Y]_\ell += +\sum_{p,b}Q_pB_bf[\ell,p,b]. +\tag{5} +$$ + +Thus $Y$ contains the polynomial after evaluating the position and block +parts of $r$. Only the inner coordinate remains. + +### Pack the inner opening weights + +Pack the remaining weights into a second ring: + +$$ +P(X) += +\sum_{\ell=0}^{D-1}I_\ell X^\ell. +\tag{6} +$$ + +The two rings have different sources: + +| Ring | Derived from | Meaning | +|---|---|---| +| $Y$ | $f$, $r_{\mathrm{pos}}$, and $r_{\mathrm{blk}}$ | the polynomial after the two outer folds | +| $P$ | $r_{\mathrm{in}}$ | the weights for the remaining inner fold | + +Using Equation (5), the original evaluation can already be written as + +$$ +\widetilde f(r) += +\sum_{\ell=0}^{D-1}I_\ell[Y]_\ell. +\tag{7} +$$ + +## Recover the evaluation with `TraceOpen` + +Let $\sigma_{-1}$ be the ring automorphism + +$$ +\sigma_{-1}(X)=X^{-1}. +$$ + +For any $Z\in R$, define + +$$ +\boxed{ +\operatorname{TraceOpen}_P(Z) +:= +\left[Z(X)\sigma_{-1}(P(X))\right]_0, +} +\tag{8} +$$ + +where $[\cdot]_0$ denotes the constant coefficient in +$F[X]/(X^D+1)$. + +If + +$$ +Z(X)=\sum_\ell[Z]_\ell X^\ell, +$$ + +then the matching terms in $Z\sigma_{-1}(P)$ are + +$$ +[Z]_\ell X^\ell\cdot I_\ell X^{-\ell} += +[Z]_\ell I_\ell. +$$ + +They contribute to the constant coefficient, giving + +$$ +\operatorname{TraceOpen}_P(Z) += +\sum_{\ell=0}^{D-1}[Z]_\ell I_\ell. +\tag{9} +$$ + +Applying this definition to $Y$ and using Equation (7), + +$$ +\operatorname{TraceOpen}_P(Y) += +\sum_\ell[Y]_\ell I_\ell += +\widetilde f(r). +\tag{10} +$$ + +Therefore: + +$$ +\boxed{ +\widetilde f(r)=v +\quad\Longleftrightarrow\quad +\operatorname{TraceOpen}_P(Y)=v. +} +\tag{11} +$$ + +`TraceOpen` is a coefficient pairing. It is not the univariate evaluation +$Y(\alpha)$ used to reduce ring-valued relations to the field. + +## Eliminate the intermediate ring evaluation $Y$ + +### Hachi: expose $Y$ +The baseline Hachi protocol exposes $Y$ and checks two statements: + +$$ +Y=\sum_bB_bE_b, +\tag{12} +$$ + +and + +$$ +\operatorname{TraceOpen}_P(Y)=v. +\tag{13} +$$ + +The first statement proves that $Y$ is the correct evaluation of the +ring-valued polynomial. In this fold, each $E_b(X)$ is digit-decomposed into +the committed partial-evaluation witness: + +$$ +E_b(X) += +\sum_hG_h\hat e_{b,h}(X), +\tag{14} +$$ + +where $\hat e_{b,h}$ are the digit rings and $G_h$ are public gadget weights. +Substituting this decomposition into Equation (12) gives + +$$ +\boxed{ +Y(X) += +\sum_{b,h}B_bG_h\hat e_{b,h}(X). +} +\tag{15} +$$ + +Equation (15) is a relation over the ring that enforces consistency between +the ring element $Y$ and the witness polynomials $\hat e_{b,h}(X)$. Hachi +sends $Y$ to the verifier, which checks Equation (13) directly. The prover +then proves Equation (15) using the same ring-relation machinery as the other +constraints that bind the previous witness to the next witness, as described +in Section 2.5.2. + +### Akita: compose the two checks + +Akita's crucial observation is that $Y$ is already determined linearly by the +committed partial-evaluation witness and that +$\operatorname{TraceOpen}_P$ is itself a linear map. Sending $Y$ would +therefore introduce a redundant ring element, an extra interface between the +two checks, and additional verifier work. Akita instead composes the two +linear maps and applies `TraceOpen` directly to Equation (15): + +$$ +\begin{aligned} +v +&= +\operatorname{TraceOpen}_P(Y)\\ +&= +\sum_{b,h}B_bG_h +\operatorname{TraceOpen}_P(\hat e_{b,h}). +\end{aligned} +\tag{16} +$$ + +Write each digit ring as + +$$ +\hat e_{b,h}(X) += +\sum_{\ell=0}^{D-1}\hat e_{b,h,\ell}X^\ell +$$ + +and define the public inner trace weight + +$$ +J_\ell +:= +\operatorname{TraceOpen}_P(X^\ell). +\tag{17} +$$ + +By linearity, + +$$ +\operatorname{TraceOpen}_P(\hat e_{b,h}) += +\sum_\ell\hat e_{b,h,\ell}J_\ell. +$$ + +Equation (16) becomes the direct evaluation-consistency relation + +$$ +\boxed{ +v += +\sum_{b,h,\ell} +\hat e_{b,h,\ell}B_bG_hJ_\ell. +} +\tag{18} +$$ + +In the base-field setting, Equation (9) gives + +$$ +J_\ell += +\operatorname{TraceOpen}_P(X^\ell) += +I_\ell. +\tag{19} +$$ + +Thus every factor in Equation (18) has a simple role: + +- $G_h$ recomposes the digit planes; +- $B_b$ evaluates across blocks; and +- $J_\ell=I_\ell$ evaluates inside the packed ring. + +This row acts on the committed partial-evaluation digits $\hat e$. The other +fold relations bind those digits back to the original committed polynomial. + +The two possible protocol views are: + +```text +Expose Y: + +committed ê ──recompose──> E_b ──block fold──> Y + │ + TraceOpen + │ + v + +Eliminate Y: + +committed ê ───────composed public linear map──────> v +``` + +## Express the direct relation as a sumcheck claim + +The committed fold witness is stored as one flat table $w$. Flatten the +indices $(b,h,\ell)$ into a Boolean address $x$, and define the public +weight function + +$$ +T(x) += +\begin{cases} +B_bG_hJ_\ell, +&\text{if }x\text{ addresses the coefficient }\hat e_{b,h,\ell},\\ +0, +&\text{if }x\text{ lies outside the }\hat e\text{ segment.} +\end{cases} +\tag{20} +$$ + +Then Equation (18) is + +$$ +\boxed{ +v += +\sum_{x\in\{0,1\}^{\mu}}w(x)T(x). +} +\tag{21} +$$ + +This is the evaluation-correctness relation consumed by the later sumcheck +protocol. It is already a field-valued linear relation on the committed +witness. It therefore needs neither evaluation at $\alpha$ nor a ring-switch +quotient. + + +[Sumcheck stages](./sumcheck-stages.md#add-the-opening-claim-consistency) +explains how this claim is row-batched and fused with the other Stage-2 terms. + +## Code reference + +The base-field path follows the reduction above: + +1. **Prepare the opening weights.** + [`prepare_opening_point`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-types/src/proof/batch.rs#L687-L750) + constructs $Q_p$, $B_b$, and $P$. +2. **Evaluate the ring polynomial.** + [`evaluate_claims_at_prepared_point`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/core/fold_kernels.rs#L61-L89) + returns the position-folded rings $E_b$ and the temporary ring $Y$. +3. **Recover the scalar evaluation.** + [`scalar_opening_from_folded_ring`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/core/fold_kernels.rs#L224-L274) + computes $\operatorname{TraceOpen}_P(Y)$. +4. **Prepare the trace factors.** + [`prepare_evaluation_trace_group_parameters`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-types/src/trace_weight/evaluation_trace.rs#L162-L269) + prepares the block point underlying $B_b$, the gadget weights $G_h$, and + the inner trace weights $J_\ell$. +5. **Construct the trace weights.** + [`build_evaluation_trace_weights`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/sumcheck/relation_range_image/evaluation_trace.rs#L101-L168) + combines those factors with the claim coefficients and physical $\hat e$ + locations to construct $T(x)$. +6. **Fuse the Stage-2 relation.** + [`accumulate_fused_relation_trace`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/sumcheck/relation_range_image/mod.rs#L281-L300) + adds the trace relation to the fused Stage-2 sumcheck. + +The main data flow is: + +```text +opening point r + | + v +PreparedOpeningPoint { Q_p, B_b, P } + | + v +OpeningFoldOutput +|-- folded: [E_b] -- digit decomposition --> e_hat in witness w +`-- eval: Y ------- TraceOpen_P ----------> v_tr + | + v +PreparedFold +|-- evaluation_trace_claim: v_tr +|-- evaluation_trace_points: prepared opening points +|-- evaluation_trace_claim_coefficients: c_q +`-- witness: contains E_b and e_hat + | + v +prepare_evaluation_trace_group_parameters + | + `-- public factors B_b, G_h, J_l + | + v +build_evaluation_trace_weights + | + `-- T(x) on the committed e_hat segment + | + v +accumulate_fused_relation_trace + | + `-- Stage 2 proves v_tr = sum_x w(x) T(x) +``` + +The main values are: + +| Code value | Mathematical object | +|---|---| +| `PreparedOpeningPoint::ring_opening_point.position_weights` | $Q_p$ | +| `PreparedOpeningPoint::ring_opening_point.live_block_weights` | $B_b$ | +| `PreparedOpeningPoint::packed_inner_point` | $P(X)$ | +| `OpeningFoldOutput::folded` | $E_0,E_1,\ldots$ | +| `OpeningFoldOutput::eval` | temporary $Y(X)$ | +| `PreparedEvaluationTraceClaim::claimed_evaluation` | $v_{\mathrm{tr}}=\operatorname{TraceOpen}_P(Y)$ | +| `PreparedEvaluationTraceClaim::claim_coefficients` | claim-batching coefficients $c_q$ | +| `RingRelationGroupWitness::e_folded` | position-folded rings $E_b$ | +| `RingRelationGroupWitness::e_hat` | digit rings $\hat e_{b,h}(X)$ | +| `PreparedFold::evaluation_trace_claim` | $v_{\mathrm{tr}}$ carried into Stage 2 | +| `PreparedFold::evaluation_trace_points` | prepared $P$, $Q$, and $B$ for each group | +| `PreparedFold::evaluation_trace_claim_coefficients` | $c_q$ carried into trace-weight construction | +| `EvaluationTraceGroupParameters::block_opening_point` | block point from which $B_b$ is evaluated | +| `EvaluationTraceGroupParameters::opening_digit_weights` | $G_h$ | +| `EvaluationTraceGroupParameters::inner_trace` | $J_\ell$, equal to $I_\ell$ in the base-field case | +| `EvaluationTraceWeights` | $T(x)$ | + +The temporary ring $Y$ is used only to compute $v_{\mathrm{tr}}$; it is not +stored in `PreparedFold` or sent to the verifier. Stage 2 instead proves + +$$ +v_{\mathrm{tr}} += +\sum_x w(x)T(x) +$$ + +directly from the committed digit witness. + +## Base-field polynomial at an extension-field point + +> **Status:** stub. diff --git a/book/src/how/proving/sumcheck-stages.md b/book/src/how/proving/sumcheck-stages.md index 3ba7d7be3..b398cc0e6 100644 --- a/book/src/how/proving/sumcheck-stages.md +++ b/book/src/how/proving/sumcheck-stages.md @@ -1,15 +1,657 @@ # Sumcheck stages -> **Status:** stub. Part of the initial Akita Book scaffold. +Every non-terminal Akita fold runs a short sumcheck cascade over the fold +witness: -The fused sumcheck that proves one fold: stage 1 (the digit range check on the -balanced witness), stage 2 (the fused relation sumcheck), and the optional -stage 3 (the setup product sumcheck used by verifier offloading). How they batch -and schedule together. +1. **Stage 1 — digit range check.** Proves that every witness entry is a valid + balanced digit and outputs one evaluation of the virtual range-image table. +2. **Stage 2 — fused relation sumcheck.** Proves the ring-switched fold + relation and binds both Stage 1's virtual range-image value and the opening + claim carried into the fold to the committed witness; the resulting witness + evaluation becomes the next opening claim. +3. **Stage 3 — setup product sumcheck.** Optionally carries a recursive setup + contribution together with the next opening. -**Sources to fold in** +This chapter explains the Stage-1 range protocol and the Stage-2 fused +relation protocol in detail. Stage 3 is summarized at the end. The terminal +fold, which runs none of these sumchecks, is covered in +[The proving protocol](./proving.md). -- `crates/akita-prover/src/protocol/sumcheck/digit_range/`, `akita_stage2/`, and `two_round_prefix/`. -- `crates/akita-verifier/src/stages/`. -- Paper §3.5 (`fig:akita-sumcheck`), §3.5.1 `sec:akita-range-check` (optimized digit range check), §4.3 `sec:claim-reduction` (setup product sumcheck). -- `specs/packed-sumcheck.md`, `specs/setup-product-sumcheck.md`. +## Stage 1: digit range check + +### What it certifies + +Let + +$$ +w:\{0,1\}^{n}\rightarrow\mathbb{F} +$$ + +be the balanced-digit table of the newly committed witness. The level chooses +one basis + +$$ +b\in\{4,8,16,32,64\}, +$$ + +and every Boolean entry must lie in + +$$ +\mathcal{A}_b += +\left\{-\frac b2,\ldots,\frac b2-1\right\}. +$$ + +This range bound keeps the recursive witness norm under control. + +### The simplest sound design + +The direct vanishing polynomial for the balanced alphabet is + +$$ +D_b(W) += +\prod_{a\in\mathcal{A}_b}(W-a). +$$ + +A Boolean entry is valid exactly when $D_b(w(x))=0$. Checking only the +unweighted sum of these values would not be sound, because nonzero violations +could cancel. Instead, the protocol anchors the table at a random equality +point $\tau$ and proves + +$$ +0 += +\sum_{x\in\{0,1\}^{n}} +\operatorname{eq}(\tau,x)\,D_b(w(x)). +$$ + +The right-hand side is a random evaluation of the multilinear extension of +the Boolean violation table. An equality-factored sumcheck proves this identity +one variable at a time; see +[Equality-factored sum-check](../../foundations/eq-factored-sumcheck.md). + +This design is simple, but $D_b$ has degree $b$. Akita represents the same +condition with a degree-$b/2$ polynomial before deciding whether a product +tree is needed. + +### Reduce the degree with the range image + +Pair the positive digit $k$ with the negative digit $-(k+1)$: + +$$ +(W-k)(W+k+1) += +W(W+1)-k(k+1). +$$ + +Define the pointwise **range image** + +$$ +S(x) += +\operatorname{range\_image}(w(x)) += +w(x)\bigl(w(x)+1\bigr) +$$ + +and roots + +$$ +c_k=k(k+1), +\qquad +0\le k<\frac b2. +$$ + +The direct polynomial factors as + +$$ +D_b(W) += +\prod_{k=0}^{b/2-1}\left(W(W+1)-c_k\right) += +R_b\bigl(W(W+1)\bigr), +$$ + +where + +$$ +R_b(T) += +\prod_{k=0}^{b/2-1}(T-c_k). +$$ + +Thus $w(x)\in\mathcal{A}_b$ exactly when $R_b(S(x))=0$. Stage 1 starts from +the anchored zero claim + +$$ +0 += +\sum_{x\in\{0,1\}^{n}} +\operatorname{eq}(\tau_0,x)\,R_b(S(x)). +$$ + +The table $S$ is virtual: it is not committed and is not appended to the +recursive witness. Stage 1 proves the range identity for $S$; Stage 2 later +proves that its final evaluation comes from $w(x)(w(x)+1)$ on the committed +witness. + +## The complete Stage-1 protocol + +### Quartic leaves and product substages + +For basis $4$ or $8$, $R_b$ has degree at most four and one +equality-factored sumcheck proves the anchored identity directly. + +For larger bases, the protocol partitions the roots into consecutive groups of +at most four: + +$$ +L_\ell(T) += +\prod_{k=4\ell}^{\min(4\ell+3,\,b/2-1)} +(T-c_k). +$$ + +Their product is $R_b$. Each $L_\ell$ is quartic except at basis $4$, where +the only leaf is quadratic. Product substages prove how these leaves combine, +using only arity-$2$ or arity-$4$ products. The topology is fixed by +[`DigitRangePlan`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-types/src/proof/stage1.rs#L179-L400): + +| Basis | Product substages | Final leaf | +|---:|---|---| +| 4 | none | one quadratic leaf | +| 8 | none | one quartic leaf | +| 16 | arity 2, emitting 2 child claims | batch of 2 quartic leaves | +| 32 | arity 4, emitting 4 child claims | batch of 4 quartic leaves | +| 64 | arity 2, emitting 2 claims; then arity 4, emitting 8 claims | batch of 8 quartic leaves | + +### One product substage + +Suppose the current substage has parent tables $P_i$, and each parent is the +pointwise product of $a$ child tables: + +$$ +P_i(x) += +\prod_{j=0}^{a-1}C_{i,j}(x), +\qquad a\in\{2,4\}. +$$ + +Let $\xi$ be the current equality point and $\lambda_i$ the current parent +weights. The carried claim is + +$$ +v += +\sum_i\lambda_i\,\widetilde{P_i}(\xi). +\tag{1} +$$ + +The product substage proves + +$$ +v += +\sum_{x\in\{0,1\}^{n}} +\operatorname{eq}(\xi,x) +\sum_i\lambda_i +\prod_{j=0}^{a-1}C_{i,j}(x). +$$ + +At the sumcheck's sampled point $r$, the prover supplies the child evaluations + +$$ +u_{i,j} += +\widetilde{C_{i,j}}(r) +$$ + +in canonical order. The verifier closes the substage against + +$$ +\operatorname{eq}(\xi,r) +\sum_i\lambda_i +\prod_{j=0}^{a-1}u_{i,j}. +$$ + +The protocol then: + +1. absorbs the child evaluations in canonical order; +2. samples a fresh interstage challenge $\gamma$; +3. assigns weights $1,\gamma,\gamma^2,\ldots$ in that same order; +4. batches the child evaluations into the next carried claim; and +5. uses $r$ as the equality point for the next substage. + +Let the canonical order of the $m$ child nodes be +$C_0,C_1,\ldots,C_{m-1}$, and write their evaluations at $r$ as +$u_h=\widetilde{C_h}(r)$. The child node in position $h$ receives weight +$\gamma^h$, so both parties derive the next claim from the absorbed child +claims and the transcript challenge: + +$$ +v_{\mathsf{next}} += +\sum_{h=0}^{m-1}\gamma^h u_h += +u_0+\gamma u_1+\gamma^2u_2+\cdots. +$$ + +For the next substage, these canonically ordered child nodes become the new +parent nodes. Set its equality point to $r$ and its parent weights to +$\lambda_h=\gamma^h$. The carried claim is therefore + +$$ +v_{\mathsf{next}} += +\sum_{h=0}^{m-1}\lambda_h\,\widetilde{C_h}(r). +\tag{2} +$$ + +Equation (2) has the same form as Equation (1), the carried claim proved by +each product substage. In other words, +the handoff substitutes $P_i\leftarrow C_h$, $\xi\leftarrow r$, and +$\lambda_i\leftarrow\gamma^h$ in the product-substage claim above. + +At the root there is one parent with weight $1$ and claim $0$. Each product +substage expands the current parents into their children; the fresh powers of +$\gamma$ compress those child claims back into one claim for the next +substage. The prover and verifier follow the same transcript order +([`digit_range/mod.rs:230`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/sumcheck/digit_range/mod.rs#L230-L299), +[`stage1.rs:167`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-verifier/src/stages/stage1.rs#L161-L252)). + +### The final leaf + +After all product substages, let $\xi$ be the current equality point, $v$ the +current batched claim, and $\lambda_\ell$ the current leaf weights. Define + +$$ +B(T) += +\sum_\ell\lambda_\ell L_\ell(T). +$$ + +The final equality-factored sumcheck proves + +$$ +v += +\sum_{x\in\{0,1\}^{n}} +\operatorname{eq}(\xi,x)\,B(S(x)). +$$ + +For bases $8$, $16$, $32$, and $64$, $B$ is quartic. For basis $4$, it is +quadratic. When there is no product substage, $v=0$, $\xi=\tau_0$, and +$B=R_b$. + +At the final sampled point $r_{\mathsf{range}}$, the proof carries + +$$ +\mathsf{range\_image\_evaluation} += +\widetilde S(r_{\mathsf{range}}) += +\sum_{x\in\{0,1\}^{n}} +\operatorname{eq}(r_{\mathsf{range}},x)\, +w(x)\bigl(w(x)+1\bigr). +$$ + +The verifier closes the leaf against + +$$ +\operatorname{eq}(\xi,r_{\mathsf{range}}) +B\bigl(\mathsf{range\_image\_evaluation}\bigr). +$$ + +The distinction between the Boolean table and its MLE matters: + +$$ +\widetilde S(r) +\neq +\widetilde w(r)\bigl(\widetilde w(r)+1\bigr) +$$ + +in general. The equality $S(x)=w(x)(w(x)+1)$ holds at Boolean vertices, but +multilinear extension does not commute with the quadratic map away from those +vertices. The proof therefore carries the independent +`range_image_evaluation` field +([`levels.rs:20`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-types/src/proof/levels.rs#L20-L25)). + +### Domain and challenge order + +Stage 1 views the digits as one flat Boolean table. The live witness occupies a +prefix; every remaining address is public zero padding. Zero is a valid +balanced digit, so padded entries also satisfy the range polynomial. + +Ring switching supplies $\tau_0$ in column-then-ring order, while the flat +table binds variables in increasing physical-address-bit order. The protocol +reorders the point so that ring-slot coordinates come first, followed by +column coordinates +([`stage1.rs:19`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-types/src/proof/stage1.rs#L19-L170)). + +### The verifier + +The verifier replays the same product substages, derives the same interstage +challenges and weights, checks each child-product claim, and closes the final +leaf at `range_image_evaluation` +([`stage1.rs:167`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-verifier/src/stages/stage1.rs#L161-L252)). + +Passing Stage 1 proves that the range-tree claims are internally consistent and +reduces the final leaf to `range_image_evaluation`. It does **not** by itself +tie that virtual value to the committed witness. + + +## Stage 2: fused relation sumcheck + +Stage 2 proves three statements about the same committed digit witness $w$: + +1. $w$ satisfies the ring-switched fold relation; +2. Stage 1's virtual range-image value is correctly derived from $w(w+1)$; and +3. the opening claim for this fold is consistent with $w$. + +The protocol fuses all three statements into one sumcheck. We first isolate +the fold-relation term to make its matrix-row dimension explicit, then +incorporate the range-image and opening-consistency terms. + +### Start with the ring relation + +Let $w_j(X)$ be the $j$-th ring element encoded by the digit witness, and let +row $i$ of the extended fold relation be + +$$ +\sum_j M_{i,j}(X)w_j(X)=h_i(X). +\tag{3} +$$ + +The extended relation includes the quotient witness, so Equation (3) is an +equality rather than a congruence modulo a ring polynomial. The public right +side $h_i$ is zero for some rows and contains the public data +for the remaining rows. + +Ring switching samples one field element $\alpha$ and evaluates every ring +polynomial at that point: + +$$ +\sum_j M_{i,j}(\alpha)w_j(\alpha)=h_i(\alpha). +\tag{4} +$$ + +The scalar $\alpha$ removes the ring-coefficient dimension from the algebraic +relation. It is not a Boolean sumcheck point. + +### Batch the matrix rows + +Suppose the relation has rows indexed by $i$. The protocol samples a Boolean +MLE point $\tau_1$ of sufficient width for that row domain and defines + +$$ +\beta_i=\operatorname{eq}(\tau_1,i). +$$ + +It takes the random linear combination of Equation (4) over all rows. Define + +$$ +m_j += +\sum_i\beta_iM_{i,j}(\alpha) +\qquad\text{and}\qquad +h_{\tau} += +\sum_i\beta_i h_i(\alpha). +$$ + +The batched relation is the single scalar claim + +$$ +\sum_j m_jw_j(\alpha)=h_{\tau}. +\tag{5} +$$ + +This is where the matrix-row dimension goes. It is contracted by $\tau_1$ +before Stage 2 starts its witness-address sumcheck. Consequently, the Stage-2 +sumcheck point has no matrix-row coordinate. + + +Stage 2 proves the relation for this batched row. Soundness comes from the fact +that $\tau_1$ was sampled after the witness was committed: a false collection +of rows cannot generally arrange for its random multilinear combination to +vanish. + +### Expand the ring elements into one flat witness + +For the moment, suppose every witness ring element has $D$ coefficients: + +$$ +w_j(X)=\sum_{k=0}^{D-1}w_{j,k}X^k. +$$ + +Evaluating at $\alpha$ gives + +$$ +w_j(\alpha)=\sum_{k=0}^{D-1}w_{j,k}\alpha^k. +$$ + +Substituting this into Equation (5) yields + +$$ +h_{\tau} += +\sum_{j,k}w_{j,k}\,\alpha^k m_j. +\tag{6} +$$ + +Now view $(j,k)$ as one flat Boolean address $x$. The low bits select the +coefficient $k$ and the remaining bits select the witness lane $j$. Define + +$$ +A(k)=\alpha^k, +\qquad +L(j)=m_j. +$$ + +The relation weight factors as + +$$ +R(k,j)=A(k)L(j), +$$ + +so Equation (6) becomes + +$$ +h_{\tau} += +\sum_{x\in\{0,1\}^n}w(x)R(x). +\tag{7} +$$ + +The Boolean domain is padded with zeros when the live witness length is not a +power of two. + +The production protocol also permits different ring dimensions in different +parts of the relation. It chooses the largest power-of-two coefficient block +common to every role and to the outgoing witness. The low address still +selects a coefficient inside that common block. Any remaining high power of +$\alpha$, together with the matrix entry and its $\beta_i$ row weight, is +absorbed into the lane weight $L$. Thus the exact factorization $R=A\cdot L$ +continues to hold without adding another sumcheck dimension. + +### Add the range-image binding + +Let $r_1$ be the final point produced by Stage 1, and let $s_1$ be the +`range_image_evaluation` carried by its proof. Stage 1 established a claim +about a virtual table. Stage 2 must connect that table to the committed +witness by proving + +$$ +s_1 += +\sum_x +\operatorname{eq}(r_1,x)w(x)\bigl(w(x)+1\bigr). +\tag{8} +$$ + +This is a sum over Boolean addresses. It does not claim that +$s_1=\widetilde w(r_1)(\widetilde w(r_1)+1)$, which is generally false. + +After absorbing $s_1$, the transcript samples a fresh scalar $\gamma$. The +protocol uses $\gamma$ to batch Equation (8) with the relation claim. + +### Add the opening claim consistency + +Stage 2 also verifies the incoming opening claim $v_{\mathrm{tr}}$ against the +committed witness $w$. [Field-to-ring evaluation +reduction](./field-ring-reduction.md) derives the public trace weight $T(x)$ +and establishes the evaluation-consistency relation + +$$ +v_{\mathrm{tr}}=\sum_x w(x)T(x). +\tag{9} +$$ + +Here we focus only on how this relation is fused into Stage 2. Equation (9) +has the same linear form in $w$ as a row of the ring-switched relation, so the +protocol treats it as a **virtual row** placed immediately after the physical +relation rows. If $i_{\mathrm{tr}}$ is that row's index in the padded row +domain, the shared row challenge $\tau_1$ assigns it the weight + +$$ +\beta_{\mathrm{tr}} += +\operatorname{eq}(\tau_1,i_{\mathrm{tr}}). +$$ + +The virtual row is not inserted into the physical matrix or its +relation-weight factorization. Only its batching weight +$\beta_{\mathrm{tr}}$ comes from the row domain. Stage 2 directly fuses + +$$ +\beta_{\mathrm{tr}}v_{\mathrm{tr}} += +\sum_x\beta_{\mathrm{tr}}w(x)T(x) +$$ + +into the sumcheck over the flat witness address $x$. In this way, the opening +claim reuses the same row randomness $\tau_1$ as the ring-switched relation +without becoming a physical matrix row. + +### The fused Stage-2 claim + +Combining Equations (7), (8), and (9), the input claim is + +$$ +C_0 += +\gamma s_1+h_{\tau}+\beta_{\mathrm{tr}}v_{\mathrm{tr}}. +$$ + +Stage 2 proves + +$$ +\begin{aligned} +C_0 +=\sum_x \bigl[{} +&\gamma\operatorname{eq}(r_1,x) + w(x)\bigl(w(x)+1\bigr)\\ +&+w(x)A(k(x))L(j(x))\\ +&+\beta_{\mathrm{tr}}w(x)T(x) +\bigr]. +\end{aligned} +\tag{10} +$$ + +All three terms use the same flat witness address $x$. This is why they can be +proved by one sumcheck. + +### Sumcheck rounds and the final point + +Let $P(X)$ denote the multilinear-polynomial expression inside the brackets in +Equation (10). In round $t$, after challenges +$r_{2,0},\ldots,r_{2,t-1}$ have been sampled, the prover sends + +$$ +g_t(Z) += +\sum_{x_{t+1},\ldots,x_{n-1}\in\{0,1\}} +P(r_{2,0},\ldots,r_{2,t-1},Z,x_{t+1},\ldots,x_{n-1}). +$$ + +The verifier checks + +$$ +g_t(0)+g_t(1)=C_t, +$$ + +samples the next coordinate $r_{2,t}$, and sets + +$$ +C_{t+1}=g_t(r_{2,t}). +$$ + +After all $n$ rounds, these coordinates form the flat witness point + +$$ +r_2=(r_{2,0},\ldots,r_{2,n-1}). +$$ + +Split it according to the flat address as + +$$ +r_2=(r_{\mathrm{coeff}},r_{\mathrm{lane}}). +$$ + +The verifier closes the sumcheck against + +$$ +\begin{aligned} +C_n={} +&\gamma\operatorname{eq}(r_1,r_2) + \widetilde w(r_2)\bigl(\widetilde w(r_2)+1\bigr)\\ +&+\widetilde w(r_2) + \widetilde A(r_{\mathrm{coeff}}) + \widetilde L(r_{\mathrm{lane}})\\ +&+\beta_{\mathrm{tr}}\widetilde w(r_2)\widetilde T(r_2). +\end{aligned} +\tag{11} +$$ + +The value $\widetilde w(r_2)$ becomes the next-witness opening claim. The +range term has degree three in each sumcheck variable: one degree from the +equality polynomial and two from $w(w+1)$. The relation and trace terms each +have degree two. Therefore Stage 2 sends degree-three round polynomials. + +The random objects have separate jobs: + +| Object | Shape | What it removes or binds | +|---|---|---| +| $\alpha$ | one field element | evaluates the ring-polynomial variable $X$ | +| $\tau_1$ | a point over matrix rows | batches all relation rows into one virtual row | +| $\gamma$ | one field element | batches range-image consistency with the linear claims | +| $r_1$ | Stage-1 output point over flat witness addresses | identifies the carried range-image evaluation | +| $r_2$ | Stage-2 output point over flat witness addresses | reduces the complete fused claim to one witness evaluation | + +In particular, $\alpha$, $\tau_1$, and $r_2$ are not coordinates of one larger +point. They contract three different domains. + +### Implementation map + +The implementation builds the row weights with +`eq_tau1.eval_at(row)`, factors the resulting flat relation table into the +common alpha and lane factors, and evaluates that factorization at $r_2$ +([`relation_weights.rs:442`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/ring_switch/relation_weights.rs#L442-L520), +[`relation_weights.rs:234`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/ring_switch/relation_weights.rs#L234-L310), +[`ring_switch.rs:627`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-verifier/src/protocol/ring_switch.rs#L627-L657)). +Those relation weights stop at the physical fold-consistency, $A$, $B$, and +$D$ rows. The trace index is the next reserved padded-domain index, but no +matrix row is created for it. The prover builds its weight function separately +and adds it directly to the relation weight during the shared witness scan +([`relation_range_image/mod.rs:281`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/sumcheck/relation_range_image/mod.rs#L281-L300)). +The fused identity is implemented by +[`relation_range_image/mod.rs`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/sumcheck/relation_range_image/mod.rs#L1-L77). + +## Stage 3: recursive setup contribution + +When the level uses recursive setup contribution, Stage 3 batches the public +setup-product claim with Stage 2's next-witness opening. One sumcheck proves +both claims and returns their evaluations at the resulting projected points. +Under direct setup contribution, Stage 3 is absent +([`fold.rs:1079`](https://github.com/LayerZero-Labs/akita/blob/b104dae6c672f406b676b04c47e00f4249669ba5/crates/akita-prover/src/protocol/core/fold.rs#L671-L731)). From 975be12556273de08882bd68f5809ee756af651e Mon Sep 17 00:00:00 2001 From: Freya Date: Thu, 30 Jul 2026 17:10:33 -0400 Subject: [PATCH 02/17] akita-book: ring relation --- book/src/SUMMARY.md | 1 + book/src/how/proving/akita-fold.md | 523 +++++++++++++++++++ book/src/how/proving/field-ring-reduction.md | 2 +- book/src/how/proving/sumcheck-stages.md | 4 + 4 files changed, 529 insertions(+), 1 deletion(-) create mode 100644 book/src/how/proving/akita-fold.md diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 4ebebeab7..96e7b761c 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -22,6 +22,7 @@ - [Transcript and instance binding](./how/transcript.md) - [The proving protocol](./how/proving/proving.md) - [Field-to-ring evaluation reduction](./how/proving/field-ring-reduction.md) + - [Ring relation in an Akita fold](./how/proving/akita-fold.md) - [Opening points and digit-innermost layout](./how/proving/opening-points-layout.md) - [Root fold and ring switching](./how/proving/root-fold-ring-switch.md) - [Sumcheck stages](./how/proving/sumcheck-stages.md) diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md new file mode 100644 index 000000000..1d22cf7a6 --- /dev/null +++ b/book/src/how/proving/akita-fold.md @@ -0,0 +1,523 @@ +# Ring relation in an Akita fold + +This page describes the ring-valued relations proved by one non-terminal +Akita fold. The presentation starts with one polynomial group, one opening +claim, and one common ring dimension: + +$$ +R=F[X]/(X^D+1). +$$ + +The current implementation also supports multiple polynomial groups, +multiple claims, chunked witnesses, and different ring dimensions for +different relation rows. Those extensions change the layout, but not the four +core relations developed below. + +The Akita paper presents a more general matrix with additional compression +relations. Its basic Greyhound relation motivates the four row families here; +the current implementation is the source of truth for the rows and witness +layout documented on this page. + +The goal of the fold is to replace the current polynomial blocks by a smaller +digit witness while proving that the new witness is consistent with: + +1. the opening data computed from the old polynomial; +2. the inner and outer commitments; and +3. the random fold of the old polynomial blocks. + +These statements form the **physical ring relation**. The scalar evaluation +claim from [Field-to-ring evaluation +reduction](./field-ring-reduction.md) is a separate field-valued relation. It +is fused with the physical rows later, but it is not a row of the ring matrix +described on this page. + +## Objects entering the fold + +### Polynomial blocks and inner digits + +As in the previous page, split the ring-valued polynomial table into blocks. +Let $b$ index a live block and $p$ a position inside the block. Write the ring +at that location as + +$$ +F_{p,b}(X)\in R. +$$ + +Digit-decompose each ring with public inner gadget weights +$G_a^{\mathrm{in}}$: + +$$ +F_{p,b}(X) += +\sum_a G_a^{\mathrm{in}}s_{b,p,a}(X). +\tag{1} +$$ + +For one block, collect all digit rings $s_{b,p,a}$ into a vector +$\mathbf{s}_b$. The inner commitment matrix $\mathbf A$ maps that vector to + +$$ +\mathbf t_b += +\mathbf A\mathbf s_b. +\tag{2} +$$ + +Each coordinate of $\mathbf t_b$ is decomposed again, now with the outer +gadget weights $G_h^{\mathrm{out}}$: + +$$ +t_{b,\rho}(X) += +\sum_hG_h^{\mathrm{out}}\hat t_{b,\rho,h}(X), +\tag{3} +$$ + +where $\rho$ selects a row of $\mathbf A$. Stack the $\hat t$ digits from all +blocks. The public outer commitment is + +$$ +\mathbf u += +\mathbf B\hat{\mathbf t}. +\tag{4} +$$ + +The matrices $\mathbf A$ and $\mathbf B$ therefore serve different purposes: +$\mathbf A$ creates an inner image for each block, while $\mathbf B$ commits +the digit-decomposed inner images across all blocks. + +### Partial evaluations and opening digits + +Let $Q_p$ be the position weight derived from the opening point. For the +base-field setting of the previous page, $Q_p\in F$ acts as a constant in +$R$. Evaluate the position coordinate inside each block: + +$$ +E_b(X) += +\sum_pQ_pF_{p,b}(X). +\tag{5} +$$ + +Digit-decompose each $E_b$ with the opening gadget weights +$G_h^{\mathrm{open}}$: + +$$ +E_b(X) += +\sum_hG_h^{\mathrm{open}}\hat e_{b,h}(X). +\tag{6} +$$ + +The fold witness contains the digit rings $\hat e$, not a second copy of the +recomposed $E_b$. To bind those digits, Akita computes an opening commitment + +$$ +\mathbf v_D += +\mathbf D\hat{\mathbf e}. +\tag{7} +$$ + +The subscript in $\mathbf v_D$ distinguishes this ring vector from the scalar +opening target $v_{\mathrm{tr}}$. Equation (7) is a commitment relation; it +does not prove that the multilinear evaluation equals +$v_{\mathrm{tr}}$. + +### The folded response + +After the relevant data is fixed, the transcript samples one sparse +ring-valued fold challenge $c_b(X)$ for each live block. The prover folds the +original block digits: + +$$ +z_{p,a}(X) += +\sum_b c_b(X)s_{b,p,a}(X). +\tag{8} +$$ + +The coefficients of $z$ are larger than the original digits, so $z$ is +digit-decomposed once more: + +$$ +z_{p,a}(X) += +\sum_fG_f^{\mathrm{fold}}\hat z_{p,a,f}(X). +\tag{9} +$$ + +The three main digit segments produced so far are therefore + +$$ +\hat{\mathbf z} +\;\Vert\; +\hat{\mathbf e} +\;\Vert\; +\hat{\mathbf t}. +\tag{10} +$$ + +They have different origins: + +| Segment | What it digit-decomposes | Why it is needed | +|---|---|---| +| $\hat{\mathbf z}$ | the challenge-folded block digits $\mathbf z$ | becomes the smaller folded response | +| $\hat{\mathbf e}$ | the position-folded rings $E_b$ | carries the opening data into the fold | +| $\hat{\mathbf t}$ | the inner images $\mathbf t_b$ | binds the folded response to the existing commitment | + +## The four physical relation families + +The verifier must check that the three segments in Equation (10) describe the +same original polynomial and commitment. Akita expresses the checks as four +families of linear equations over $R$. + +### 1. Fold-evaluation consistency + +Fold the recomposed partial evaluations using the same challenges as in +Equation (8): + +$$ +\sum_{b,h} +c_bG_h^{\mathrm{open}}\hat e_{b,h}. +\tag{11} +$$ + +Alternatively, first fold the original digit blocks into $\hat z$, recompose +them with Equation (9), and then apply the position weights: + +$$ +\sum_{p,a,f} +Q_pG_a^{\mathrm{in}}G_f^{\mathrm{fold}}\hat z_{p,a,f}. +\tag{12} +$$ + +Both expressions equal $\sum_bc_bE_b$. The first physical row therefore +checks + +$$ +\boxed{ +\sum_{b,h} +c_bG_h^{\mathrm{open}}\hat e_{b,h} += +\sum_{p,a,f} +Q_pG_a^{\mathrm{in}}G_f^{\mathrm{fold}}\hat z_{p,a,f}. +} +\tag{13} +$$ + +This is called the `consistency` row in the code. It binds the partial +evaluation digits $\hat e$ to the folded response $\hat z$. It does **not** +contain the scalar opening target $v_{\mathrm{tr}}$. + +Notice that this row uses the random fold challenges $c_b$, not the block +opening weights $B_b$ from the previous page. The $B_b$ weights belong to the +separate evaluation-correctness relation on $\hat e$. + +### 2. Inner-commitment consistency + +For every row $\rho$ of $\mathbf A$, fold the corresponding recomposed inner +images: + +$$ +\sum_{b,h} +c_bG_h^{\mathrm{out}}\hat t_{b,\rho,h}. +\tag{14} +$$ + +By linearity of $\mathbf A$, this must equal row $\rho$ of $\mathbf A$ applied +to the folded response: + +$$ +\sum_{p,a,f} +A_{\rho,(p,a)}G_f^{\mathrm{fold}}\hat z_{p,a,f}. +\tag{15} +$$ + +Thus every $\mathbf A$ row checks + +$$ +\boxed{ +\sum_{b,h} +c_bG_h^{\mathrm{out}}\hat t_{b,\rho,h} += +\sum_{p,a,f} +A_{\rho,(p,a)}G_f^{\mathrm{fold}}\hat z_{p,a,f}. +} +\tag{16} +$$ + +There is no factor $G_a^{\mathrm{in}}$ on the right of Equation (16): +$\mathbf A$ already acts on the inner digit vector $\mathbf s_b$, whose +columns are indexed by $(p,a)$. + +### 3. Outer-commitment consistency + +The $\hat t$ segment must still open the public commitment that entered this +fold: + +$$ +\boxed{ +\mathbf B\hat{\mathbf t} += +\mathbf u. +} +\tag{17} +$$ + +Unlike Equations (13) and (16), this relation does not use the fold +challenges. It checks the existing outer commitment directly. + +### 4. Opening-commitment consistency + +The $\hat e$ segment is bound by the opening commitment from Equation (7): + +$$ +\boxed{ +\mathbf D\hat{\mathbf e} += +\mathbf v_D. +} +\tag{18} +$$ + +This relation also does not use the fold challenges. It prevents the prover +from changing the partial-evaluation digits after $\mathbf v_D$ has been +absorbed. + +## Assemble the ring relation + +Define the pre-switch witness + +$$ +\mathbf w_0 += +\hat{\mathbf z} +\;\Vert\; +\hat{\mathbf e} +\;\Vert\; +\hat{\mathbf t}. +\tag{19} +$$ + +The four relation families can be written as one matrix equation + +$$ +\boxed{ +\mathbf M_0\mathbf w_0=\mathbf y +\quad\text{over }R. +} +\tag{20} +$$ + +For one group, the physical row order and right-hand side are: + +| Physical rows | Meaning | Right-hand side | +|---|---|---| +| `consistency` | Equation (13) | $0$ | +| $\mathbf A$ rows | Equation (16) | $\mathbf 0$ | +| $\mathbf B$ rows | Equation (17) | $\mathbf u$ | +| $\mathbf D$ rows | Equation (18) | $\mathbf v_D$ | + +Consequently, + +$$ +\mathbf y += +\mathbf 0 +\;\Vert\; +\mathbf 0_{\mathbf A} +\;\Vert\; +\mathbf u +\;\Vert\; +\mathbf v_D. +\tag{21} +$$ + +The matrix is usually not materialized as one dense object. Its entries come +from the fold challenges, opening weights, gadget weights, and the setup +matrices $\mathbf A$, $\mathbf B$, and $\mathbf D$. The code generates these +contributions directly from the canonical witness layout. + +## Lift the ring relation before sumcheck + +Equation (20) is an equality modulo $X^D+1$. Sumcheck, however, needs a field +identity. Choose the canonical representatives of degree less than $D$ for +all ring elements. There is then one quotient polynomial for every physical +row: + +$$ +\widetilde{\mathbf M}_0(X)\widetilde{\mathbf w}_0(X) +- +\widetilde{\mathbf y}(X) += +(X^D+1)\mathbf r(X). +\tag{22} +$$ + +Digit-decompose the quotient vector: + +$$ +\mathbf r(X) += +\mathbf G_r\hat{\mathbf r}(X), +\tag{23} +$$ + +and append its digits to the committed witness: + +$$ +\boxed{ +\mathbf w += +\hat{\mathbf z} +\;\Vert\; +\hat{\mathbf e} +\;\Vert\; +\hat{\mathbf t} +\;\Vert\; +\hat{\mathbf r}. +} +\tag{24} +$$ + +Move the denominator term to the left and define + +$$ +\mathbf M_{\mathrm{ext}}(X) += +\left[ +\widetilde{\mathbf M}_0(X) +\;\middle|\; +-(X^D+1)\mathbf G_r +\right]. +\tag{25} +$$ + +The extended relation is the exact polynomial identity + +$$ +\boxed{ +\mathbf M_{\mathrm{ext}}(X)\widetilde{\mathbf w}(X) += +\widetilde{\mathbf y}(X). +} +\tag{26} +$$ + +This distinction is important: Equation (22) uses the quotient +$\mathbf r$, while Equation (26) already includes the quotient digits +$\hat{\mathbf r}$ inside $\mathbf w$. The denominator term must not be added +to the right-hand side a second time. + +Ring switching now samples $\alpha$ and evaluates Equation (26): + +$$ +\mathbf M_{\mathrm{ext}}(\alpha)\mathbf w(\alpha) += +\mathbf y(\alpha). +\tag{27} +$$ + +Equation (27) is the field relation consumed by Stage 2. The +[Sumcheck stages](./sumcheck-stages.md#stage-2-fused-relation-sumcheck) page +explains how $\tau_1$ batches its physical rows and how the resulting relation +is proved over the flat witness address. + +## The scalar opening claim is a virtual row + +Two different statements involve $\hat e$, and they should not be conflated: + +| Statement | Form | Physical ring row? | Ring-switch quotient? | +|---|---|---:|---:| +| opening commitment | $\mathbf D\hat{\mathbf e}=\mathbf v_D$ | yes | yes | +| evaluation correctness | $\sum_xw(x)T(x)=v_{\mathrm{tr}}$ | no | no | + +The second statement is derived in [Field-to-ring evaluation +reduction](./field-ring-reduction.md#express-the-direct-relation-as-a-sumcheck-claim). +It is already a linear equation over the field coefficients of the committed +witness. Akita therefore treats it as an `EvaluationTrace` virtual row after +the physical rows. It reuses the same row-batching challenge $\tau_1$, but it +is absent from $\mathbf M_0$, $\mathbf y$, and the quotient vector +$\mathbf r$. + +[Sumcheck stages](./sumcheck-stages.md#stage-2-fused-relation-sumcheck) +continues from Equation (27) and fuses the physical relation, the virtual +evaluation row, and the range-image binding into one Stage-2 sumcheck. + +## Code reference + +The current prover follows the construction above: + +1. **Build the partial-evaluation and fold witnesses.** + [`RingRelationProver::new`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_relation.rs#L433-L760) + decomposes $E_b$ into $\hat e$, computes + $\mathbf v_D=\mathbf D\hat{\mathbf e}$, samples the fold challenges, and + builds $\mathbf z$. +2. **Assemble the public relation statement.** + [`assemble_relation_rhs`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-types/src/proof/relation.rs#L286-L353) + lays out $\mathbf y$ as + `consistency | A | B | D`, while + [`RingRelationInstance`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-types/src/proof/ring_relation.rs#L82-L220) + carries the public challenges, points, and right-hand side. +3. **Prepare the digit segments.** + [`ring_switch_build_w`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_switch/coeffs.rs#L253-L455) + extracts $\hat t$ from the commitment hint and prepares + $\hat z\Vert\hat e\Vert\hat t$ in the canonical witness layout. +4. **Compute the row quotients.** + [`compute_multi_group_relation_quotient`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_relation/relation_quotient.rs#L412-L690) + computes one quotient for each `consistency`, $\mathbf A$, $\mathbf B$, and + $\mathbf D$ row. `ring_switch_build_w` decomposes them and appends + $\hat r$. +5. **Evaluate the extended relation.** + [`build_relation_weight_events`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_switch/relation_weights.rs#L398-L870) + emits the contributions of all four row families and the quotient columns + after evaluation at $\alpha$ and batching by $\tau_1$. + +The main data flow is: + +```text +old polynomial blocks and commitment hints + | + v +RingRelationProver::new +|-- position-folded rings E_b --> e_hat +|-- inner-image hints ----------> t_hat +|-- fold challenges ------------> z +|-- D * e_hat ------------------> v_D +`-- [0 | 0_A | u | v_D] -------> relation rhs y + | + v +ring_switch_build_w +|-- compute_multi_group_relation_quotient --> r +|-- decompose z ----------------------------> z_hat +|-- decompose r ----------------------------> r_hat +`-- emit [z_hat | e_hat | t_hat | r_hat] ---> committed witness w + | + v +build_relation_weight_events +`-- M_ext(alpha), row-batched by tau_1 ------> Stage 2 +``` + +The main code values are: + +| Code value | Mathematical object | +|---|---| +| `RingRelationGroupWitness::z_folded_rings` | folded response $\mathbf z$ before its final digit decomposition | +| `RingRelationGroupWitness::e_folded` | position-folded rings $E_b$ | +| `RingRelationGroupWitness::e_hat` | opening digits $\hat{\mathbf e}$ | +| `RingRelationGroupWitness::hint` | commitment hint containing $\hat{\mathbf t}$ | +| `RingRelationInstance::group_challenges()` | fold challenges $c_b$ | +| `RingRelationInstance::rhs()` | physical right-hand side $\mathbf y$ | +| `RingRelationInstance::v()` | opening-commitment rows $\mathbf v_D$ | +| `RelationQuotientOutput` | row quotient vector $\mathbf r$ | +| `RecursiveWitnessFlat` | flat committed witness $\hat z\Vert\hat e\Vert\hat t\Vert\hat r$ | + +With multiple groups, the implementation repeats +`consistency | A | B` for each group and places the shared `D` rows at the +end. With a chunked witness, it emits one +$\hat z_i\Vert\hat e_i\Vert\hat t_i$ ownership unit per chunk followed by one +shared $\hat r$ tail. The canonical physical layout is described in +[Opening points and digit-innermost +layout](./opening-points-layout.md#witness-order). diff --git a/book/src/how/proving/field-ring-reduction.md b/book/src/how/proving/field-ring-reduction.md index 3541b70a3..7f4dfc244 100644 --- a/book/src/how/proving/field-ring-reduction.md +++ b/book/src/how/proving/field-ring-reduction.md @@ -308,7 +308,7 @@ the ring element $Y$ and the witness polynomials $\hat e_{b,h}(X)$. Hachi sends $Y$ to the verifier, which checks Equation (13) directly. The prover then proves Equation (15) using the same ring-relation machinery as the other constraints that bind the previous witness to the next witness, as described -in Section 2.5.2. +in [Ring relation in an Akita fold](./akita-fold.md). ### Akita: compose the two checks diff --git a/book/src/how/proving/sumcheck-stages.md b/book/src/how/proving/sumcheck-stages.md index b398cc0e6..72a567176 100644 --- a/book/src/how/proving/sumcheck-stages.md +++ b/book/src/how/proving/sumcheck-stages.md @@ -355,6 +355,10 @@ incorporate the range-image and opening-consistency terms. ### Start with the ring relation +The four physical row families and the quotient extension are derived in +[Ring relation in an Akita fold](./akita-fold.md). Here we start from their +extended relation and explain how Stage 2 proves it. + Let $w_j(X)$ be the $j$-th ring element encoded by the digit witness, and let row $i$ of the extended fold relation be From efaa55778af6c69cd512c889411acea63bbb41ce Mon Sep 17 00:00:00 2001 From: Freya Date: Thu, 30 Jul 2026 23:26:59 -0400 Subject: [PATCH 03/17] docs(book): expand ring relation layouts --- book/src/how/proving/akita-fold.md | 155 +++++++++++++++++++++++++---- 1 file changed, 138 insertions(+), 17 deletions(-) diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md index 1d22cf7a6..6b5ba5ec8 100644 --- a/book/src/how/proving/akita-fold.md +++ b/book/src/how/proving/akita-fold.md @@ -340,6 +340,86 @@ from the fold challenges, opening weights, gadget weights, and the setup matrices $\mathbf A$, $\mathbf B$, and $\mathbf D$. The code generates these contributions directly from the canonical witness layout. +## Relation layouts beyond the basic setting + +The relation above uses one polynomial group and one witness chunk. The code +also supports multiple groups and multiple chunks. These cases change how the +physical rows or witness columns are arranged, while preserving the basic +relations above. + +### Multiple polynomial groups + +At a multi-group root, each group $g$ has its own opening claims, fold +challenges, ring dimensions, commitment parameters, and +`consistency | A | B` row block. The final/new group is placed first, followed +by the precommitted groups. The shared $\mathbf D$ rows remain at the end: + +$$ +\begin{aligned} +{}& +[\mathrm{consistency}_{\mathrm{final}} + \mid \mathbf A_{\mathrm{final}} + \mid \mathbf B_{\mathrm{final}}] +\\[-2pt] +&\quad\Vert +\big\Vert_{g\in\mathrm{precommitted}} +[\mathrm{consistency}_g\mid\mathbf A_g\mid\mathbf B_g] +\quad\Vert\quad +\mathbf D. +\end{aligned} +$$ + +Each group-local block has right-hand side +$0\Vert\mathbf 0_{\mathbf A_g}\Vert\mathbf u_g$. The final shared block has +right-hand side $\mathbf v_D$. + +For a single chunk per group, the corresponding pre-switch witness layout is + +$$ +\mathbf w_0 += +\big\Vert_{g\in\mathrm{relation\ order}} +[\hat{\mathbf z}_g\mid\hat{\mathbf e}_g\mid\hat{\mathbf t}_g]. +$$ + +The quotient digits for all physical rows are stored once, in one shared +$\hat{\mathbf r}$ tail after these group segments. + +### Multiple witness chunks + +The chunked or distributed layout further partitions each group's live blocks +into disjoint ranges $I_{g,k}$. Chunk $k$ computes the partial folded response + +$$ +\mathbf z_{g,k} += +\sum_{b\in I_{g,k}}c_{g,b}\mathbf s_{g,b}, +\qquad +\mathbf z_g=\sum_k\mathbf z_{g,k}. +$$ + +The canonical layout is group-major and then chunk-minor: + +$$ +\boxed{ +\mathbf w += +\big\Vert_g\big\Vert_k +[\hat{\mathbf z}_{g,k} + \mid\hat{\mathbf e}_{g,k} + \mid\hat{\mathbf t}_{g,k}] +\quad\Vert\quad +\hat{\mathbf r}. +} +$$ + +Every chunk has a full-shaped local $\hat z$ segment, while its $\hat e$ and +$\hat t$ segments contain only the live blocks owned by that chunk. Chunking +adds witness columns, not relation rows: the chunk matrices are stacked +horizontally and contribute to the same group-level `consistency | A | B` +rows. The $\mathbf D$ rows and the quotient tail $\hat{\mathbf r}$ are shared +across all groups and chunks. + ## Lift the ring relation before sumcheck Equation (20) is an equality modulo $X^D+1$. Sumcheck, however, needs a field @@ -500,24 +580,65 @@ build_relation_weight_events `-- M_ext(alpha), row-batched by tau_1 ------> Stage 2 ``` -The main code values are: +### Public statement: `RingRelationInstance` + +[`RingRelationInstance`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-types/src/proof/ring_relation.rs#L82-L220) +contains the public relation statement. It contains only values that the +verifier can reconstruct: + +| Field | Mathematical meaning | +|---|---| +| `group_challenges()` | fold challenges $c_b$ | +| `group_opening_point()` | ordinary opening weights, including $Q_p$ and $B_b$ | +| `group_ring_multiplier_point()` | ring multipliers used by the physical consistency row | +| `rhs()` | $\mathbf y=[0\mid\mathbf 0_A\mid\mathbf u\mid\mathbf v_D]$ in the basic setting | +| `v()` | $\mathbf v_D=\mathbf D\hat{\mathbf e}$ | +| `role_dims()` | the $\mathbf A$-, $\mathbf B$-, and $\mathbf D$-row ring dimensions | + +### Prover witness: `RingRelationWitness` + +[`RingRelationWitness`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_relation_witness.rs#L141-L220) +is the prover-only aggregate witness. It holds the fold-grinding nonce and one +[`RingRelationGroupWitness`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_relation_witness.rs#L8-L140) +per polynomial group. In the basic setting, the vector contains one group: -| Code value | Mathematical object | +| Field | Mathematical meaning | |---|---| -| `RingRelationGroupWitness::z_folded_rings` | folded response $\mathbf z$ before its final digit decomposition | -| `RingRelationGroupWitness::e_folded` | position-folded rings $E_b$ | -| `RingRelationGroupWitness::e_hat` | opening digits $\hat{\mathbf e}$ | -| `RingRelationGroupWitness::hint` | commitment hint containing $\hat{\mathbf t}$ | -| `RingRelationInstance::group_challenges()` | fold challenges $c_b$ | -| `RingRelationInstance::rhs()` | physical right-hand side $\mathbf y$ | -| `RingRelationInstance::v()` | opening-commitment rows $\mathbf v_D$ | -| `RelationQuotientOutput` | row quotient vector $\mathbf r$ | -| `RecursiveWitnessFlat` | flat committed witness $\hat z\Vert\hat e\Vert\hat t\Vert\hat r$ | - -With multiple groups, the implementation repeats -`consistency | A | B` for each group and places the shared `D` rows at the -end. With a chunked witness, it emits one -$\hat z_i\Vert\hat e_i\Vert\hat t_i$ ownership unit per chunk followed by one -shared $\hat r$ tail. The canonical physical layout is described in +| `z_folded_rings` | folded response $\mathbf z$, before decomposition into $\hat z$ | +| `z_folded_centered_per_chunk` | chunk-local folded responses $\mathbf z_k$ | +| `e_folded` | recomposed position-folded rings $E_b$ | +| `e_hat` | opening digits $\hat{\mathbf e}$ | +| `hint` | commitment hint containing $\hat{\mathbf t}$ | + +The quotient output $\mathbf r$ is computed after these structures are built. +Its digits are appended when `ring_switch_build_w` emits the flat +$\hat z\Vert\hat e\Vert\hat t\Vert\hat r$ witness. + +### Verifier reconstruction + +The verifier does not receive a serialized `RingRelationInstance`. In +[`verify_fold`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-verifier/src/protocol/core/fold.rs#L646-L741), +it reconstructs the public instance from the transcript and public proof data: + +```text +public commitment rows, opening points, v_D, and transcript + | + v +rederive the per-group fold challenges + | + v +assemble_relation_rhs + | + v +RingRelationInstance::new + | + v +ring_switch_verifier --------------------------------------> Stage 2 verifier +``` + +Only the public instance is reconstructed on the verifier. The +`RingRelationWitness` and its group witnesses remain prover-only. + +The canonical multi-group and multi-chunk physical layout is described in [Opening points and digit-innermost layout](./opening-points-layout.md#witness-order). From 3c3100841ea3ae69a34e84835f3e1ef6cb1367d0 Mon Sep 17 00:00:00 2001 From: Freya Date: Mon, 3 Aug 2026 12:01:03 -0400 Subject: [PATCH 04/17] docs(book): update akit-fold.md --- book/src/how/proving/akita-fold.md | 114 ++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 4 deletions(-) diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md index 6b5ba5ec8..436552343 100644 --- a/book/src/how/proving/akita-fold.md +++ b/book/src/how/proving/akita-fold.md @@ -33,6 +33,42 @@ described on this page. ## Objects entering the fold +### Why the witness is digit-decomposed + +The witness committed for the next level must have bounded coefficients. This +shortness condition is essential for the Module-SIS binding argument: two +different bounded openings of the same linear commitment would give a short, +nonzero vector in the kernel of its commitment matrix. + +Gadget decomposition provides the bounded representation. For a power-of-two +base $g$ and digit depth $\delta$, define + +$$ +\mathbf G_{g,n} += +\mathbf I_n\otimes(1,g,\ldots,g^{\delta-1}). +$$ + +A balanced decomposition of $\mathbf x$ is a digit vector $\hat{\mathbf x}$ +such that + +$$ +\mathbf x=\mathbf G_{g,n}\hat{\mathbf x}, +\qquad +\hat x_i\in +\{-g/2,\ldots,g/2-1\}. +$$ + +The decomposition specifies this small-digit representation; the protocol's +range check proves that the committed coordinates really lie in the required +range. Akita may use different bases and depths for the inner, outer, opening, +fold-response, and quotient decompositions. Below, $G_a^{\mathrm{in}}$, +$G_h^{\mathrm{out}}$, $G_h^{\mathrm{open}}$, and $G_f^{\mathrm{fold}}$ denote +the scalar gadget weights used to decompose $F_{p,b}$, $\mathbf t_b$, $E_b$, +and $\mathbf z$, respectively. They are entries of the corresponding gadget +rows defined above. We omit the role-specific base and depth from this notation +for simplicity. + ### Polynomial blocks and inner digits As in the previous page, split the ring-valued polynomial table into blocks. @@ -125,7 +161,7 @@ opening target $v_{\mathrm{tr}}$. Equation (7) is a commitment relation; it does not prove that the multilinear evaluation equals $v_{\mathrm{tr}}$. -### The folded response +### The folded response and its digitization After the relevant data is fixed, the transcript samples one sparse ring-valued fold challenge $c_b(X)$ for each live block. The prover folds the @@ -138,8 +174,78 @@ z_{p,a}(X) \tag{8} $$ -The coefficients of $z$ are larger than the original digits, so $z$ is -digit-decomposed once more: +The response $\mathbf z$ no longer carries a live-block index. This is the +fold's main reduction toward a smaller next-level witness, but combining the +blocks increases coefficient magnitudes. Let $\sigma_\infty$ bound the +coefficient norm of every digit block $\mathbf s_b$, and let +$\omega=\max_b\lVert c_b\rVert_1$. Negacyclic multiplication gives + +$$ +\begin{aligned} +\lVert\mathbf z\rVert_{\infty,\mathrm{coef}} +&\le +\sum_b +\lVert c_b\mathbf s_b\rVert_{\infty,\mathrm{coef}}\\ +&\le +|\mathcal B|\,\omega\,\sigma_\infty, +\end{aligned} +$$ + +where $\mathcal B$ is the set of live blocks. The schedule fixes the challenge +family, its relevant norm bounds, an admissible fold-response bound +$\beta_{\mathrm{fold}}$, and a digit depth large enough to represent the +accepted response. The implementation may resample the transcript nonce until +the resulting $\mathbf z$ fits that scheduled bound. This grinding helps the +honest prover find a compact response; the range check on its committed digits +is what certifies the bound in the protocol. + +Before digitizing $\mathbf z$, the two challenge-dependent relations already +follow directly from linearity. For the partial evaluations, + +$$ +\begin{aligned} +\sum_b c_bE_b +&= +\sum_b c_b\sum_pQ_pF_{p,b}\\ +&= +\sum_{p,a}Q_pG_a^{\mathrm{in}} +\left(\sum_bc_bs_{b,p,a}\right)\\ +&= +\sum_{p,a}Q_pG_a^{\mathrm{in}}z_{p,a}. +\end{aligned} +$$ + +Using the opening digits from Equation (6), this is + +$$ +\sum_{b,h}c_bG_h^{\mathrm{open}}\hat e_{b,h} += +\sum_{p,a}Q_pG_a^{\mathrm{in}}z_{p,a}. +$$ + +Similarly, $\mathbf t_b=\mathbf A\mathbf s_b$ implies + +$$ +\sum_bc_b\mathbf t_b += +\mathbf A\left(\sum_bc_b\mathbf s_b\right) += +\mathbf A\mathbf z. +$$ + +For row $\rho$ of $\mathbf A$, and using the outer digits from Equation (3), +this becomes + +$$ +\sum_{b,h}c_bG_h^{\mathrm{out}}\hat t_{b,\rho,h} += +\sum_{p,a}A_{\rho,(p,a)}z_{p,a}. +$$ + +These identities explain the relations in terms of the raw folded response. +The next-level committed witness, however, must again consist of bounded +digits so that its shortness is certified for the Module-SIS binding argument. +Akita therefore decomposes $\mathbf z$ once more: $$ z_{p,a}(X) @@ -325,7 +431,7 @@ Consequently, $$ \mathbf y = -\mathbf 0 +0 \;\Vert\; \mathbf 0_{\mathbf A} \;\Vert\; From b6f7fed4a83c48625721e011573a1c6739042647 Mon Sep 17 00:00:00 2001 From: Freya Date: Mon, 3 Aug 2026 12:03:42 -0400 Subject: [PATCH 05/17] docs(book): add toc --- book/src/how/proving/akita-fold.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md index 436552343..48980cae6 100644 --- a/book/src/how/proving/akita-fold.md +++ b/book/src/how/proving/akita-fold.md @@ -31,6 +31,26 @@ reduction](./field-ring-reduction.md) is a separate field-valued relation. It is fused with the physical rows later, but it is not a row of the ring matrix described on this page. +## Contents + +- [Objects entering the fold](#objects-entering-the-fold) + - [Why the witness is digit-decomposed](#why-the-witness-is-digit-decomposed) + - [Polynomial blocks and inner digits](#polynomial-blocks-and-inner-digits) + - [Partial evaluations and opening digits](#partial-evaluations-and-opening-digits) + - [The folded response and its digitization](#the-folded-response-and-its-digitization) +- [The four physical relation families](#the-four-physical-relation-families) + - [Fold-evaluation consistency](#1-fold-evaluation-consistency) + - [Inner-commitment consistency](#2-inner-commitment-consistency) + - [Outer-commitment consistency](#3-outer-commitment-consistency) + - [Opening-commitment consistency](#4-opening-commitment-consistency) +- [Assemble the ring relation](#assemble-the-ring-relation) +- [Relation layouts beyond the basic setting](#relation-layouts-beyond-the-basic-setting) + - [Multiple polynomial groups](#multiple-polynomial-groups) + - [Multiple witness chunks](#multiple-witness-chunks) +- [Lift the ring relation before sumcheck](#lift-the-ring-relation-before-sumcheck) +- [The scalar opening claim is a virtual row](#the-scalar-opening-claim-is-a-virtual-row) +- [Code reference](#code-reference) + ## Objects entering the fold ### Why the witness is digit-decomposed From 3f9f85dc84d9317501a505e1fe1e389f99310165 Mon Sep 17 00:00:00 2001 From: Freya Date: Mon, 3 Aug 2026 17:56:26 -0400 Subject: [PATCH 06/17] akita-book: multi group relation --- book/src/how/proving/akita-fold.md | 92 +++++++++++++++++++++++++++--- 1 file changed, 85 insertions(+), 7 deletions(-) diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md index 48980cae6..09c6116bc 100644 --- a/book/src/how/proving/akita-fold.md +++ b/book/src/how/proving/akita-fold.md @@ -475,10 +475,60 @@ relations above. ### Multiple polynomial groups -At a multi-group root, each group $g$ has its own opening claims, fold -challenges, ring dimensions, commitment parameters, and -`consistency | A | B` row block. The final/new group is placed first, followed -by the precommitted groups. The shared $\mathbf D$ rows remain at the end: +In zkVM applications, polynomials such as execution traces, advice, and +preprocessed data may be committed at different times. When one commitment is +formed, the prover may not yet know which other commitments it will later be +opened with, the opening point, or the root schedule that will combine them. +Akita calls the polynomials held under one independently formed outer +commitment a **commitment group**. All claims in one group share an opening +point. In the current implementation, all groups are opened at one shared root +point. One group is the **final/new group**, while commitments formed earlier +enter as **precommitted groups** with already-fixed parameters. + +Proving each commitment group separately would repeat the entire recursive +opening protocol. Akita instead batches the groups in one root transition and +then resumes the ordinary single-opening recursion. The batching does not +merge the group witnesses or commitments: each group keeps its own folded +response $\mathbf z_g$, digit witnesses $\hat{\mathbf e}_g$ and +$\hat{\mathbf t}_g$, and group-local `consistency | A | B` relations. Within +the physical ring matrix, only the opening-commitment relation spans the +groups: one $\mathbf D$ matrix acts on their concatenated opening digits. The +field-level evaluation trace separately batches their claimed evaluations. + +To show only what changes from the basic setting, assume one polynomial claim +per group and add a group index $g$ to the previous notation. Group $g$ has +its own blocks $\mathbf s_{g,b}$, fold challenges $c_{g,b}$, and folded response + +$$ +\boxed{ +\mathbf z_g += +\sum_b c_{g,b}\mathbf s_{g,b}. +} +$$ + +There is no sum over $g$. Each group keeps a separate response +$\mathbf z_g$, opening digits $\hat{\mathbf e}_g$, and inner-commitment digits +$\hat{\mathbf t}_g$. The basic consistency, $\mathbf A$, and $\mathbf B$ +relations are repeated independently for every group. In particular, the +$\mathbf B_g$ rows bind $\hat{\mathbf t}_g$ to that group's public commitment +$\mathbf u_g$. + +Among the four physical relation families, only the $\mathbf D$ relation +combines witness data from different groups. It acts once on the concatenated +opening digits: + +$$ +\hat{\mathbf e}_{\mathrm{all}} += +\big\Vert_{g\in\mathrm{relation\ order}}\hat{\mathbf e}_g, +\qquad +\mathbf D\hat{\mathbf e}_{\mathrm{all}}=\mathbf v_D. +$$ + +In the canonical physical row order, the final/new group is placed first, +followed by the precommitted groups. The shared $\mathbf D$ rows remain at the +end: $$ \begin{aligned} @@ -495,9 +545,22 @@ $$ \end{aligned} $$ -Each group-local block has right-hand side -$0\Vert\mathbf 0_{\mathbf A_g}\Vert\mathbf u_g$. The final shared block has -right-hand side $\mathbf v_D$. +Consequently, the full right-hand side is + +$$ +\mathbf y += +\big\Vert_{g\in\mathrm{relation\ order}} +[0\mid\mathbf 0_{\mathbf A_g}\mid\mathbf u_g] +\quad\Vert\quad +\mathbf v_D. +$$ + +This relation is block sparse: a group's consistency, $\mathbf A_g$, and +$\mathbf B_g$ rows touch only that group's witness segment, whereas the +shared $\mathbf D$ rows touch the $\hat{\mathbf e}_g$ segments from every +group. Stage 2 batches all physical rows into one sumcheck, but this batching +does not merge the group-local relations. For a single chunk per group, the corresponding pre-switch witness layout is @@ -511,6 +574,21 @@ $$ The quotient digits for all physical rows are stored once, in one shared $\hat{\mathbf r}$ tail after these group segments. +The root fold consumes this multi-group structure. After ring switching, the +group segments and the shared quotient tail form one witness + +$$ +\mathbf w^{\mathrm{next}} += +\mathbf w_0\Vert\hat{\mathbf r}, +$$ + +which is committed once for the next level. The output of the multi-group root +is therefore the basic recursive object: one polynomial group, one committed +witness, and one opening claim at one point. The original root groups remain +only as ranges inside the flat witness; they no longer define separate folded +responses or relation rows. + ### Multiple witness chunks The chunked or distributed layout further partitions each group's live blocks From 5cf0db95c4df5a5547322f8420a7d83298607e10 Mon Sep 17 00:00:00 2001 From: Freya Date: Mon, 3 Aug 2026 18:07:16 -0400 Subject: [PATCH 07/17] akita-book: multi group relation --- book/src/how/proving/akita-fold.md | 61 +++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md index 09c6116bc..f3fce3341 100644 --- a/book/src/how/proving/akita-fold.md +++ b/book/src/how/proving/akita-fold.md @@ -487,13 +487,13 @@ enter as **precommitted groups** with already-fixed parameters. Proving each commitment group separately would repeat the entire recursive opening protocol. Akita instead batches the groups in one root transition and -then resumes the ordinary single-opening recursion. The batching does not -merge the group witnesses or commitments: each group keeps its own folded -response $\mathbf z_g$, digit witnesses $\hat{\mathbf e}_g$ and -$\hat{\mathbf t}_g$, and group-local `consistency | A | B` relations. Within -the physical ring matrix, only the opening-commitment relation spans the -groups: one $\mathbf D$ matrix acts on their concatenated opening digits. The -field-level evaluation trace separately batches their claimed evaluations. +then resumes the ordinary single-opening recursion. The batching preserves +the separate group commitments and folded responses: each group has its own +$\mathbf z_g$, $\hat{\mathbf t}_g$, and group-local `consistency | A | B` +relations. On the opening side, however, every group contributes an +$\hat{\mathbf e}_g$ segment to one concatenated vector. One $\mathbf D$ matrix +binds that entire vector, and the field-level evaluation trace separately +batches the claimed evaluations. To show only what changes from the basic setting, assume one polynomial claim per group and add a group index $g$ to the previous notation. Group $g$ has @@ -507,25 +507,52 @@ $$ } $$ -There is no sum over $g$. Each group keeps a separate response -$\mathbf z_g$, opening digits $\hat{\mathbf e}_g$, and inner-commitment digits -$\hat{\mathbf t}_g$. The basic consistency, $\mathbf A$, and $\mathbf B$ -relations are repeated independently for every group. In particular, the -$\mathbf B_g$ rows bind $\hat{\mathbf t}_g$ to that group's public commitment -$\mathbf u_g$. +There is no sum over $g$: the folded responses $\mathbf z_g$ remain separate. +The basic consistency, $\mathbf A$, and $\mathbf B$ relations are repeated +independently for every group. In particular, the $\mathbf B_g$ rows bind +$\hat{\mathbf t}_g$ to that group's public commitment $\mathbf u_g$. Each +group also produces opening digits $\hat{\mathbf e}_g$, which become one +segment of the shared opening vector below. -Among the four physical relation families, only the $\mathbf D$ relation -combines witness data from different groups. It acts once on the concatenated -opening digits: +The fold and outer-commitment parts remain group-local because each commitment +fixes its own $\mathbf A_g$ and $\mathbf B_g$ matrices, decomposition +parameters, and public target $\mathbf u_g$. Its folded response $\mathbf z_g$ +is formed with that group's challenges and must be checked against those fixed +parameters. Combining the responses across groups would lose these +group-specific commitment bindings. + +The $\mathbf D$ relation can be shared for a different reason. Unlike +$\mathbf A_g$ and $\mathbf B_g$, $\mathbf D$ is owned by the fold level rather +than by an individual commitment group. Every $\hat{\mathbf e}_g$ segment uses +the same opening-role ring dimension and decomposition basis, so the segments +can occupy disjoint column ranges of one matrix + +$$ +\mathbf D += +[\mathbf D_0\mid\mathbf D_1\mid\cdots], +$$ + +and be concatenated into one input vector: $$ \hat{\mathbf e}_{\mathrm{all}} = \big\Vert_{g\in\mathrm{relation\ order}}\hat{\mathbf e}_g, \qquad -\mathbf D\hat{\mathbf e}_{\mathrm{all}}=\mathbf v_D. +\mathbf D\hat{\mathbf e}_{\mathrm{all}} += +\sum_g\mathbf D_g\hat{\mathbf e}_g += +\mathbf v_D. $$ +Thus the opening digits are not committed separately by group: they are +concatenated and bound together by the single relation +$\mathbf D\hat{\mathbf e}_{\mathrm{all}}=\mathbf v_D$. The fixed column ranges +record which coordinates came from each group, and the group-local consistency +rows prove what each $\hat{\mathbf e}_g$ segment represents. + In the canonical physical row order, the final/new group is placed first, followed by the precommitted groups. The shared $\mathbf D$ rows remain at the end: From 45cd7234b3eec689a7803c3eef078e56553581e3 Mon Sep 17 00:00:00 2001 From: Freya Date: Mon, 3 Aug 2026 18:29:03 -0400 Subject: [PATCH 08/17] akita-book: advanced relation --- book/src/SUMMARY.md | 1 + .../how/proving/advanced-relation-layouts.md | 215 ++++++++++++++++++ book/src/how/proving/akita-fold.md | 205 +---------------- 3 files changed, 226 insertions(+), 195 deletions(-) create mode 100644 book/src/how/proving/advanced-relation-layouts.md diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 96e7b761c..8e34bfd9e 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -23,6 +23,7 @@ - [The proving protocol](./how/proving/proving.md) - [Field-to-ring evaluation reduction](./how/proving/field-ring-reduction.md) - [Ring relation in an Akita fold](./how/proving/akita-fold.md) + - [Advanced relation layouts](./how/proving/advanced-relation-layouts.md) - [Opening points and digit-innermost layout](./how/proving/opening-points-layout.md) - [Root fold and ring switching](./how/proving/root-fold-ring-switch.md) - [Sumcheck stages](./how/proving/sumcheck-stages.md) diff --git a/book/src/how/proving/advanced-relation-layouts.md b/book/src/how/proving/advanced-relation-layouts.md new file mode 100644 index 000000000..720586322 --- /dev/null +++ b/book/src/how/proving/advanced-relation-layouts.md @@ -0,0 +1,215 @@ +# Advanced relation layouts + +The [ring relation in an Akita fold](./akita-fold.md) starts with one +commitment group, one witness chunk, and one common ring dimension. This page +extends that basic case along three independent layout axes: + +1. multiple commitment groups add group-local relation rows and witness + segments to the root fold; +2. multiple witness chunks partition the work and physical witness columns + within each group; and +3. different ring dimensions let each physical row retain the native ring of + its matrix role. + +None of these extensions changes the four physical relation families. They +change which rows and columns belong to each group, chunk, or native ring. The +physical opening-commitment relation remains distinct from the field-valued +evaluation trace, just as in the basic setting. + +## Contents + +- [Multiple commitment groups](#multiple-commitment-groups) + - [Why multiple commitment groups](#why-multiple-commitment-groups) + - [Group-local folded responses and relations](#group-local-folded-responses-and-relations) + - [The shared opening-commitment relation](#the-shared-opening-commitment-relation) + - [Physical row and witness layout](#physical-row-and-witness-layout) + - [Return to the single-group recursion](#return-to-the-single-group-recursion) +- [Multiple witness chunks](#multiple-witness-chunks) +- [Different ring dimensions](#different-ring-dimensions) + +## Multiple commitment groups + +### Why multiple commitment groups + +In zkVM applications, polynomials such as execution traces, advice, and +preprocessed data may be committed at different times. When one commitment is +formed, the prover may not yet know which other commitments it will later be +opened with, the opening point, or the root schedule that will combine them. +Akita calls the polynomials held under one independently formed outer +commitment a **commitment group**. All claims in one group share an opening +point. In the current implementation, all groups are opened at one shared root +point. One group is the **final/new group**, while commitments formed earlier +enter as **precommitted groups** with already-fixed parameters. + +Proving each commitment group separately would repeat the entire recursive +opening protocol. Akita instead batches the groups in one root transition and +then resumes the ordinary single-opening recursion. The batching preserves +the separate group commitments and folded responses: each group has its own +$\mathbf z_g$, $\hat{\mathbf t}_g$, and group-local `consistency | A | B` +relations. On the opening side, however, every group contributes an +$\hat{\mathbf e}_g$ segment to one concatenated vector. One $\mathbf D$ matrix +binds that entire vector, and the field-level evaluation trace separately +batches the claimed evaluations. + +### Group-local folded responses and relations + +To show only what changes from the basic setting, assume one polynomial claim +per group and add a group index $g$ to the previous notation. Group $g$ has +its own blocks $\mathbf s_{g,b}$, fold challenges $c_{g,b}$, and folded response + +$$ +\boxed{ +\mathbf z_g += +\sum_b c_{g,b}\mathbf s_{g,b}. +} +$$ + +There is no sum over $g$: the folded responses $\mathbf z_g$ remain separate. +The basic consistency, $\mathbf A$, and $\mathbf B$ relations are repeated +independently for every group. In particular, the $\mathbf B_g$ rows bind +$\hat{\mathbf t}_g$ to that group's public commitment $\mathbf u_g$. Each +group also produces opening digits $\hat{\mathbf e}_g$, which become one +segment of the shared opening vector below. + +The fold and outer-commitment parts remain group-local because each commitment +fixes its own $\mathbf A_g$ and $\mathbf B_g$ matrices, decomposition +parameters, and public target $\mathbf u_g$. Its folded response $\mathbf z_g$ +is formed with that group's challenges and must be checked against those fixed +parameters. Combining the responses across groups would lose these +group-specific commitment bindings. + +### The shared opening-commitment relation + +The $\mathbf D$ relation can be shared for a different reason. Unlike +$\mathbf A_g$ and $\mathbf B_g$, $\mathbf D$ is owned by the fold level rather +than by an individual commitment group. Every $\hat{\mathbf e}_g$ segment uses +the same opening-role ring dimension and decomposition basis, so the segments +can occupy disjoint column ranges of one matrix + +$$ +\mathbf D += +[\mathbf D_0\mid\mathbf D_1\mid\cdots], +$$ + +and be concatenated into one input vector: + +$$ +\hat{\mathbf e}_{\mathrm{all}} += +\big\Vert_{g\in\mathrm{relation\ order}}\hat{\mathbf e}_g, +\qquad +\mathbf D\hat{\mathbf e}_{\mathrm{all}} += +\sum_g\mathbf D_g\hat{\mathbf e}_g += +\mathbf v_D. +$$ + +Thus the opening digits are not committed separately by group: they are +concatenated and bound together by the single relation +$\mathbf D\hat{\mathbf e}_{\mathrm{all}}=\mathbf v_D$. The fixed column ranges +record which coordinates came from each group, and the group-local consistency +rows prove what each $\hat{\mathbf e}_g$ segment represents. + +### Physical row and witness layout + +In the canonical physical row order, the final/new group is placed first, +followed by the precommitted groups. The shared $\mathbf D$ rows remain at the +end: + +$$ +\begin{aligned} +{}& +[\mathrm{consistency}_{\mathrm{final}} + \mid \mathbf A_{\mathrm{final}} + \mid \mathbf B_{\mathrm{final}}] +\\[-2pt] +&\quad\Vert +\big\Vert_{g\in\mathrm{precommitted}} +[\mathrm{consistency}_g\mid\mathbf A_g\mid\mathbf B_g] +\quad\Vert\quad +\mathbf D. +\end{aligned} +$$ + +Consequently, the full right-hand side is + +$$ +\mathbf y += +\big\Vert_{g\in\mathrm{relation\ order}} +[0\mid\mathbf 0_{\mathbf A_g}\mid\mathbf u_g] +\quad\Vert\quad +\mathbf v_D. +$$ + +This relation is block sparse: a group's consistency, $\mathbf A_g$, and +$\mathbf B_g$ rows touch only that group's witness segment, whereas the +shared $\mathbf D$ rows touch the $\hat{\mathbf e}_g$ segments from every +group. Stage 2 batches all physical rows into one sumcheck, but this batching +does not merge the group-local relations. + +For a single chunk per group, the corresponding pre-switch witness layout is + +$$ +\mathbf w_0 += +\big\Vert_{g\in\mathrm{relation\ order}} +[\hat{\mathbf z}_g\mid\hat{\mathbf e}_g\mid\hat{\mathbf t}_g]. +$$ + +The quotient digits for all physical rows are stored once, in one shared +$\hat{\mathbf r}$ tail after these group segments. + +### Return to the single-group recursion + +The root fold consumes this multi-group structure. After ring switching, the +group segments and the shared quotient tail form one witness + +$$ +\mathbf w^{\mathrm{next}} += +\mathbf w_0\Vert\hat{\mathbf r}, +$$ + +which is committed once for the next level. The output of the multi-group root +is therefore the basic recursive object: one polynomial group, one committed +witness, and one opening claim at one point. The original root groups remain +only as ranges inside the flat witness; they no longer define separate folded +responses or relation rows. + +## Multiple witness chunks + +> **Status:** stub. This section will derive how each group's live blocks are +> partitioned among witness chunks, how chunk-local segments contribute to the +> same group-level rows, and why all groups and chunks share one quotient tail. + +**Sources to fold in** + +- `crates/akita-types/src/witness.rs` (`WitnessLayout`, `WitnessUnitLayout`). +- `crates/akita-types/src/proof/ring_relation.rs` (`RingRelationInstance::segment_layout`). +- `crates/akita-prover/src/protocol/ring_switch/coeffs.rs` (group- and chunk-ordered witness emission). +- [Opening points and digit-innermost layout](./opening-points-layout.md#chunks-and-tensor-challenges). +- [The distributed prover](./distributed-prover.md). + +## Different ring dimensions + +> **Status:** stub. This section will distinguish each relation row's native +> ring dimension from the common carrier dimension, then derive the mixed-row +> quotient and ring-switch evaluation without assuming a common denominator +> $X^D+1$. + +**Sources to fold in** + +- `crates/akita-types/src/proof/relation.rs` (`RelationRhsLayout::row_ring_dims`). +- `crates/akita-types/src/proof/relation_address.rs` (`RelationAddressGeometry`). +- `crates/akita-types/src/layout/params.rs` (`relation_witness_carrier_ring_dimension`). +- `crates/akita-prover/src/protocol/ring_relation/relation_quotient.rs`. +- `crates/akita-verifier/src/protocol/ring_switch/prepared_relation_point.rs`. +- `crates/akita-verifier/src/protocol/ring_switch/mixed_relation.rs`. + +With the logical relation layout established, [Opening points and +digit-innermost layout](./opening-points-layout.md) specifies how its segments +are flattened into the physical source and committed witness order. diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md index f3fce3341..cc0b86415 100644 --- a/book/src/how/proving/akita-fold.md +++ b/book/src/how/proving/akita-fold.md @@ -8,10 +8,11 @@ $$ R=F[X]/(X^D+1). $$ -The current implementation also supports multiple polynomial groups, -multiple claims, chunked witnesses, and different ring dimensions for -different relation rows. Those extensions change the layout, but not the four -core relations developed below. +The current implementation also supports more elaborate physical layouts, but +those extensions do not change the four core relations developed below. After +establishing the basic case, [Advanced relation +layouts](./advanced-relation-layouts.md) adds commitment groups, witness chunks, +and different ring dimensions one axis at a time. The Akita paper presents a more general matrix with additional compression relations. Its basic Greyhound relation motivates the four row families here; @@ -44,9 +45,6 @@ described on this page. - [Outer-commitment consistency](#3-outer-commitment-consistency) - [Opening-commitment consistency](#4-opening-commitment-consistency) - [Assemble the ring relation](#assemble-the-ring-relation) -- [Relation layouts beyond the basic setting](#relation-layouts-beyond-the-basic-setting) - - [Multiple polynomial groups](#multiple-polynomial-groups) - - [Multiple witness chunks](#multiple-witness-chunks) - [Lift the ring relation before sumcheck](#lift-the-ring-relation-before-sumcheck) - [The scalar opening claim is a virtual row](#the-scalar-opening-claim-is-a-virtual-row) - [Code reference](#code-reference) @@ -466,191 +464,6 @@ from the fold challenges, opening weights, gadget weights, and the setup matrices $\mathbf A$, $\mathbf B$, and $\mathbf D$. The code generates these contributions directly from the canonical witness layout. -## Relation layouts beyond the basic setting - -The relation above uses one polynomial group and one witness chunk. The code -also supports multiple groups and multiple chunks. These cases change how the -physical rows or witness columns are arranged, while preserving the basic -relations above. - -### Multiple polynomial groups - -In zkVM applications, polynomials such as execution traces, advice, and -preprocessed data may be committed at different times. When one commitment is -formed, the prover may not yet know which other commitments it will later be -opened with, the opening point, or the root schedule that will combine them. -Akita calls the polynomials held under one independently formed outer -commitment a **commitment group**. All claims in one group share an opening -point. In the current implementation, all groups are opened at one shared root -point. One group is the **final/new group**, while commitments formed earlier -enter as **precommitted groups** with already-fixed parameters. - -Proving each commitment group separately would repeat the entire recursive -opening protocol. Akita instead batches the groups in one root transition and -then resumes the ordinary single-opening recursion. The batching preserves -the separate group commitments and folded responses: each group has its own -$\mathbf z_g$, $\hat{\mathbf t}_g$, and group-local `consistency | A | B` -relations. On the opening side, however, every group contributes an -$\hat{\mathbf e}_g$ segment to one concatenated vector. One $\mathbf D$ matrix -binds that entire vector, and the field-level evaluation trace separately -batches the claimed evaluations. - -To show only what changes from the basic setting, assume one polynomial claim -per group and add a group index $g$ to the previous notation. Group $g$ has -its own blocks $\mathbf s_{g,b}$, fold challenges $c_{g,b}$, and folded response - -$$ -\boxed{ -\mathbf z_g -= -\sum_b c_{g,b}\mathbf s_{g,b}. -} -$$ - -There is no sum over $g$: the folded responses $\mathbf z_g$ remain separate. -The basic consistency, $\mathbf A$, and $\mathbf B$ relations are repeated -independently for every group. In particular, the $\mathbf B_g$ rows bind -$\hat{\mathbf t}_g$ to that group's public commitment $\mathbf u_g$. Each -group also produces opening digits $\hat{\mathbf e}_g$, which become one -segment of the shared opening vector below. - -The fold and outer-commitment parts remain group-local because each commitment -fixes its own $\mathbf A_g$ and $\mathbf B_g$ matrices, decomposition -parameters, and public target $\mathbf u_g$. Its folded response $\mathbf z_g$ -is formed with that group's challenges and must be checked against those fixed -parameters. Combining the responses across groups would lose these -group-specific commitment bindings. - -The $\mathbf D$ relation can be shared for a different reason. Unlike -$\mathbf A_g$ and $\mathbf B_g$, $\mathbf D$ is owned by the fold level rather -than by an individual commitment group. Every $\hat{\mathbf e}_g$ segment uses -the same opening-role ring dimension and decomposition basis, so the segments -can occupy disjoint column ranges of one matrix - -$$ -\mathbf D -= -[\mathbf D_0\mid\mathbf D_1\mid\cdots], -$$ - -and be concatenated into one input vector: - -$$ -\hat{\mathbf e}_{\mathrm{all}} -= -\big\Vert_{g\in\mathrm{relation\ order}}\hat{\mathbf e}_g, -\qquad -\mathbf D\hat{\mathbf e}_{\mathrm{all}} -= -\sum_g\mathbf D_g\hat{\mathbf e}_g -= -\mathbf v_D. -$$ - -Thus the opening digits are not committed separately by group: they are -concatenated and bound together by the single relation -$\mathbf D\hat{\mathbf e}_{\mathrm{all}}=\mathbf v_D$. The fixed column ranges -record which coordinates came from each group, and the group-local consistency -rows prove what each $\hat{\mathbf e}_g$ segment represents. - -In the canonical physical row order, the final/new group is placed first, -followed by the precommitted groups. The shared $\mathbf D$ rows remain at the -end: - -$$ -\begin{aligned} -{}& -[\mathrm{consistency}_{\mathrm{final}} - \mid \mathbf A_{\mathrm{final}} - \mid \mathbf B_{\mathrm{final}}] -\\[-2pt] -&\quad\Vert -\big\Vert_{g\in\mathrm{precommitted}} -[\mathrm{consistency}_g\mid\mathbf A_g\mid\mathbf B_g] -\quad\Vert\quad -\mathbf D. -\end{aligned} -$$ - -Consequently, the full right-hand side is - -$$ -\mathbf y -= -\big\Vert_{g\in\mathrm{relation\ order}} -[0\mid\mathbf 0_{\mathbf A_g}\mid\mathbf u_g] -\quad\Vert\quad -\mathbf v_D. -$$ - -This relation is block sparse: a group's consistency, $\mathbf A_g$, and -$\mathbf B_g$ rows touch only that group's witness segment, whereas the -shared $\mathbf D$ rows touch the $\hat{\mathbf e}_g$ segments from every -group. Stage 2 batches all physical rows into one sumcheck, but this batching -does not merge the group-local relations. - -For a single chunk per group, the corresponding pre-switch witness layout is - -$$ -\mathbf w_0 -= -\big\Vert_{g\in\mathrm{relation\ order}} -[\hat{\mathbf z}_g\mid\hat{\mathbf e}_g\mid\hat{\mathbf t}_g]. -$$ - -The quotient digits for all physical rows are stored once, in one shared -$\hat{\mathbf r}$ tail after these group segments. - -The root fold consumes this multi-group structure. After ring switching, the -group segments and the shared quotient tail form one witness - -$$ -\mathbf w^{\mathrm{next}} -= -\mathbf w_0\Vert\hat{\mathbf r}, -$$ - -which is committed once for the next level. The output of the multi-group root -is therefore the basic recursive object: one polynomial group, one committed -witness, and one opening claim at one point. The original root groups remain -only as ranges inside the flat witness; they no longer define separate folded -responses or relation rows. - -### Multiple witness chunks - -The chunked or distributed layout further partitions each group's live blocks -into disjoint ranges $I_{g,k}$. Chunk $k$ computes the partial folded response - -$$ -\mathbf z_{g,k} -= -\sum_{b\in I_{g,k}}c_{g,b}\mathbf s_{g,b}, -\qquad -\mathbf z_g=\sum_k\mathbf z_{g,k}. -$$ - -The canonical layout is group-major and then chunk-minor: - -$$ -\boxed{ -\mathbf w -= -\big\Vert_g\big\Vert_k -[\hat{\mathbf z}_{g,k} - \mid\hat{\mathbf e}_{g,k} - \mid\hat{\mathbf t}_{g,k}] -\quad\Vert\quad -\hat{\mathbf r}. -} -$$ - -Every chunk has a full-shaped local $\hat z$ segment, while its $\hat e$ and -$\hat t$ segments contain only the live blocks owned by that chunk. Chunking -adds witness columns, not relation rows: the chunk matrices are stacked -horizontally and contribute to the same group-level `consistency | A | B` -rows. The $\mathbf D$ rows and the quotient tail $\hat{\mathbf r}$ are shared -across all groups and chunks. - ## Lift the ring relation before sumcheck Equation (20) is an equality modulo $X^D+1$. Sumcheck, however, needs a field @@ -870,6 +683,8 @@ ring_switch_verifier --------------------------------------> Stage 2 verifier Only the public instance is reconstructed on the verifier. The `RingRelationWitness` and its group witnesses remain prover-only. -The canonical multi-group and multi-chunk physical layout is described in -[Opening points and digit-innermost -layout](./opening-points-layout.md#witness-order). +The basic case on this page extends to multiple commitment groups, witness +chunks, and mixed ring dimensions in [Advanced relation +layouts](./advanced-relation-layouts.md). [Opening points and digit-innermost +layout](./opening-points-layout.md#witness-order) then specifies the canonical +physical source and digit order. From 6e5348593db83ca3b380a68d4195419bb0d0d5a5 Mon Sep 17 00:00:00 2001 From: Freya Date: Tue, 4 Aug 2026 17:47:03 -0400 Subject: [PATCH 09/17] docs(book): keep Akita fold chapter basic --- book/src/SUMMARY.md | 3 +- .../how/proving/advanced-relation-layouts.md | 215 ------------------ book/src/how/proving/akita-fold.md | 54 ++--- 3 files changed, 26 insertions(+), 246 deletions(-) delete mode 100644 book/src/how/proving/advanced-relation-layouts.md diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 8e34bfd9e..fbf0b38f5 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -22,8 +22,7 @@ - [Transcript and instance binding](./how/transcript.md) - [The proving protocol](./how/proving/proving.md) - [Field-to-ring evaluation reduction](./how/proving/field-ring-reduction.md) - - [Ring relation in an Akita fold](./how/proving/akita-fold.md) - - [Advanced relation layouts](./how/proving/advanced-relation-layouts.md) + - [Basic relations in an Akita fold](./how/proving/akita-fold.md) - [Opening points and digit-innermost layout](./how/proving/opening-points-layout.md) - [Root fold and ring switching](./how/proving/root-fold-ring-switch.md) - [Sumcheck stages](./how/proving/sumcheck-stages.md) diff --git a/book/src/how/proving/advanced-relation-layouts.md b/book/src/how/proving/advanced-relation-layouts.md deleted file mode 100644 index 720586322..000000000 --- a/book/src/how/proving/advanced-relation-layouts.md +++ /dev/null @@ -1,215 +0,0 @@ -# Advanced relation layouts - -The [ring relation in an Akita fold](./akita-fold.md) starts with one -commitment group, one witness chunk, and one common ring dimension. This page -extends that basic case along three independent layout axes: - -1. multiple commitment groups add group-local relation rows and witness - segments to the root fold; -2. multiple witness chunks partition the work and physical witness columns - within each group; and -3. different ring dimensions let each physical row retain the native ring of - its matrix role. - -None of these extensions changes the four physical relation families. They -change which rows and columns belong to each group, chunk, or native ring. The -physical opening-commitment relation remains distinct from the field-valued -evaluation trace, just as in the basic setting. - -## Contents - -- [Multiple commitment groups](#multiple-commitment-groups) - - [Why multiple commitment groups](#why-multiple-commitment-groups) - - [Group-local folded responses and relations](#group-local-folded-responses-and-relations) - - [The shared opening-commitment relation](#the-shared-opening-commitment-relation) - - [Physical row and witness layout](#physical-row-and-witness-layout) - - [Return to the single-group recursion](#return-to-the-single-group-recursion) -- [Multiple witness chunks](#multiple-witness-chunks) -- [Different ring dimensions](#different-ring-dimensions) - -## Multiple commitment groups - -### Why multiple commitment groups - -In zkVM applications, polynomials such as execution traces, advice, and -preprocessed data may be committed at different times. When one commitment is -formed, the prover may not yet know which other commitments it will later be -opened with, the opening point, or the root schedule that will combine them. -Akita calls the polynomials held under one independently formed outer -commitment a **commitment group**. All claims in one group share an opening -point. In the current implementation, all groups are opened at one shared root -point. One group is the **final/new group**, while commitments formed earlier -enter as **precommitted groups** with already-fixed parameters. - -Proving each commitment group separately would repeat the entire recursive -opening protocol. Akita instead batches the groups in one root transition and -then resumes the ordinary single-opening recursion. The batching preserves -the separate group commitments and folded responses: each group has its own -$\mathbf z_g$, $\hat{\mathbf t}_g$, and group-local `consistency | A | B` -relations. On the opening side, however, every group contributes an -$\hat{\mathbf e}_g$ segment to one concatenated vector. One $\mathbf D$ matrix -binds that entire vector, and the field-level evaluation trace separately -batches the claimed evaluations. - -### Group-local folded responses and relations - -To show only what changes from the basic setting, assume one polynomial claim -per group and add a group index $g$ to the previous notation. Group $g$ has -its own blocks $\mathbf s_{g,b}$, fold challenges $c_{g,b}$, and folded response - -$$ -\boxed{ -\mathbf z_g -= -\sum_b c_{g,b}\mathbf s_{g,b}. -} -$$ - -There is no sum over $g$: the folded responses $\mathbf z_g$ remain separate. -The basic consistency, $\mathbf A$, and $\mathbf B$ relations are repeated -independently for every group. In particular, the $\mathbf B_g$ rows bind -$\hat{\mathbf t}_g$ to that group's public commitment $\mathbf u_g$. Each -group also produces opening digits $\hat{\mathbf e}_g$, which become one -segment of the shared opening vector below. - -The fold and outer-commitment parts remain group-local because each commitment -fixes its own $\mathbf A_g$ and $\mathbf B_g$ matrices, decomposition -parameters, and public target $\mathbf u_g$. Its folded response $\mathbf z_g$ -is formed with that group's challenges and must be checked against those fixed -parameters. Combining the responses across groups would lose these -group-specific commitment bindings. - -### The shared opening-commitment relation - -The $\mathbf D$ relation can be shared for a different reason. Unlike -$\mathbf A_g$ and $\mathbf B_g$, $\mathbf D$ is owned by the fold level rather -than by an individual commitment group. Every $\hat{\mathbf e}_g$ segment uses -the same opening-role ring dimension and decomposition basis, so the segments -can occupy disjoint column ranges of one matrix - -$$ -\mathbf D -= -[\mathbf D_0\mid\mathbf D_1\mid\cdots], -$$ - -and be concatenated into one input vector: - -$$ -\hat{\mathbf e}_{\mathrm{all}} -= -\big\Vert_{g\in\mathrm{relation\ order}}\hat{\mathbf e}_g, -\qquad -\mathbf D\hat{\mathbf e}_{\mathrm{all}} -= -\sum_g\mathbf D_g\hat{\mathbf e}_g -= -\mathbf v_D. -$$ - -Thus the opening digits are not committed separately by group: they are -concatenated and bound together by the single relation -$\mathbf D\hat{\mathbf e}_{\mathrm{all}}=\mathbf v_D$. The fixed column ranges -record which coordinates came from each group, and the group-local consistency -rows prove what each $\hat{\mathbf e}_g$ segment represents. - -### Physical row and witness layout - -In the canonical physical row order, the final/new group is placed first, -followed by the precommitted groups. The shared $\mathbf D$ rows remain at the -end: - -$$ -\begin{aligned} -{}& -[\mathrm{consistency}_{\mathrm{final}} - \mid \mathbf A_{\mathrm{final}} - \mid \mathbf B_{\mathrm{final}}] -\\[-2pt] -&\quad\Vert -\big\Vert_{g\in\mathrm{precommitted}} -[\mathrm{consistency}_g\mid\mathbf A_g\mid\mathbf B_g] -\quad\Vert\quad -\mathbf D. -\end{aligned} -$$ - -Consequently, the full right-hand side is - -$$ -\mathbf y -= -\big\Vert_{g\in\mathrm{relation\ order}} -[0\mid\mathbf 0_{\mathbf A_g}\mid\mathbf u_g] -\quad\Vert\quad -\mathbf v_D. -$$ - -This relation is block sparse: a group's consistency, $\mathbf A_g$, and -$\mathbf B_g$ rows touch only that group's witness segment, whereas the -shared $\mathbf D$ rows touch the $\hat{\mathbf e}_g$ segments from every -group. Stage 2 batches all physical rows into one sumcheck, but this batching -does not merge the group-local relations. - -For a single chunk per group, the corresponding pre-switch witness layout is - -$$ -\mathbf w_0 -= -\big\Vert_{g\in\mathrm{relation\ order}} -[\hat{\mathbf z}_g\mid\hat{\mathbf e}_g\mid\hat{\mathbf t}_g]. -$$ - -The quotient digits for all physical rows are stored once, in one shared -$\hat{\mathbf r}$ tail after these group segments. - -### Return to the single-group recursion - -The root fold consumes this multi-group structure. After ring switching, the -group segments and the shared quotient tail form one witness - -$$ -\mathbf w^{\mathrm{next}} -= -\mathbf w_0\Vert\hat{\mathbf r}, -$$ - -which is committed once for the next level. The output of the multi-group root -is therefore the basic recursive object: one polynomial group, one committed -witness, and one opening claim at one point. The original root groups remain -only as ranges inside the flat witness; they no longer define separate folded -responses or relation rows. - -## Multiple witness chunks - -> **Status:** stub. This section will derive how each group's live blocks are -> partitioned among witness chunks, how chunk-local segments contribute to the -> same group-level rows, and why all groups and chunks share one quotient tail. - -**Sources to fold in** - -- `crates/akita-types/src/witness.rs` (`WitnessLayout`, `WitnessUnitLayout`). -- `crates/akita-types/src/proof/ring_relation.rs` (`RingRelationInstance::segment_layout`). -- `crates/akita-prover/src/protocol/ring_switch/coeffs.rs` (group- and chunk-ordered witness emission). -- [Opening points and digit-innermost layout](./opening-points-layout.md#chunks-and-tensor-challenges). -- [The distributed prover](./distributed-prover.md). - -## Different ring dimensions - -> **Status:** stub. This section will distinguish each relation row's native -> ring dimension from the common carrier dimension, then derive the mixed-row -> quotient and ring-switch evaluation without assuming a common denominator -> $X^D+1$. - -**Sources to fold in** - -- `crates/akita-types/src/proof/relation.rs` (`RelationRhsLayout::row_ring_dims`). -- `crates/akita-types/src/proof/relation_address.rs` (`RelationAddressGeometry`). -- `crates/akita-types/src/layout/params.rs` (`relation_witness_carrier_ring_dimension`). -- `crates/akita-prover/src/protocol/ring_relation/relation_quotient.rs`. -- `crates/akita-verifier/src/protocol/ring_switch/prepared_relation_point.rs`. -- `crates/akita-verifier/src/protocol/ring_switch/mixed_relation.rs`. - -With the logical relation layout established, [Opening points and -digit-innermost layout](./opening-points-layout.md) specifies how its segments -are flattened into the physical source and committed witness order. diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md index cc0b86415..d52caf246 100644 --- a/book/src/how/proving/akita-fold.md +++ b/book/src/how/proving/akita-fold.md @@ -1,4 +1,4 @@ -# Ring relation in an Akita fold +# Basic relations in an Akita fold This page describes the ring-valued relations proved by one non-terminal Akita fold. The presentation starts with one polynomial group, one opening @@ -8,11 +8,10 @@ $$ R=F[X]/(X^D+1). $$ -The current implementation also supports more elaborate physical layouts, but -those extensions do not change the four core relations developed below. After -establishing the basic case, [Advanced relation -layouts](./advanced-relation-layouts.md) adds commitment groups, witness chunks, -and different ring dimensions one axis at a time. +The current implementation also supports more elaborate physical layouts — +commitment groups, witness chunks, and different ring dimensions — but those +extensions do not change the four core relations developed below. This page +establishes only the basic case; advanced layouts are outside its scope. The Akita paper presents a more general matrix with additional compression relations. Its basic Greyhound relation motivates the four row families here; @@ -572,7 +571,9 @@ evaluation row, and the range-image binding into one Stage-2 sumcheck. ## Code reference -The current prover follows the construction above: +The current prover uses canonical entry points that also support more general +layouts. With one group, one chunk, and one common ring dimension, they reduce +to the construction above: 1. **Build the partial-evaluation and fold witnesses.** [`RingRelationProver::new`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_relation.rs#L433-L760) @@ -592,8 +593,9 @@ The current prover follows the construction above: 4. **Compute the row quotients.** [`compute_multi_group_relation_quotient`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_relation/relation_quotient.rs#L412-L690) computes one quotient for each `consistency`, $\mathbf A$, $\mathbf B$, and - $\mathbf D$ row. `ring_switch_build_w` decomposes them and appends - $\hat r$. + $\mathbf D$ row. Despite its general name, this is also the canonical + single-group path. `ring_switch_build_w` decomposes the quotients and + appends $\hat r$. 5. **Evaluate the extended relation.** [`build_relation_weight_events`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_switch/relation_weights.rs#L398-L870) emits the contributions of all four row families and the quotient columns @@ -614,10 +616,10 @@ RingRelationProver::new | v ring_switch_build_w -|-- compute_multi_group_relation_quotient --> r -|-- decompose z ----------------------------> z_hat -|-- decompose r ----------------------------> r_hat -`-- emit [z_hat | e_hat | t_hat | r_hat] ---> committed witness w +|-- compute relation quotients ----------> r +|-- decompose z -------------------------> z_hat +|-- decompose r -------------------------> r_hat +`-- emit [z_hat | e_hat | t_hat | r_hat] --> committed witness w | v build_relation_weight_events @@ -632,24 +634,22 @@ verifier can reconstruct: | Field | Mathematical meaning | |---|---| -| `group_challenges()` | fold challenges $c_b$ | -| `group_opening_point()` | ordinary opening weights, including $Q_p$ and $B_b$ | -| `group_ring_multiplier_point()` | ring multipliers used by the physical consistency row | +| `group_challenges()[0]` | fold challenges $c_b$ | +| `group_opening_point(0)` | ordinary opening weights, including $Q_p$ and $B_b$ | +| `group_ring_multiplier_point(0)` | ring multipliers used by the physical consistency row | | `rhs()` | $\mathbf y=[0\mid\mathbf 0_A\mid\mathbf u\mid\mathbf v_D]$ in the basic setting | | `v()` | $\mathbf v_D=\mathbf D\hat{\mathbf e}$ | -| `role_dims()` | the $\mathbf A$-, $\mathbf B$-, and $\mathbf D$-row ring dimensions | ### Prover witness: `RingRelationWitness` [`RingRelationWitness`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_relation_witness.rs#L141-L220) -is the prover-only aggregate witness. It holds the fold-grinding nonce and one -[`RingRelationGroupWitness`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_relation_witness.rs#L8-L140) -per polynomial group. In the basic setting, the vector contains one group: +is the prover-only aggregate witness. In the basic setting, its `groups` +vector contains one +[`RingRelationGroupWitness`](https://github.com/LayerZero-Labs/akita/blob/eea8443841ed4a701bf84a9f6415aa9415d6250d/crates/akita-prover/src/protocol/ring_relation_witness.rs#L8-L140): | Field | Mathematical meaning | |---|---| | `z_folded_rings` | folded response $\mathbf z$, before decomposition into $\hat z$ | -| `z_folded_centered_per_chunk` | chunk-local folded responses $\mathbf z_k$ | | `e_folded` | recomposed position-folded rings $E_b$ | | `e_hat` | opening digits $\hat{\mathbf e}$ | | `hint` | commitment hint containing $\hat{\mathbf t}$ | @@ -668,7 +668,7 @@ it reconstructs the public instance from the transcript and public proof data: public commitment rows, opening points, v_D, and transcript | v -rederive the per-group fold challenges +rederive the fold challenges | v assemble_relation_rhs @@ -681,10 +681,6 @@ ring_switch_verifier --------------------------------------> Stage 2 verifier ``` Only the public instance is reconstructed on the verifier. The -`RingRelationWitness` and its group witnesses remain prover-only. - -The basic case on this page extends to multiple commitment groups, witness -chunks, and mixed ring dimensions in [Advanced relation -layouts](./advanced-relation-layouts.md). [Opening points and digit-innermost -layout](./opening-points-layout.md#witness-order) then specifies the canonical -physical source and digit order. +`RingRelationWitness` remains prover-only. [Opening points and digit-innermost +layout](./opening-points-layout.md#witness-order) specifies the canonical +physical source and digit order used by the implementation. From 4061afe4cf94d38daab83954dd1944a440f2dde5 Mon Sep 17 00:00:00 2001 From: Freya Date: Wed, 5 Aug 2026 10:23:26 -0400 Subject: [PATCH 10/17] docs(book): introduce fold input objects --- book/src/how/proving/akita-fold.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md index d52caf246..51cb8e2f9 100644 --- a/book/src/how/proving/akita-fold.md +++ b/book/src/how/proving/akita-fold.md @@ -50,6 +50,15 @@ described on this page. ## Objects entering the fold +Before deriving the four relation families, we first identify the secret +objects on which they act. Starting from the digit vectors of the old +polynomial blocks, the prover derives inner-image digits +$\hat{\mathbf t}$ and partial-evaluation digits $\hat{\mathbf e}$, then folds +the block digits into $\mathbf z$ and digitizes it as $\hat{\mathbf z}$. These +three digit vectors become the main segments of the next committed witness. +This section introduces them in dependency order, beginning with the bounded +digit representation required by the commitment binding argument. + ### Why the witness is digit-decomposed The witness committed for the next level must have bounded coefficients. This From 7f22d069e89de5358dfd981fdcae860fa77bbaff Mon Sep 17 00:00:00 2001 From: Freya Date: Wed, 5 Aug 2026 11:13:03 -0400 Subject: [PATCH 11/17] akita-book: polish basic relation --- book/src/how/proving/akita-fold.md | 225 ++++++++++++++++++++--------- 1 file changed, 159 insertions(+), 66 deletions(-) diff --git a/book/src/how/proving/akita-fold.md b/book/src/how/proving/akita-fold.md index 51cb8e2f9..aa12608ce 100644 --- a/book/src/how/proving/akita-fold.md +++ b/book/src/how/proving/akita-fold.md @@ -33,9 +33,10 @@ described on this page. ## Contents -- [Objects entering the fold](#objects-entering-the-fold) - - [Why the witness is digit-decomposed](#why-the-witness-is-digit-decomposed) - - [Polynomial blocks and inner digits](#polynomial-blocks-and-inner-digits) +- [Inputs and objects derived in the fold](#inputs-and-objects-derived-in-the-fold) + - [The committed polynomial and opening query](#the-committed-polynomial-and-opening-query) + - [Balanced digit representations](#balanced-digit-representations) + - [Polynomial blocks and commitment hint](#polynomial-blocks-and-commitment-hint) - [Partial evaluations and opening digits](#partial-evaluations-and-opening-digits) - [The folded response and its digitization](#the-folded-response-and-its-digitization) - [The four physical relation families](#the-four-physical-relation-families) @@ -48,65 +49,147 @@ described on this page. - [The scalar opening claim is a virtual row](#the-scalar-opening-claim-is-a-virtual-row) - [Code reference](#code-reference) -## Objects entering the fold +## Inputs and objects derived in the fold -Before deriving the four relation families, we first identify the secret -objects on which they act. Starting from the digit vectors of the old -polynomial blocks, the prover derives inner-image digits -$\hat{\mathbf t}$ and partial-evaluation digits $\hat{\mathbf e}$, then folds -the block digits into $\mathbf z$ and digitizes it as $\hat{\mathbf z}$. These -three digit vectors become the main segments of the next committed witness. -This section introduces them in dependency order, beginning with the bounded -digit representation required by the commitment binding argument. +A fold starts from a public opening claim -### Why the witness is digit-decomposed +$$ +\widetilde f(r)=v +$$ + +for a polynomial whose commitment $\mathbf u$ is already fixed. At a recursive +level, $\mathbf u$ is the next-witness commitment produced by the preceding +level; at the root, the original polynomial commitment plays the same role. + +The prover and verifier have different views of these inputs. The prover holds +the polynomial blocks, their inner-digit representation, the commitment hint +generated when $\mathbf u$ was formed, and the public commitment itself. The +verifier knows $\mathbf u$ and the opening claim, but receives neither the +blocks nor the hint. + +From these inputs, the current fold derives two new representations of the +committed polynomial. The opening point determines partial evaluations $E_b$ +inside each block, while fresh transcript challenges fold the old block digits +into a response $\mathbf z$. Both are digit-decomposed before entering the next +committed witness. The four relation families later prove that these derived +objects are consistent with the same hidden opening of $\mathbf u$. -The witness committed for the next level must have bounded coefficients. This -shortness condition is essential for the Module-SIS binding argument: two -different bounded openings of the same linear commitment would give a short, -nonzero vector in the kernel of its commitment matrix. +### The committed polynomial and opening query -Gadget decomposition provides the bounded representation. For a power-of-two -base $g$ and digit depth $\delta$, define +As in the previous page, split the ring-valued polynomial table into blocks. +Let $b$ index a live block and $p$ a position inside that block. Pack the inner +coefficient axis into the ring element $$ -\mathbf G_{g,n} +F_{p,b}(X)\in R. +$$ + +The [field-to-ring evaluation +reduction](./field-ring-reduction.md#the-evaluation-problem) splits $r$ into +inner, position, and block coordinates and defines their interpolation weights +$I_\ell$, $Q_p$, and $B_b$. We reuse those definitions here rather than +deriving them again. The position weights $Q_p$ produce $E_b$ below, while the +block weights $B_b$ and inner weights $I_\ell$ belong to the field-valued +evaluation relation. The opening claim enters this page with target $v$. The +evaluation reduction later writes its trace-form target as +$v_{\mathrm{tr}}$; for the single base-field claim considered here, the valid +relation has $v_{\mathrm{tr}}=v$. + +### Balanced digit representations + +Both the existing commitment opening and the next committed witness must have +bounded coefficients. This shortness condition is what lets commitment binding +reduce to Module-SIS: two distinct bounded openings of the same linear +commitment would yield a short, nonzero kernel vector. + +Akita obtains these bounded representations by decomposing ring coefficients +into balanced base-$g$ digits. Let $g$ be an even power of two, let $\delta$ be +the digit depth, and let +$\mathbf x=(x_0,\ldots,x_{n-1})\in R^n$. A balanced decomposition of +$\mathbf x$ consists of digit rings $\hat x_{i,h}(X)\in R$, indexed by +$0\le i