ecc: constrain incomplete-mul base to the actual base point#2
Merged
Conversation
The variable-base scalar-multiplication gadget assigned the base point's coordinates into the incomplete-addition loop with `assign_advice`, which introduces an unconstrained witness. The `q_mul_2` gate only forces the per-row `x_p`/`y_p` values to equal each other, never to equal the actual `base`. A malicious prover could therefore set the loop's base to any point P and compute [scalar]·P instead of [scalar]·base, breaking the soundness of variable-base scalar mul (e.g. the `pk_d == [ivk] g_d` recipient-integrity check, enabling note-ownership forgery / multiple nullifiers per note). Copy the base coordinates in on the first row so they are constrained to the real base; the existing `q_mul_2` equality gate propagates the binding across the remaining rows.
zeapoz
reviewed
Jun 10, 2026
zeapoz
left a comment
Collaborator
There was a problem hiding this comment.
Change looks good to me, but let's fix the CI checks too
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.
Addresses the Orchard Security Bug:
https://drive.google.com/file/d/1SVK41y-ip3Vw9eB69E9QRy-Qn3idTOwV/view