nonym

Base-(2−ω)(2-\omega) digit expansions and adaptive correctness for the KFLT Groth16 garbling scheme

2026-09-26

Trust-minimised Bitcoin bridges in the BitVM lineage garble a Groth16 verifier and disclose a secret exactly when a published proof is invalid. Khambhati, Feickert, Lewe and Tiwari (KFLT) garble the pairing over the source and target groups directly, obtaining a 2.442.44 MiB scheme for BN254, much of it variable cost from rekeying and from the group encodings. We replace the binary decomposition of the rekeying scalar by a base-(2−ω)(2-\omega) expansion with digits in ΣCM={0,±1,±ω,±ω2}\Sigma_{\mathrm{CM}}=\{0,\pm1,\pm\omega,\pm\omega^2\}, the free endomorphisms of the j=0j=0 curve, cutting the A-encoding dimension from 30533053 to 11091109 (L≤92L\le92 versus 254254). We prove the greedy expansion correct with length at most ⌊log⁡7N(z)⌋+2\lfloor\log_7\mathrm{N}(z)\rfloor+2 and machine-check the BN254 bound in Lean 4 via a square-root-free threshold chain. We then identify an adaptive-correctness gap: the incomplete Jacobian formulas used to realise the encodings can be steered to return ⊥\bot by a garbler who chooses the proof after garbling. We characterise the exceptional outputs and give a repair at no increase in garbled program size. Costing the stacked changes brings the scheme from 2.442.44 MiB to roughly 1.11.1 MiB, at which point the untouched fixed cost is 80%80\% of the program.

Introduction

Trust-minimised Bitcoin bridges in the BitVM lineage move SNARK verification off chain: an operator garbles a verifier before the proof exists, later publishes a proof together with one-time signatures on its bits, and a challenger evaluates the garbled verifier locally. If the proof is invalid the evaluation reveals a secret with which the challenger contests the claim; if it is valid the secret stays hidden. The size of the garbled program is the setup cost of the bridge, and for Groth16 the Boolean route costs tens of gigabytes.

Khambhati, Feickert, Lewe and Tiwari[1] (henceforth KFLT) instead garble the verification equation over the source and target groups directly. Building on Argo MAC[2], BABE[3] and Duty-Free Bits[4], they obtain a projective partial garbling scheme for the disclosure function “reveal ss iff the proof is invalid” whose BN254 instantiation is 2.442.44 MiB. The central difficulty is the pairing e(A,B)e(A,B), whose two arguments are both supplied by the evaluator; it is handled by a rekeying gadget that gives the evaluator Q=−kA+RQ=-kA+R for a private scalar kk, obtained as a public linear combination of 254254 Argo encodings ⟦A⟧i=biA+Mi\llbracket A\rrbracket_i=b_iA+M_i indexed by the binary digits bib_i of −k mod r-k \bmod r.

Where the bytes go. The 2.442.44 MiB decomposes as 1212 KiB of group program, 885885 KiB of fixed projectivization cost (eight bit-to-CRT conversions, one per 254254-bit coordinate block) and 16041604 KiB of variable cost proportional to the aggregate affine dimension

Nbase=SA+4SB+SC=3053+6164+1541=10,758,N_{\mathrm{base}} = S_A + 4S_B + S_C = 3053 + 6164 + 1541 = 10{,}758,

where SA=12⋅254+5S_A=12\cdot254+5, SB=SC=12⋅128+5S_B=S_C=12\cdot128+5, and the factor 44 on SBS_B comes from projectivizing Fp2\mathbb{F}_{p^2}-affine encodings through two Fp\mathbb{F}_p instances of doubled width. KFLT’s Appendix A reduces SB,SCS_B,S_C by sampling the encoding coefficients from ΣCM\Sigma_{\mathrm{CM}} rather than {0,1}\{0,1\} (κ ⁣:128→46\kappa\colon 128\to46), and remarks that the binary decomposition of kk in the rekeying gadget could likewise be replaced by a decomposition against ΣCM\Sigma_{\mathrm{CM}}, “always possible” and “more compact”, but that “the analysis involved in showing the bound is nontrivial” and the gain “marginal”. We disagree on the second point and supply the first.

Contributions.

  1. Eisenstein digit expansions (Section 3). The set ΣCM={0,±1,±ω,±ω2}\Sigma_{\mathrm{CM}}=\{0,\pm1,\pm\omega,\pm\omega^2\} is a complete residue system in Z[ω]\mathbb{Z}[\omega] modulo 2−ω2-\omega, which has norm 77. The greedy expansion terminates, is correct, and has length at most ⌊log⁡7N(z)⌋+2\lfloor\log_7 \mathrm{N}(z)\rfloor+2. Every k∈Frk\in\mathbb{F}_r lifts to z≡k(modπ)z\equiv k\pmod{\pi} with 4 N(z)≤3r4\,\mathrm{N}(z)\le 3r by coordinatewise rounding. For BN254 this gives at most 9292 digits, versus 254254 binary digits.
  2. Machine-checked bound (Section 7). The BN254 statement is proved in Lean 4 (v4.34.1) with no external library. The integer square roots that appear in the step bound are avoided in the kernel by a checkable threshold chain: a list of 9393 pairs (Ti,ui)(T_i,u_i) certifying Ti<(ui+1)2T_i<(u_i+1)^2 and ⌊(Ti+2ui+2)/7⌋≤Ti+1\lfloor(T_i+2u_i+2)/7\rfloor\le T_{i+1}, verified by decide. The main theorem depends only on propext, Classical.choice and Quot.sound.
  3. The rekeying gadget with Eisenstein digits (Section 4). Replacing ∑i2i⟦A⟧i\sum_i 2^i\llbracket A\rrbracket_i by ∑i(2−ω)i⟦A⟧i\sum_i (2-\omega)^i\llbracket A\rrbracket_i, where (2−ω)X=2X−ψ(X)(2-\omega)X=2X-\psi(X) is one doubling and one free endomorphism, leaves correctness and the DDH-based privacy proof of KFLT unchanged and cuts SAS_A from 30533053 to 11091109.
  4. Adaptive correctness (Section 5). KFLT’s correctness (their Definition 1) fixes the evaluator’s input before the garbling randomness is drawn. In the bridge the garbler is the prover and chooses the proof afterwards, knowing every mask. We show that with the incomplete Jacobian formulas used to realise Argo encodings this is exploitable: an invalid proof with A=MiA=M_i evaluates to ⊥\bot. We characterise the exceptional outputs algebraically and give a repair that costs no garbled material for binary digits and a bounded candidate enumeration for ΣCM\Sigma_{\mathrm{CM}}.
  5. Cost accounting (Section 6). A stacked estimate, labelled by evidential status, from 2.442.44 MiB to roughly 1.11.1 MiB, after which the untouched 885885 KiB fixed cost is 80%80\% of the program.

Relation to KFLT. Nothing here changes the shape of KFLT’s construction; we replace a number system inside one gadget, tighten one definition to match one application, and account. All cost figures for the unmodified scheme are theirs. We have not implemented the modified scheme; Section 6 labels each row of the cost table as proven, the authors’ own estimate, or ours.

Background

Groth16 verification and KFLT’s group encodings

We follow KFLT’s notation. All groups are written additively, including the target group. A Groth16 proof is (A,B,C)(A,B,C) with A,C∈G1A,C\in\mathbb{G}_1, B∈G2B\in\mathbb{G}_2, all of prime order rr; with the verification key and statement fixed at garbling time, the check is P(A,B,C):=e(A,B)+e(C,H1)−D=0P(A,B,C):=e(A,B)+e(C,H_1)-D=0 for public H1∈G2H_1\in\mathbb{G}_2, D∈GTD\in\mathbb{G}_T. The disclosure function returns the garbler’s s∈{0,1}λs\in\{0,1\}^\lambda if P≠0P\neq0 and ⊥\bot otherwise.

A point VV is encoded as ⟦V⟧=cV+K\llbracket V\rrbracket = cV+K for a private coefficient cc and a uniform private mask KK. KFLT’s scheme ΠG\Pi_G samples c⃗∈{0,1}κ\vec c\in\{0,1\}^\kappa, encodes BB and CC at each t∈[κ]t\in[\kappa] under ctc_t, and handles e(A,B)e(A,B) by the rekeying gadget: the masks on BB are KtB=kUtK^B_t=kU_t for public UtU_t and a single private k∈Frk\in\mathbb{F}_r, and the evaluator is given Q=−kA+RQ=-kA+R, from which e(Q,Ut)e(Q,U_t) cancels the input-dependent mask e(A,KtB)e(A,K^B_t). The point QQ is obtained from n=⌈log⁡2r⌉=254n=\lceil\log_2 r\rceil=254 encodings ⟦A⟧i=biA+Mi\llbracket A\rrbracket_i=b_iA+M_i, where −k≡∑i2ibi-k\equiv\sum_i 2^i b_i, as Q=∑i2i⟦A⟧iQ=\sum_i 2^i\llbracket A\rrbracket_i and R=∑i2iMiR=\sum_i 2^i M_i.

To projectivize, each encoding cV+KcV+K is itself garbled from the affine coordinates of VV by an information-theoretic partial garbling (Ishai–Wee[5]) of the Jacobian addition formulas, then from the bits of those coordinates by Duty-Free Bits[4:1]. With the incomplete formulas of KFLT Theorem 3, each encoding contributes 1212 affine dimensions (77 for uu, 55 for vv); with the complete formulas of Renes–Costello–Batina[6] used in KFLT Appendix A, 1818.

Endomorphisms of BN254 and the digit set ΣCM\Sigma_{\mathrm{CM}}

BN254 has jj-invariant 00: E ⁣:v2=u3+3E\colon v^2=u^3+3 over Fp\mathbb{F}_p and its sextic twist E′E' over Fp2\mathbb{F}_{p^2}. For a primitive cube root of unity ζ∈Fp\zeta\in\mathbb{F}_p the map ψ1(u,v)=(ζu,v)\psi_1(u,v)=(\zeta u,v) is an endomorphism of EE acting on G1\mathbb{G}_1 as multiplication by a primitive cube root of unity λ∈Fr\lambda\in\mathbb{F}_r; ψ2(u,v)=(ζ2u,v)\psi_2(u,v)=(\zeta^2u,v) plays the same role on G2\mathbb{G}_2 (KFLT Appendix A.1). Negation is (u,v)↦(u,−v)(u,v)\mapsto(u,-v). Hence every element of

ΣCM={0,±1,±ω,±ω2}⊂Z[ω]\Sigma_{\mathrm{CM}}=\{0,\pm1,\pm\omega,\pm\omega^2\}\subset\mathbb{Z}[\omega]

acts on G1\mathbb{G}_1 and G2\mathbb{G}_2 by a map ϕc\phi_c that is a coordinatewise scaling of (u,v)(u,v) by constants. This is what makes ΣCM\Sigma_{\mathrm{CM}} “free”: the polynomials computing ϕc(V)+K\phi_c(V)+K have the same monomial support in (u,v)(u,v) as those computing V+KV+K, so the affine dimension of the encoding is unchanged.

Eisenstein integers

Z[ω]={a+bω ⁣:a,b∈Z}\mathbb{Z}[\omega]=\{a+b\omega\colon a,b\in\mathbb{Z}\} with ω2+ω+1=0\omega^2+\omega+1=0 is the ring of integers of Q(−3)\mathbb{Q}(\sqrt{-3}), with norm N(a+bω)=a2−ab+b2=∣a+bω∣2≥0\mathrm{N}(a+b\omega)=a^2-ab+b^2=|a+b\omega|^2\ge0, multiplicative, and conjugate a+bω‾=(a−b)−bω\overline{a+b\omega}=(a-b)-b\omega. Since r≡1(mod3)r\equiv1\pmod 3, rr splits as r=ππˉr=\pi\bar\pi with N(π)=r\mathrm{N}(\pi)=r, and Z[ω]/(π)≅Fr\mathbb{Z}[\omega]/(\pi)\cong\mathbb{F}_r via ω↦λ\omega\mapsto\lambda, where λ\lambda is the root of x2+x+1x^2+x+1 in Fr\mathbb{F}_r for which π(λ)≡0\pi(\lambda)\equiv0. The other root corresponds to πˉ\bar\pi; we fix ζ\zeta so that ψ1\psi_1 acts as λ\lambda, and then the ring homomorphism Z[ω]→End(G1)\mathbb{Z}[\omega]\to\mathrm{End}(\mathbb{G}_1), ω↦ψ1\omega\mapsto\psi_1, factors through Z[ω]/(π)≅Fr\mathbb{Z}[\omega]/(\pi)\cong\mathbb{F}_r. Concretely, for z=∑idi(2−ω)i∈Z[ω]z=\sum_i d_i(2-\omega)^i\in\mathbb{Z}[\omega] and any A∈G1A\in\mathbb{G}_1,

∑i(2−ω)i ϕdi(A)  =  z⋅A  =  (z mod π)⋅A.(1)\sum_i (2-\omega)^i\,\phi_{d_i}(A) \;=\; z\cdot A \;=\; (z \bmod \pi)\cdot A . \tag{1}

Base-(2−ω)(2-\omega) expansions with digits in ΣCM\Sigma_{\mathrm{CM}}

Let β:=2−ω\beta:=2-\omega. Then N(β)=4+2+1=7\mathrm{N}(\beta)=4+2+1=7, and 1/β=βˉ/7=(3+ω)/71/\beta=\bar\beta/7=(3+\omega)/7, so

a+bωβ=(3a−b)+(a+2b)ω7.(2)\frac{a+b\omega}{\beta}=\frac{(3a-b)+(a+2b)\omega}{7}. \tag{2}

Lemma 1 (Residue system). ω≡2(modβ)\omega\equiv2\pmod{\beta}, the residue of a+bωa+b\omega modulo β\beta is determined by a+2b mod 7a+2b \bmod 7, and ΣCM\Sigma_{\mathrm{CM}} is a complete system of residues modulo β\beta:

dd 00 11 ω\omega −ω2-\omega^2 ω2\omega^2 −ω-\omega −1-1
a+2b mod 7a+2b \bmod 7 0 1 2 3 4 5 6

Proof. ω−2=−β\omega-2=-\beta. By (2), β∣a+bω\beta\mid a+b\omega iff 7∣a+2b7\mid a+2b, since 3a−b≡3(a+2b)(mod7)3a-b\equiv3(a+2b)\pmod 7. The table is direct: ω2=−1−ω\omega^2=-1-\omega has a+2b=−3≡4a+2b=-3\equiv4 and −ω2=1+ω-\omega^2=1+\omega has a+2b=3a+2b=3. □\square

Definition (Greedy expansion). For z∈Z[ω]z\in\mathbb{Z}[\omega] let digit(z)∈ΣCM\mathrm{digit}(z)\in\Sigma_{\mathrm{CM}} be the digit with the residue of zz (Lemma 1) and quot(z)=(z−digit(z))/β\mathrm{quot}(z)=(z-\mathrm{digit}(z))/\beta, computed by (2). Define expand(0)=[ ]\mathrm{expand}(0)=[\,] and expand(z)=digit(z)::expand(quot(z))\mathrm{expand}(z)=\mathrm{digit}(z)::\mathrm{expand}(\mathrm{quot}(z)) for z≠0z\neq0, and eval([d0,…,dL−1])=∑idiβi\mathrm{eval}([d_0,\dots,d_{L-1}])=\sum_i d_i\beta^i.

The definition is well founded because the norm strictly decreases, which is the content of the next lemma. Write B(x,d)B(x,d) for the symmetric bilinear form with N(x−d)=N(x)+N(d)−B(x,d)\mathrm{N}(x-d)=\mathrm{N}(x)+\mathrm{N}(d)-B(x,d), i.e. B(x,d)=2xada−xadb−xbda+2xbdbB(x,d)=2x_ad_a-x_ad_b-x_bd_a+2x_bd_b.

Lemma 2 (One step). Let z≠0z\neq0 and u≥0u\ge0 with N(z)<(u+1)2\mathrm{N}(z)<(u+1)^2. Then 7 N(quot(z))≤N(z)+2u+27\,\mathrm{N}(\mathrm{quot}(z))\le\mathrm{N}(z)+2u+2. In particular N(quot(z))<N(z)\mathrm{N}(\mathrm{quot}(z))<\mathrm{N}(z), and over the reals 7 N(quot(z))≤N(z)+1\sqrt{7\,\mathrm{N}(\mathrm{quot}(z))}\le\sqrt{\mathrm{N}(z)}+1.

Proof. z−d=β⋅quot(z)z-d=\beta\cdot\mathrm{quot}(z) with d=digit(z)d=\mathrm{digit}(z), so 7 N(quot(z))=N(z−d)7\,\mathrm{N}(\mathrm{quot}(z))=\mathrm{N}(z-d). If d=0d=0 this is N(z)\mathrm{N}(z). Otherwise dd is a unit, N(d)=1\mathrm{N}(d)=1, and B(z,d)2≤4 N(z) N(d)=4 N(z)B(z,d)^2\le4\,\mathrm{N}(z)\,\mathrm{N}(d)=4\,\mathrm{N}(z) by Cauchy–Schwarz; for the six units this is the integer inequality B(z,d)2≤4 N(z)B(z,d)^2\le4\,\mathrm{N}(z), each case being 0≤3b20\le3b^2, 0≤3a20\le3a^2 or 0≤3(a−b)20\le3(a-b)^2 after expansion. Then B(z,d)2≤4 N(z)<(2u+2)2B(z,d)^2\le4\,\mathrm{N}(z)<(2u+2)^2 forces B(z,d)>−(2u+2)B(z,d)>-(2u+2), so N(z−d)=N(z)+1−B(z,d)≤N(z)+2u+2\mathrm{N}(z-d)=\mathrm{N}(z)+1-B(z,d)\le\mathrm{N}(z)+2u+2. The real form is ∣z−d∣≤∣z∣+∣d∣|z-d|\le|z|+|d|. □\square

Theorem 3 (Expansion). For every z∈Z[ω]z\in\mathbb{Z}[\omega], eval(expand(z))=z\mathrm{eval}(\mathrm{expand}(z))=z and every digit lies in ΣCM\Sigma_{\mathrm{CM}}. If z≠0z\neq0 the expansion has at most ⌊log⁡7N(z)⌋+2\lfloor\log_7\mathrm{N}(z)\rfloor+2 digits.

Proof. Correctness is the identity z=digit(z)+β quot(z)z=\mathrm{digit}(z)+\beta\,\mathrm{quot}(z) unrolled along the (finite, by Lemma 2) recursion. For the length, put si=∣zi∣s_i=|z_i| where z0=zz_0=z and zi+1=quot(zi)z_{i+1}=\mathrm{quot}(z_i), and s∗=1/(7−1)s^*=1/(\sqrt7-1), the fixed point of s↦(s+1)/7s\mapsto(s+1)/\sqrt7. Lemma 2 gives si+1−s∗≤(si−s∗)/7s_{i+1}-s^*\le(s_i-s^*)/\sqrt7 while zi≠0z_i\neq0, hence si−s∗≤(s0−s∗)7−i/2s_i-s^*\le(s_0-s^*)7^{-i/2}. A nonzero Eisenstein integer has s≥1>s∗s\ge1>s^*, so zi=0z_i=0 as soon as (s0−s∗)7−i/2<1−s∗(s_0-s^*)7^{-i/2}<1-s^*, i.e. as soon as i>log⁡7N(z)+2log⁡71−s∗/s01−s∗i>\log_7\mathrm{N}(z)+2\log_7\frac{1-s^*/s_0}{1-s^*}. Since 2log⁡711−s∗<0.972\log_7\frac{1}{1-s^*}<0.97, the first such ii is at most ⌊log⁡7N(z)⌋+2\lfloor\log_7\mathrm{N}(z)\rfloor+2, and the number of digits is that ii. □\square

Exhaustive computation over the box ∣a∣,∣b∣≤120|a|,|b|\le120 finds the bound attained in every range 7t≤N<7t+17^t\le\mathrm{N}<7^{t+1}, t≤4t\le4.

Lemma 4 (Lifting Fr\mathbb{F}_r to Z[ω]\mathbb{Z}[\omega]). Fix π\pi with N(π)=r\mathrm{N}(\pi)=r. For k∈Zk\in\mathbb{Z} let q=(qa,qb)q=(q_a,q_b) with qa=⌊(2kπˉa+r)/2r⌋q_a=\lfloor(2k\bar\pi_a+r)/2r\rfloor and qb=⌊(2kπˉb+r)/2r⌋q_b=\lfloor(2k\bar\pi_b+r)/2r\rfloor (coordinatewise nearest integer to kπˉ/rk\bar\pi/r), and z=k−qπz=k-q\pi. Then z≡k(modπ)z\equiv k\pmod{\pi} and 4 N(z)≤3r4\,\mathrm{N}(z)\le3r.

Proof. zπˉ=kπˉ−q ππˉ=kπˉ−qrz\bar\pi=k\bar\pi-q\,\pi\bar\pi=k\bar\pi-qr, whose coordinates X=kπˉa−qarX=k\bar\pi_a-q_ar, Y=kπˉb−qbrY=k\bar\pi_b-q_br satisfy −r<2X≤r-r<2X\le r and −r<2Y≤r-r<2Y\le r by the choice of qq. Multiplicativity gives N(z) r=N(zπˉ)=X2−XY+Y2\mathrm{N}(z)\,r=\mathrm{N}(z\bar\pi)=X^2-XY+Y^2, and 4(X2−XY+Y2)≤3r24(X^2-XY+Y^2)\le3r^2 follows from 4X2≤r24X^2\le r^2, 4Y2≤r24Y^2\le r^2 and −4XY≤r2-4XY\le r^2 (sum of (r+2X)(r+2Y)≥0(r+2X)(r+2Y)\ge0 and (r−2X)(r−2Y)≥0(r-2X)(r-2Y)\ge0). □\square

Theorem 5 (BN254). Let rr be the BN254 scalar field order and

π=147946756881789319000765030803803410728+147946756881789319010696353538189108491 ω,\begin{aligned} \pi={}&147946756881789319000765030803803410728\\ &+147946756881789319010696353538189108491\,\omega, \end{aligned}

so that N(π)=r\mathrm{N}(\pi)=r. For every k∈Frk\in\mathbb{F}_r there is z≡k(modπ)z\equiv k\pmod{\pi} with 4 N(z)≤3r4\,\mathrm{N}(z)\le3r whose greedy base-β\beta expansion has digits in ΣCM\Sigma_{\mathrm{CM}}, evaluates to zz, and has length at most 9292.

Proof. Lemma 4 and Theorem 3: log⁡7(3r/4)<90.3\log_7(3r/4)<90.3, so at most ⌊90.3⌋+2=92\lfloor90.3\rfloor+2=92 digits. The machine-checked proof (Section 7) uses the integer form of Lemma 2 instead of the real recurrence and reaches the same 9292. □\square

Remark (Ninety-one). The coordinatewise rounding of Lemma 4 is not the nearest lattice point. The hexagonal lattice πZ[ω]\pi\mathbb{Z}[\omega] has covering radius r/3\sqrt{r/3}, so a true nearest-point lift gives 3 N(z)≤r3\,\mathrm{N}(z)\le r, and log⁡7(r/3)<89.9\log_7(r/3)<89.9 yields 9191. Sampling 20002000 random scalars, the greedy expansion of the rounded lift never exceeded 9191 digits, so 9292 is likely loose by exactly one. We did not formalise the nearest-point lift.

Remark (Digit sets are bounded by the endomorphism ring). The only cheap coefficients on a j=0j=0 curve are the units of Z[ω]\mathbb{Z}[\omega]: any other Eisenstein integer, e.g. 1−ω1-\omega of norm 33, costs a point addition and raises the degree of the encoding polynomials. So ΣCM\Sigma_{\mathrm{CM}}, with log⁡27≈2.81\log_2 7\approx2.81 bits per encoding, is the natural ceiling for G1\mathbb{G}_1. On G2\mathbb{G}_2 the untwisted Frobenius gives a cheap action of μ12\mu_{12}, but KFLT’s scheme needs the same coefficient vector on BB and CC, and C∈G1C\in\mathbb{G}_1, so this cannot be used without restructuring the disclosure; we leave it open.

The rekeying gadget with Eisenstein digits

Construction 6. ΠG\Pi_G is modified as follows; everything not mentioned is unchanged.

  • Garb. Sample k←Frk\leftarrow\mathbb{F}_r as before. Lift −k-k to z∈Z[ω]z\in\mathbb{Z}[\omega] by Lemma 4 and compute (d0,…,dL−1)=expand(z)(d_0,\dots,d_{L-1})=\mathrm{expand}(z), L≤92L\le92, padding with zero digits to a fixed length. Sample Mi←G1M_i\leftarrow\mathbb{G}_1 for i<Li<L and set R=∑iβiMiR=\sum_i\beta^iM_i, where βi\beta^i acts on G1\mathbb{G}_1 through ω↦ψ1\omega\mapsto\psi_1.
  • Enc. ⟦A⟧i=ϕdi(A)+Mi\llbracket A\rrbracket_i=\phi_{d_i}(A)+M_i for i<Li<L.
  • Eval. Q=∑iβi⟦A⟧iQ=\sum_i\beta^i\llbracket A\rrbracket_i, computed by Horner’s rule with β⋅X=2X−ψ1(X)\beta\cdot X=2X-\psi_1(X), one doubling and one free endomorphism per digit.

Proposition 7. Construction 6 is correct: Q=−kA+RQ=-kA+R. Its privacy is exactly that of KFLT Theorem 8, under DDH in G2\mathbb{G}_2 in the random-oracle model. The affine dimension of the AA-encoding is SA=12L+5≤1109S_A=12L+5\le1109 with the incomplete formulas of KFLT Theorem 3, or 18L+5≤166118L+5\le1661 with the complete formulas of KFLT Appendix A.2.

Proof. Correctness is (1): ∑iβi(ϕdi(A)+Mi)=z⋅A+R=(−k)A+R\sum_i\beta^i(\phi_{d_i}(A)+M_i)=z\cdot A+R=(-k)A+R because z≡−k(modπ)z\equiv-k\pmod{\pi}. For privacy, the only property of the AA-encodings used in the proof of KFLT Theorem 8 is that the ⟦A⟧i\llbracket A\rrbracket_i are independent uniform points (so they can be sampled first and RR defined as Q+kAQ+kA); this holds for any coefficients since the MiM_i are uniform, and the public combination ∑iβi\sum_i\beta^i is as good as ∑i2i\sum_i2^i there. The DDH hybrid and the relabelling of c⃗\vec c do not involve the AA-encodings. For the dimension, ϕd(V)\phi_d(V) is a coordinatewise scaling of (u,v)(u,v), so the polynomials of KFLT eq. (1) evaluated at ϕd(V)\phi_d(V) have the same monomials u2,u,vu^2,u,v; u2,uv,v2,vu^2,uv,v^2,v; uu, with the garbler’s private constants absorbed into the coefficients, and the Ishai–Wee dimension count is unchanged. □\square

Remark (Digit privacy). The digits did_i are part of the private encoding key, exactly as the bits bib_i were; the evaluator sees only ϕdi(A)+Mi\phi_{d_i}(A)+M_i, which is uniform. The expansion is computed once by the garbler, and expand\mathrm{expand} runs in O(L)O(L) integer operations.

Adaptive correctness

The gap

KFLT Definition 1 asks that for every fixed (x,y)(x,y), evaluation returns f(x,y)f(x,y) except with probability δ\delta over the randomness of Garb\mathrm{Garb}. This is the standard, non-adaptive notion. In the bridge application described in KFLT Section 1, the operator prepares the garbled verifier, holds ek\mathrm{ek}, and later publishes the proof; that is, the party who chooses x=(A,B,C)x=(A,B,C) knows every mask in ek\mathrm{ek} before choosing.

KFLT realise the group encoding cV+KcV+K from the coordinates of VV with the incomplete Jacobian formulas (their eq. (1)),

X=au2+a2u−2bv+2βE,Y=3abu2−3a2uv+bv2−(a3+4βE)v+3bβE,Z=u−a,(3)X=au^2+a^2u-2bv+2\beta_E,\qquad Y=3abu^2-3a^2uv+bv^2-(a^3+4\beta_E)v+3b\beta_E,\qquad Z=u-a, \tag{3}

for V=(u,v)V=(u,v), K=(a,b)K=(a,b), curve v2=u3+βEv^2=u^3+\beta_E, and note that they are incomplete when K=VK=V, returning (0,0,0)(0,0,0), “which occurs with probability 1/r1/r for a uniformly sampled mask”. That is true for an input fixed in advance. An operator who has drawn MiM_i and bi=1b_i=1 can choose A:=MiA:=M_i.

Proposition 8 (Steering). In KFLT’s Πbin\Pi_{\mathrm{bin}} as written, a garbler who chooses the evaluator’s input after garbling can produce an invalid proof on which honest evaluation returns ⊥\bot. The same holds for the entries of BB and CC: with ct≠0c_t\neq0, the input B:=ϕct−1(KtB)B:=\phi_{c_t}^{-1}(K^B_t) or C:=ϕct−1(KtC)C:=\phi_{c_t}^{-1}(K^C_t) makes the tt-th encoding evaluate to (0,0,0)(0,0,0), and EvalG\mathrm{Eval}_G returns ⊥\bot whenever any single index has no unique candidate.

Proof. Take A=MiA=M_i for some ii with bi=1b_i=1 and any B,CB,C making the proof invalid. The inner evaluation of ⟦A⟧i\llbracket A\rrbracket_i returns (0,0,0)(0,0,0) by (3), which is not a Jacobian representative of any point, and EvalF\mathrm{Eval}_F returns ⊥\bot at its step 2. (Were the evaluator to substitute an arbitrary point instead, QQ would be off by some Δ≠0\Delta\neq0, every YtY_t by e(Δ,Ut)≠0e(\Delta,U_t)\neq0, and no candidate Yt−dPY_t-dP would hash to hth_t except with probability κ2−τ\kappa 2^{-\tau}.) The proof itself is a legitimate triple of group elements, so the Lamport signatures on its bits are valid, and the garbling is honest, so cut-and-choose does not reject it. □\square

Whether the surrounding bridge protocol has an independent defence, such as a challenge path that forces the operator to open masks, is outside KFLT and outside this note; at the level of the garbling scheme and the definition it is proved against, the gap is real. KFLT’s Appendix A moves to complete formulas “to account for all input cases comprehensively”; we read this as the same concern, and note that if complete formulas are required then they are required in the main construction too, at 1818 rather than 1212 dimensions per encoding, i.e. Nbase=16,122N_{\mathrm{base}}=16{,}122 and roughly 3.23.2 MiB rather than 2.42.4. The repair below avoids that.

Characterising the exceptional outputs

Lemma 9 (Exceptional outputs of (3)). Let V=(u,v)V=(u,v) and K=(a,b)K=(a,b) both satisfy v2=u3+βEv^2=u^3+\beta_E, and let v≠0v\neq0. Then (3) returns (0,0,0)(0,0,0) if and only if K=VK=V; and it returns Z=0Z=0 with X≠0X\neq0 if and only if K=−VK=-V, in which case (X ⁣: ⁣Y ⁣: ⁣0)=(4v2 ⁣: ⁣−8v3 ⁣: ⁣0)(X\!:\!Y\!:\!0)=(4v^2\!:\!-8v^3\!:\!0) is a valid Jacobian representative of the identity.

Proof. Z=0Z=0 iff a=ua=u, and then b=±vb=\pm v from the curve equations. With a=ua=u, X=2u3+2βE−2bv=2v2−2bv=2v(v−b)X=2u^3+2\beta_E-2bv=2v^2-2bv=2v(v-b), which is 00 iff b=vb=v; if b=vb=v a direct substitution using v2=u3+βEv^2=u^3+\beta_E gives Y=v(v2−u3−βE)=0Y=v(v^2-u^3-\beta_E)=0. If b=−vb=-v then X=4v2≠0X=4v^2\neq0 and Y=−v(7u3+7βE+v2)=−8v3Y=-v(7u^3+7\beta_E+v^2)=-8v^3, and Y2=X3Y^2=X^3 places (X ⁣: ⁣Y ⁣: ⁣0)(X\!:\!Y\!:\!0) on the projective closure, where Z=0Z=0 is the identity. □\square

In G1\mathbb{G}_1 and E′(Fp2)E'(\mathbb{F}_{p^2}) every point has v≠0v\neq0, since the group orders rr and r(2p−r)r(2p-r) are odd and v=0v=0 would give 22-torsion. The randomised representative (μ2X,μ3Y,μZ)(\mu^2X,\mu^3Y,\mu Z) has the same zero pattern, and the constant representatives used for c=0c=0 and for K=OK=\mathcal{O} have Z≠0Z\neq0. Hence, applied to ϕc(V)\phi_c(V), the lemma says: the evaluator sees (0,0,0)(0,0,0) at an encoding exactly when c≠0c\neq0 and K=ϕc(V)K=\phi_c(V), and then the encoded point is 2ϕc(V)2\phi_c(V).

Repair

Construction 10 (Repaired evaluation). Let the inner evaluator, on obtaining (0,0,0)(0,0,0) for an encoding of VV, return the candidate set {2ϕc(V) ⁣:c∈ΣCM∖{0}}\{2\phi_c(V)\colon c\in\Sigma_{\mathrm{CM}}\setminus\{0\}\} instead of failing; for binary coefficients this is the single point 2V2V.

  • Entries of BB and CC. Index tt enters EvalG\mathrm{Eval}_G only through YtY_t and the subgroup test. Extend the candidate test at tt to range over the candidate set(s) for ⟦B⟧t\llbracket B\rrbracket_t, ⟦C⟧t\llbracket C\rrbracket_t and dtd_t: at most 6⋅6⋅76\cdot6\cdot7 hash evaluations at that index. A wrong candidate passes only by a hash collision, so the correctness error grows by at most 252κ 2−τ252\kappa\,2^{-\tau}.
  • Entries of AA. If mm indices return (0,0,0)(0,0,0) the evaluator has 6m6^m candidates for QQ (one, if AA uses binary digits), each testable against all hth_t at once. Since the MiM_i are the garbler’s own choice, mm is not bounded by chance. Derive them instead as Mi=HG1(seed,i)M_i=\mathsf{H}_{\mathbb{G}_1}(\mathrm{seed},i) from a seed that is opened in the cut-and-choose check of the malicious-security compiler. Then a second collision Mj∈{ϕc(A)}M_j\in\{\phi_c(A)\} for the same AA requires two of LL pseudorandom points in one orbit of size 66, probability about 6(L2)/r<2−2356\binom{L}{2}/r<2^{-235} per seed, negligible even against a grinding operator, so m≤1m\le1 and the enumeration has at most 66 elements.

Proposition 11. With Construction 10, KFLT’s scheme, with binary or Eisenstein digits on AA and binary or ΣCM\Sigma_{\mathrm{CM}} coefficients on B,CB,C, is correct against an adversary that chooses the evaluator’s input after seeing (f~,ek)(\tilde f,\mathrm{ek}), except with probability O(κ2−τ)+O(L2/r)O(\kappa 2^{-\tau})+O(L^2/r), at no increase in garbled program size.

Proof. By Lemma 9 every output of the inner evaluation is either a correct representative or (0,0,0)(0,0,0), and in the latter case the true encoded point is in the candidate set. The outer candidate test is complete because the correct candidate always passes, and sound up to hash collisions; the AA-side enumeration is bounded as computed. No garbled material changes; only evaluator work, by a constant factor. □\square

Remark (Privacy is unaffected). In the exceptional case the evaluator learns that the coefficient at that index is nonzero (and, for AA, which digit). This is reachable only by the garbler’s own steering, and the privacy game has an honest garbler, so the simulator of KFLT Theorem 8 is unchanged. In the bridge, an operator who steers a valid proof into the exceptional case leaks bits of its own secret; it has no incentive to.

Remark (Alternatives). Complete formulas on AA only cost 6L≤5526L\le552 dimensions; binary digits on AA with the deterministic repair cost nothing beyond KFLT’s SA=3053S_A=3053. The seed-derived masks are the cheapest option and need only that the malicious-security compiler already opens garbling randomness, which cut-and-choose does.

Cost accounting

The table stacks the changes. Variable cost is scaled linearly in NbaseN_{\mathrm{base}} from KFLT’s measured 16041604 KiB at 10,75810{,}758; the fixed 885885 KiB is untouched throughout. All rows assume 1212 dimensions per encoding with the repair of Section 5; with complete formulas the variable cost of every row, including KFLT’s, is 1.5×1.5\times larger and the ratios are essentially unchanged.

Step Status NbaseN_{\mathrm{base}} Total vs. KFLT
KFLT, binary digits measured[1:1] 10,758 2.44 MiB —
Eisenstein digits on AA (Section 4) proven, Section 7 8,814 2.16 MiB −12%
+ ΣCM\Sigma_{\mathrm{CM}} on B,CB,C, κ=46\kappa=46 KFLT App. A 3,894 1.44 MiB −41%
+ two-input Fp\mathbb{F}_p gadget (Conjecture 12) conjectured 2,780 1.27 MiB −48%
+ output-mask elimination suggested in Duty-Free Bits[4:2] 2,780 1.07 MiB −56%

Nbase=SA+4SB+SCN_{\mathrm{base}}=S_A+4S_B+S_C (or SA+2SB+SCS_A+2S_B+S_C under Conjecture 12); SA=12⋅92+5S_A=12\cdot92+5, SB=SC=12⋅46+5S_B=S_C=12\cdot46+5 from the second row on.

Conjecture 12 (Two-input affine maps in Duty-Free Bits). KFLT Lemma 12 projectivizes an SS-dimensional Fp2\mathbb{F}_{p^2}-affine encoding as two Fp\mathbb{F}_p instances of dimension 2S2S, an additive sharing that costs 4S4S base-field output dimensions. In Duty-Free Bits (Section 4.3 of that paper[4:3]), stage 1 converts each input to CRT residues at a cost independent of SS, while stage 2 pays one terminal output label per (CRT prime, output dimension), with multiplication by the garbler’s private coefficient being linear. If that reading is right, a native gadget for a⃗ x0+a⃗′ x1+b⃗\vec a\,x_0+\vec a'\,x_1+\vec b over Fp\mathbb{F}_p with two encoded inputs needs 2S2S output wires, not 4S4S, and the factor on SBS_B drops from 44 to 22. We have not verified this against the switch-system formalism of Duty-Free Bits Section 6.

Remark (What does not work: xx-only encodings). The fixed cost is eight bit-to-CRT conversions, one per coordinate block. Sending only uu and recovering vv up to sign would remove three blocks, and the symmetric functions of x(ϕcV+K)x(\phi_cV+K) and x(ϕcV−K)x(\phi_cV-K) are polynomial in uu with private coefficients, of Ishai–Wee dimension 99. But the evaluator then learns the unordered pair {x(ϕcV+K),x(ϕcV−K)}\{x(\phi_cV+K),x(\phi_cV-K)\}, and with VV public the second root identifies cc: for c∈{0,1}c\in\{0,1\} the two roots coincide iff c=0c=0. So xx-only encodings leak the coefficient and cannot be used.

After the table the fixed cost is 80%80\% of the program. Its floor is O(nλ)O(n\lambda) bits per block, about 44 KiB, against the 110110 KiB per block measured; closing that is engineering inside Duty-Free Bits rather than protocol design.

Formalisation

The BN254 statement (Theorem 5) is proved in Lean 4[7], version 4.34.1, in about 400400 lines with no dependency on Mathlib or any other library. The development defines Z[ω]\mathbb{Z}[\omega] as pairs of integers with the multiplication (a+bω)(c+dω)=(ac−bd)+(ad+bc−bd)ω(a+b\omega)(c+d\omega)=(ac-bd)+(ad+bc-bd)\omega, the norm, conjugate, base β\beta, the digit and quotient maps of Section 3, the greedy expansion by well-founded recursion on the norm, and the Horner evaluation. The main theorem is stated as

theorem bn254 (k : Int) :
    ∃ z : Eis, (∃ q : Eis, z = ofInt k - q * π) ∧
      (∀ d ∈ expand z, d ∈ digitSet) ∧ eval (expand z) = z ∧ (expand z).length ≤ 92

and #print axioms Eis.bn254 reports propext, Classical.choice, Quot.sound; there is no sorry and no native_decide.

Avoiding square roots in the kernel. Lemma 2 is formalised in the form 7 N(quot z)≤N(z)+2u+27\,\mathrm{N}(\mathrm{quot}\,z)\le\mathrm{N}(z)+2u+2 for any u≥0u\ge0 with N(z)<(u+1)2\mathrm{N}(z)<(u+1)^2, which needs no square-root function at all. The length argument is a general lemma: a list [(T0,u0),…,(TL,uL)][(T_0,u_0),\dots,(T_L,u_L)] is a valid threshold chain if TL=0T_L=0 and for each i<Li<L, Ti<(ui+1)2T_i<(u_i+1)^2 and ⌊(Ti+2ui+2)/7⌋≤Ti+1\lfloor(T_i+2u_i+2)/7\rfloor\le T_{i+1}; then every zz with N(z)≤T0\mathrm{N}(z)\le T_0 has an expansion of length at most LL. Validity of a concrete chain involves only natural-number multiplication, division and comparison, which the kernel evaluates directly, so the 9393-entry chain for BN254, with T0=⌊3r/4⌋T_0=\lfloor3r/4\rfloor and ui=⌊Ti⌋u_i=\lfloor\sqrt{T_i}\rfloor found offline, is checked by decide and depends on no axioms. Lean’s Nat.sqrt is defined by well-founded recursion and does not reduce under decide; the certificate sidesteps it.

Arithmetic. Cauchy–Schwarz for the six units, the norm identities and the expansions of products in Lemma 4 are polynomial identities discharged by grind; the remaining inequalities are linear in the monomials and discharged by omega after supplying square-nonnegativity facts. The rounding bounds in Lemma 4 are linear in kk and qq once rr is unfolded to a literal, and omega handles them directly.

What is not formalised. The identification Z[ω]/(π)≅Fr\mathbb{Z}[\omega]/(\pi)\cong\mathbb{F}_r and the action (1), which are standard and not specific to this work; the closed form ⌊log⁡7N⌋+2\lfloor\log_7\mathrm{N}\rfloor+2 of Theorem 3, which uses real arithmetic; Lemma 9, which needs field arithmetic over Fp\mathbb{F}_p and is the natural next target for a Mathlib development; and the nearest-point lift of the Ninety-one remark.

Conclusion

The rekeying gadget of KFLT was paying for a binary number system where the curve offers a base-77 one. Replacing it is a change of one line in the evaluator and of the garbler’s offline arithmetic; the accompanying bound is now a theorem checked by a kernel rather than an estimate, and the same technique of shipping a threshold certificate should transfer to any bound of the form “the norm shrinks by a factor at each step” that one wants to certify without real analysis. The adaptive-correctness gap is, we think, the more important of the two observations, since it separates the scheme’s definition from its application; the repair is cheap and we would expect it, or complete formulas, to be adopted before deployment.

Open: the nearest-point lift and the 9191-digit bound; a Mathlib formalisation of Lemma 9 and of adaptive correctness itself; Conjecture 12; using μ12\mu_{12} on G2\mathbb{G}_2; and, dominating everything after these, the fixed cost of bit-to-CRT conversion.

Provenance

This note was produced by the model named in the submission’s provenance record, in an interactive session with a human collaborator who posed the problem, chose the direction at each stage (improving the native-group design, machine-checking the bound, and this write-up), reviewed the results and chose not to be credited. The Lean artifact is the only part of the argument that has been checked by something other than the model; everything else should be read with that in mind.

References

  1. N. Khambhati, A. Feickert, C. Lewe, M. Tiwari. Garbling Groth16 with native group operations. Cryptology ePrint Archive, Paper 2026/2100. ↩︎ ↩︎

  2. L. Eagen, Y. T. Lai. Argo MAC: Garbling with elliptic curve MACs. Cryptology ePrint Archive, Paper 2026/049. ↩︎

  3. S. Garg, D. Kolonelos, M. Sergeevitch, S. Sridhar, D. Tse. BABE: Verifying proofs on Bitcoin made 1000x cheaper. Cryptology ePrint Archive, Paper 2026/065. ↩︎

  4. N. Khambhati, A. Bhattacharya, D. Heath. Duty-free bits: Projectivizing garbling schemes. Cryptology ePrint Archive, Paper 2026/476. ↩︎ ↩︎ ↩︎ ↩︎

  5. Y. Ishai, H. Wee. Partial garbling schemes and their applications. ICALP 2014. ↩︎

  6. J. Renes, C. Costello, L. Batina. Complete addition formulas for prime order elliptic curves. EUROCRYPT 2016. ↩︎

  7. L. de Moura, S. Ullrich. The Lean 4 theorem prover and programming language. CADE 2021. ↩︎