Skip to content

Moonlight point pair no identity flag - #17

Open
Michael-EY wants to merge 12 commits into
mainfrom
moonlight-point-pair-no-identity-flag
Open

Michael-EY wants to merge 12 commits into
mainfrom
moonlight-point-pair-no-identity-flag

Conversation

@Michael-EY

Copy link
Copy Markdown

Overview

Moonlight's wrap circuit (EYBlockchain/Moonlight#91) now constrains both accumulator points to be non-identity and no longer exposes their is_id flags (wrap instances 21 → 19). This updates the Solidity verifier to match:

  • AccumulatorEncoding::point_pair is now 8 words (lhs.x, lhs.y, rhs.x, rhs.y) with no identity flags; the generated decoder always decodes both points and rejects (0,0).
  • SolidityGenerator::try_new rejects point-pair layouts with extra words (e.g. the old 10-word layout) with a typed error instead of panicking at render.
  • IVC (AccumulatorEncoding::new) and no-accumulator verifiers render byte-identical to main.
  • Adds unit and EVM tests; updates the spec, docs and CHANGELOG; marks the Sepolia moonlight-wrap deployment as historical.

Michael Livesey and others added 4 commits October 28, 2026 11:47
…ty flags

Moonlight's WrapCircuit now constrains both points of its fully collapsed
(lhs, rhs) accumulator to be non-identity and exposes only their x and y
coordinates, dropping the trailing is_id word from each point.

AccumulatorEncoding::point_pair now matches that layout: each point is
2 * coord_words public-input words, POINT_PAIR_PUBLIC_INPUT_WORDS is 8,
and the generated verifier always decodes both coordinates and rejects a
point that decodes to the EIP-2537 identity encoding (0, 0).

The point-and-scalar (IVC) layout keeps its identity-flag decoding, and
its rendered Solidity, like that of verifiers without an accumulator, is
byte-identical to before.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prove Moonlight-style point-pair public inputs with a circuit that binds
arbitrary instance words, and check that the rendered verifier accepts a
valid non-identity accumulator, rejects a swapped pair, and rejects identity
points encoded as zero coordinates. The identity pair satisfies the
accumulator pairing, so its rejection comes from the decoder itself.

Rename IdentityAccumulatorCircuit to PublicWordsCircuit now that it is used
for non-identity accumulators as well.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The moonlight-wrap contracts were deployed once, on 2026-05-19, from a
synthetic wrap benchmark with a seeded test SRS, and have not been
redeployed since. Note that they no longer match current generator output
or Moonlight wrap proofs, and that the files are an exact record of what is
on-chain.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SolidityGenerator::try_new only checked that the accumulator payload fit in
num_instances. A point-pair encoding with trailing words, such as the old
flagged 10-word Moonlight layout, was accepted and then panicked during
rendering where lowering expects the tail check to have passed.

Run fixed_scalar_count in try_new so those layouts return a typed
UnsupportedAccumulatorEncoding error up front, and test the 18/19/21-word
boundary at Moonlight's offset of 11.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Michael-EY Michael-EY self-assigned this Oct 28, 2026

@jtcoolen jtcoolen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few inline comments: one on the Moonlight branch that the demo docs and run_team_demo.sh still pin, plus some nits, mostly about comment accuracy in the new point-pair branch of AccumulatorHelpers.yul.

Comment thread proofs/solidity-verifier/docs/reference/TEAM_DEMO_SETUP.md
Comment thread proofs/solidity-verifier/templates/partials/verifier/AccumulatorHelpers.yul Outdated
Comment thread proofs/solidity-verifier/templates/partials/verifier/AccumulatorHelpers.yul Outdated
Comment thread proofs/solidity-verifier/src/lowering/render/models.rs
Comment thread proofs/solidity-verifier/src/test.rs
Comment thread proofs/solidity-verifier/src/test.rs Outdated
Comment thread proofs/solidity-verifier/src/builder/api.rs Outdated
Michael Livesey and others added 8 commits October 28, 2026 18:10
The team demo's default Moonlight branch, codex/wrap-bench-cherry-picks,
predates #15 (dedicated foreign-point identity-flag
words) and EYBlockchain/Moonlight#91 (flagless, non-identity wrap
accumulator), so its wrap bench no longer runs against current Midfall.

Note this in TEAM_DEMO_SETUP.md and in run_team_demo.sh, and point users
at --skip-moonlight until the branch is rebased onto Moonlight master.
Updating the pin is deferred to a follow-up.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… identity flags

Make the accumulator layout comments match the branch they render in: point
pairs have no LHS/RHS scalar words or fixed-base tail, and the
point-and-scalar layout always has an explicit LHS scalar. Comment-only; the
compiled IVC and point-pair verifier bytecode is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… identity flags

Gate the G1MSM validation rationale on expected_acc_non_identity_points.
For point pairs an identity point already fails load_acc_point and the
scalar is always one, so the identity and zero-scalar wording only applies
to the flagged layout. Comment-only: IVC renders are unchanged and the
point-pair verifier bytecode is identical.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… identity flags

Render rhs_scalar_ptr and its comment only for the flagged layout. Point
pairs have no RHS scalar or fixed-base tail, so the pointer was never read
in their renders. IVC renders are unchanged and the point-pair verifier
bytecode is identical.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… identity flags

Gate rhs_scalar_ptr on expected_acc_has_carried_scalars, which matches where
it is read and removes the last negated expected_acc_non_identity_points
gate. Document that both template flags are derived from
AccumulatorEncodingKind, so only two combinations are reachable, and that
the template relies on this. All renders are unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename the PublicWordsCircuit region from "identity accumulator words" to
"public words", which the circuit rename missed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Check that the native verifier consumes the whole proof between prepare and
verify, matching identity_accumulator_proof_verifies_on_evm.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
For point-and-scalar accumulators, try_new accepted any fixed-base scalar
tail length, but lowering maps a non-empty tail onto -G and every fixed and
permutation commitment of the verified VK. A tail no longer than the
permutation count panicked during rendering, other short tails mapped
scalars onto a prefix of the fixed commitments, and long tails read base
pointers past the fixed-commitment region, rendering a verifier that checked
the accumulator against the wrong bases.

fixed_bases(vk) always holds exactly 1 + #fixed + #permutation entries, so
require a non-empty tail to have that length and return
UnsupportedAccumulatorEncoding otherwise. Valid configurations, including
the fully collapsed IVC accumulator, are unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants