Skip to content

Conversation

hero78119
Copy link
Collaborator

This features is preliminary support to batched all opcode/table in one mpcs proof #894

Previously we got few issues

  1. num_instance are specify in each opcode proof
  2. rw_hint_var are specify in each table proof

while both are describe the same thing in different place, which make thing hard to control and make room for malicious prover to crack based on inconsistency.

In this PR, we unify num_instance in one central place, and do a strictly check of it's consistency.
This also addressed feature in #648

@hero78119 hero78119 changed the title unify non-uniform witness in proof unify non-uniform witness in proof and improve soundness check Apr 9, 2025
pub raw_pi: Vec<Vec<E::BaseField>>,
// the evaluation of raw_pi.
pub pi_evals: Vec<E>,
opcode_proofs: BTreeMap<String, (usize, ZKVMOpcodeProof<E, PCS>)>,
Copy link
Collaborator Author

@hero78119 hero78119 Apr 9, 2025

Choose a reason for hiding this comment

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

here we have

  • String: circuit name
  • usize: circuit index

to carry information in proof. However a malicious prover can make both inconsistent.

The new fixed avoid duplicated information appear in different place

@hero78119 hero78119 force-pushed the feat/centralize_num_vars branch from e41a67c to 1025644 Compare April 9, 2025 10:29
})
.collect_vec();

// (non uniform) collect dynamic address hints as witness for verifier
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Move this information from table proof to centralized place, and aligned with opcode proof with same terminology: num_instance

@hero78119 hero78119 force-pushed the feat/centralize_num_vars branch from 1025644 to 005efdc Compare April 9, 2025 10:32
@hero78119 hero78119 changed the title unify non-uniform witness in proof and improve soundness check control num_instances in one place to improve soundness check Apr 9, 2025
let mpcs_opcode_commitment = self
.opcode_proofs
.iter()
.map(|(circuit_name, (_, proof))| {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These change make less readibility since now we lost circuit_name and instead only circuit index. But it's ok we fix it later, for now mpcs still be the major bottleneck of proof size

@hero78119 hero78119 mentioned this pull request Apr 12, 2025
2 tasks
github-merge-queue bot pushed a commit that referenced this pull request Apr 17, 2025
Build on top of #901.

### Design rationale
zkvm + mpcs api: use `batch_commit/batch_opening` to commit/open **ALL**
opcode together. In more detail, we commit `fixed_commit` and
`witin_commit` separately with just one opening.
basefold: batch opcodes with rmm with different "height", in other
words, different "num_vars".

For basefold to batch opcodes with different variables, for sumcheck
part we apply suffix alignment techniques based on
#870. For FRI part, we also apply suffix alignment techniques. So the
smaller codeword will "involved" into the folding process when current
length match.

During implementation, there is key principle in mind: verifier only
rely on one untrusted information "num_instances" from prover, and other
information should derived from verifier key.

### Working items
- [x] mpcs batch api + batch basefold prover
- [x] batch basefold verifier

### Fibonacci Benchmark Results

| Size | Branch | Proof Size | E2E Latency Change | Prover Speed (kHz) |

|----------|----------------------|------------|--------------------|---------------------|
| 2²⁰ | Master | 14.68 MB | - | 363 |
| 2²⁰ | Batched + conjecture | 1.16 MB | -14.195% | 422 |
| 2²⁰ | Batched | 2.02 MB | -11.599% | 411 |
| 2²¹ | Master | 15.53 MB | - | 411 |
| 2²¹ | Batched + conjecture | 1.24 MB | -11.178% | 451 |
| 2²¹ | Batched | 2.16 MB | -6.4525% | 428 |
| 2²² | Master | 16.42 MB | - | 406 |
| 2²² | Batched + conjecture | 1.31 MB | -11.178% | 433 |
| 2²² | Batched | 2.31 MB | -13.691% | 448 |
@hero78119
Copy link
Collaborator Author

covered via #894

@hero78119 hero78119 closed this Apr 17, 2025
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