Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki: Uniform Spartan + R1CS Info #432

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Wiki: Uniform Spartan + R1CS Info #432

wants to merge 1 commit into from

Conversation

sragss
Copy link
Collaborator

@sragss sragss commented Jul 26, 2024

Fills in missing details on our instantiation of Spartan.

Left the Cross-Eq constraints and Verifier MLE evals empty for now as we work on #347.

@sragss sragss requested a review from moodlezoup July 26, 2024 15:48
Comment on lines +62 to +64
Notice that the matrix follows a sparse-diagonal pattern. We can use this to define $A_{small}$.

![Small A](../imgs/small_A_r1cs.png)
Copy link
Collaborator

Choose a reason for hiding this comment

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

imo it's more intuitive to introduce A_small first, as it clearly captures the uniform constraints Q = R and R = S

## Uniform Spartan
Jolt's Spartan instance is highly patterned. We run the same R1CS for each cycle of the RISC-V program. We can leverage this property to increase prover and verifier efficiency.

Think of a simple constraint system with the following inputs: $Q, R, S$. Each of these inputs is repeated $nc = num\_cycles$ times.
Copy link
Collaborator

Choose a reason for hiding this comment

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

num_cycles formatting is messed up


Note that Z is also padded to a power of two, so the full Z vector is $[Q_0, Q_1, Q_2, 0, R_0, R_1, R_2, 0, S_0, S_1, S_2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]$

$v_0$ indexes constant vs non-constant columns.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move this into the bullet point - $v_0, v_1, v_2$ index the variable

Comment on lines +41 to +42
> [!NOTE]
> Syntax: For bitvector $x=x_0, x_1, ... x_n$, $x_0$ represents the most-significant bit, and $x_n$ represents the least significant bit. By default sumchecks will bind from the "top", where they bind the MSB first. For some sumchecks, notably sparse ones we'll bind from the "bottom" for algorithmic efficiency reasons.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm hoping to switch all sumchecks to bind from the bottom so this note may soon become out-of-date

$v_0$ indexes constant vs non-constant columns.

The $A, B, C$ matrices follow a similar pattern where the constraints are repeated $nc$ times and the variables are repeated $nc$ times. For example, given a 2 constraint system over the variables $Q, R, S$.
![Big A](../imgs/big_A_r1cs.png)
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add a legend for what the different colors mean. assuming yellow = padding, then the four columns before C should also be yellow, right?

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