Skip to content

Commit 30fa844

Browse files
committed
Add more instructions on AIR constraints, rename rules
1 parent 882fc0d commit 30fa844

File tree

3 files changed

+62
-4
lines changed

3 files changed

+62
-4
lines changed

.cursor/rules/air-pv.mdc

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
Following the structure of [pcs-shots.mdc](mdc:.cursor/rules/pcs-shots.mdc),
7+
the Prover and Verifier for AIR constraints consist of the following steps.
8+
We present each step marked with P or V depending on whether Prover or Verifier performs the step.
9+
In terms of interaction with the challenger,
10+
steps with the same numbers correpond to the dual steps between Prover and Verifier
11+
(e.g. if a step 3P correponds to `pcs.open`, then 3V will correspond to `pcs.verify`),
12+
steps without a P or V correpond to both Prover and Verifier doing the same thing.
13+
14+
1: Compute `trace_domain` and `quotient_domain`.
15+
16+
2P: Commit to given `trace`.
17+
18+
3: Include the trace commitment, public values and logarithm of trace degree in transcript.
19+
20+
4P. Evaluate the trace on quotient domain.
21+
22+
5. Sample challenge `alpha` from transcript.
23+
24+
6P. Compute the values of quotient on all of quotient domain (using parallel SIMD-enabled loop), using AIR constraints as `Q(X) = C(X) / Z_{quotient_domain}(X)` (where `C(X)` is the folded constraints).
25+
26+
7P. Split the quotient polynomial into chunks, commit to the chunks.
27+
28+
8. Include the commitment to quotient chunks in the transcript.
29+
30+
9. Sample challenge `zeta` and compute `zeta_next`.
31+
32+
10P. Open the trace at points `zeta` and `zeta_next`, and quotient chunks at `zeta`.
33+
34+
10V. Verify the openings from step 10P.
35+
36+
11V. Reconstruct the value of quotient at `zeta` from the opening values.
37+
38+
12V. Compute the value of folded constraints polynomial at `zeta` using the opened values.
39+
40+
13V. Ensure that quotient value computed from folded constraints matches the one reconstructed from chunks.
41+
42+
43+
File renamed without changes.

.cursor/rules/pcs-shots.mdc renamed to .cursor/rules/pv-sync.mdc

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
description:
33
globs:
4+
alwaysApply: false
45
---
5-
66
## Synchronizing Prover and Verifier
77

88
The `Challenger` interface we use here is the same is the same for both Prover and Verifier
@@ -21,12 +21,27 @@ The values Prover adds to Challenger transcript (with "observe" methods) must be
2121
it's the job of proof produced by the Prover to make sure of that;
2222
one straightforward way to ensure that is to directly include
2323
such observed values in the proof.
24-
When Prover is calling a functon that modifies the Challenger transcript, Verifier must call its dual of that function. For example, `verify` is Verifier's dual of Prover's `open` (when called with corresponding values); any "observe" or "sample" function is dual to itself.
24+
When Prover is calling a functon that modifies the Challenger transcript, Verifier must call its dual of that function.
25+
For example, `pcs.verify` is Verifier's dual of Prover's `pcs.open`
26+
(assuming the verifier is passing to `pcs.verify` the opening proof and values
27+
that Prover got from the `pcs.open` call);
28+
any "observe" or "sample" function is dual to itself.
29+
30+
As a rule, all values Prover opens through `pcs.open` must be included
31+
in the proof (together with the opening proofs) to ensure that
32+
Verifier can make the corresponding `pcs.verify` call.
2533

26-
A Prover and Verifier that are in sync and handle Challenger transcript correctly may be used by another Prover' and Verifier' if Prover' calls prover at a stage that corresponds to Verifier' calling Verifier. This way, Prover-Verifier pairs may be re-used as subroutines by other Provers and Verifiers if the calls are in sync.
34+
A Prover and Verifier that are in sync and handle Challenger transcript correctly
35+
may be used by another Prover' and Verifier' if Prover' calls Prover at a stage that corresponds to Verifier' calling Verifier.
36+
This way, Prover-Verifier pairs may be re-used
37+
as subroutines by other Provers and Verifiers if the calls are in sync.
2738
This way, Verifier is dual of its Prover,
2839
and another Prover' calling Prover requires Verifier' calling Verifier.
29-
(The functions like `commit` or `get_evaluations_on_domain`, for example, on the other hand, don't require Verifier to do anything special because the functions touch the Challenger.)
40+
(The functions like `pcs.commit` or `pcs.get_evaluations_on_domain`, for example,
41+
on the other hand,
42+
don't require Verifier to do anything special
43+
because the functions touch the Challenger.
44+
)
3045

3146
Following the rules above,
3247
the code of Prover and Verifier must be written side by side,

0 commit comments

Comments
 (0)