Skip to content

refactor(zkvm,gkr): dedup ECC proof preparation and simplify main-eval wiring#1301

Open
hero78119 wants to merge 1 commit intofeat/wiring_eccfrom
feat/cleanup
Open

refactor(zkvm,gkr): dedup ECC proof preparation and simplify main-eval wiring#1301
hero78119 wants to merge 1 commit intofeat/wiring_eccfrom
feat/cleanup

Conversation

@hero78119
Copy link
Copy Markdown
Collaborator

@hero78119 hero78119 commented Apr 10, 2026

Refactor proof wiring to remove duplicated ECC preparation logic and simplify main-eval handling.
This change centralizes shared helper logic in scheme/utils, unifies ECC prover inputs across CPU/GPU, and streamlines proof assembly order.
We also removes n_instance from GKR main-eval wiring so main evaluations consistently use witin + fixed + structural_witin.

change highlight

  • dedup: move shared helpers (extract_ecc_quark_witness_inputs, derive_ecc_bridge_claims, split_rotation_evals, assign_group_evals) into common utils
  • api cleanup: EccQuarkProver::prove_ec_sum_quark now takes (cs, input) and returns Option<EccQuarkProof> (no ECC path -> None)
  • prover flow cleanup: ECC witness extraction/prep removed from call sites; ECC proving triggered via unified API
  • ordering update: tower-related checks/wiring happen before ECC bridge usage; verifier side aligns with this order
  • gkr simplification: remove n_instance from layer/main-eval accounting and related offsets/assertions
  • net effect: less duplicated code, clearer ownership of ECC bridge data, and simpler main witness/eval wiring

summary of proving flow (simplified ascii)

build_main_witness
-> generate_tower_witness
-> prove_tower_relation
-> prove_ecc_quark (optional, if ecc ops exist)
-> prove_rotation (optional)
-> prove_main_constraints (inject rotation/ecc bridge evals when present)
-> open_pcs
-> assemble_chip_proof

@hero78119 hero78119 requested a review from kunxian-xia April 10, 2026 09:46
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.

1 participant