Repository navigation
Conversation
At an addition, B's line is multiplied by xQ - x, which gives the line
through T and Q without the slope:
l'_B = (xQ - x) yP - (yQ - y) xP w + (x yQ - y xQ) w^3
If xQ = x, the slope relation forces yQ = y, so this line is 0, and so
is every later Miller value, which the residue check rejects. The
factor is in F_p2, whose elements are r-th powers in F_p12, so the
pairing check is unchanged; the prover computes the residue witness for
these Miller values (pairing.miller_values).
This replaces the inverse d that proved xQ != x: 23 F_p2 words of
witness and 23 relations go. The additions' relations grow by 6 in
degree, and the best cap is now 217: 35 Miller values, Q of 208 words.
Regtest spend: 90.8 kWU -> 89.4 kWU; cost 68.5 M -> 67.6 M mWU.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NoarL2X1Qo8VzWHN5PPpDw
Collaborator
Author
|
Superseded by #5: no addition of the loop can meet T = Q, so the inverses are not needed at all, and neither is the two-point line. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2 (sparse commitments).
Summary
An addition step used to prove xQ ≠ x with an inverse d from the prover: one F_p2 word pair and one relation per addition. This PR drops d. At an addition, B's line is taken through the two points, which is B's line multiplied by xQ − x. If xQ = x, that line is 0, so the residue check fails on its own.
How it works
At an addition T + Q, B's line is
yP + c3 xP w + c4 w³with c3 = −λ and c4 = λx − y. Multiply it by Δ = xQ − x and replace λΔ by yQ − y, which the slope relation guarantees:This is the line through T and Q. It doesn't use the slope.
Soundness. The slope relation λ(xQ − x) = yQ − y has one solution when xQ ≠ x. If xQ = x, the relation forces yQ = y. Then l'_B = 0·yP − 0 + (x·y − y·x) w³ = 0, so f' = 0. Every later Miller value is then 0 too: committed values have to equal the products. The last relation, f·π(c⁻¹)π²(c)π³(c⁻¹) = T_s, fails because T_s ≠ 0. So an accepted slope is still the true slope, and every step is still the group law.
Completeness. The Miller value now carries a factor Δ ∈ F_p2 at each addition. Elements of F_p2* are r-th powers in F_p12* (p² − 1 divides (p¹² − 1)/r), so the factor doesn't change whether f·e(α, β) is an r-th power. That is exactly the condition the residue witness proves. The prover computes c and s for the scaled Miller value (
pairing.miller_values).What it costs. l'_B has degree 27 instead of 21, so each addition's relation grows by 6. The schedule now uses a degree cap of 217: 35 Miller values and a 206-word Q, padded to 208 so the eight-word chunks of
QCHUNKstill fit. Each addition step also becomes cheaper, since it drops the evaluation of d and one relation.Net effect: 23 relations fewer, 46 witness words fewer, 8 Q words more. Soundness is the same kind of bound: (127 + 219)/p per hash query.
Changes
groth/pairing.py:relations: the two-point line at additions; the inverse relation is gone.miller_values: the prover's Miller values with the scaled lines, used for the residue witness.DEG_CAP = 217; Q is padded to a multiple of 8.test_pairing.py: the "wrong inverse" case is gone.test_g2_check.py: builds its constant frommiller_values.examples/multiplier/are updated. The example files come from a new regtest spend.Testing
hand's.tools/regtest.sh:116e0f79…: 89,403 WU;Assertion failed inside jet);71b20492…(the example files);c17731ad….🤖 Generated with Claude Code