Muskan Kumari
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # PLonk Arithmetization So far, we have explored the structure of STARKs, which had broken down into three key parts: * **Trace Generation**: In the first part, we generated the trace, constructed the trace polynomial using Lagrange interpolation, and commit to that polynomial. * **Applying Constraints**: The second part involves applying constraints to the trace polynomial, ensuring it satisfies the desired properties. * **Commitment**: Finally, in the third part, we commit to all the FRI layers derived during the process. From this structure, we can deduce the central components required to build a proof system: the trace and its corresponding constraints. Once these are defined, we can proceed with the commitments. In this blog, we will delve into PLONK arithmetization, exploring how constraints can be structured within tables. ## PAIRs - AIRs with preprocessed columns In the preprocessed AIR, we introduce t additional parameter as a predefined column $c_1, \ldots, c_t \in F^n.$ Now, our trace contains t predefined columns in addition to w witness column supplied by the prover. These t predefined columns refer to selectors, and are introduced to construct some non-uniform constraints. Let’s consider an example where we use a selector column, where t=2 and w=2 t={s1,s2} and w={a,b}. **PAIR for addition and multiplication.** Let’s construct a **PAIR** where we perform an addition on some rows, and a multiplication on other rows. For this purpose, we define the “addition selector” $s_1$, and the “multiplication selector” $s_2$. The constraint polynomial is: $$ f(X_1, X_2, X_1^{\text{next}}, X_2^{\text{next}}) = s_1 \cdot \left(A^{\text{next}} - (A + B)\right) + s_2 \cdot \left(A^{\text{next}} - A \cdot B\right). $$ Let’s check the constraint on row $i = 1$, where only the addition operation is enabled: $$ f(X_1, X_2, X_1^{\text{next}}, X_2^{\text{next}}) = 1 \cdot (1 - (0 + 1)) + 0 \cdot (1 - (0 \cdot 1)) = 0; $$ and row $i = 3$, where both operations are enabled: $$ f(X_1, X_2, X_1^{\text{next}}, X_2^{\text{next}}) = 1 \cdot (4 - (2 + 2)) + 1 \cdot (4 - (2 \cdot 2)) = 0. $$ \ \begin{array}{|c|c|c|c|c|} \hline \text{step} & s_1 & s_2 & a & b \\ \hline i = 1 & 1 & 0 & 0 & 1 \\ i = 2 & 0 & 1 & 1 & 2 \\ i = 3 & 1 & 1 & 2 & 2 \\ i = 4 & 0 & 1 & 4 & 0 \\ \hline \end{array} --- ## Randomized AIR with Preprocessing (RAP) This model allows for a round of interaction with the verifier. The verifier sends randomness. In a later round, randomness from the earlier rounds can be used as variables in constraints. This enables local constraints( between the adjacent rows) to check global properties (over all the rows). This AIR will be used to check the multiset equality between two sets. Let’s illustrate an example of RAP. Suppose we have a width-2 AIR and want to check that the columns provided by the prover are permutations of each other. Assume that the values of one column are {a1,...,an} and values of other column are {b1,....,bn} From the Schwartz-Zippel Lemma, we know that to check they are a permutation of each other, it suffices to check that for a uniformly chosen $\gamma \in F$, we have with high probability: $$ \prod_{i \in [n]} (a_i + \gamma) = \prod_{i \in [n]} (b_i + \gamma). $$ With high probability over $\gamma$, the factors of the RHS are all non-zero, and in that case, this is equivalent to: $$ \prod_{i \in [n]} \frac{(a_i + \gamma)}{(b_i + \gamma)} = 1. $$ A RAP of length $n+1$ and total width 3 can be formed like this: 1. The prover first sends the columns $(a_1, \ldots, a_n, 0)$ and $(b_1, \ldots, b_n, 0)$. 2. The verifier sends random $\gamma \in F$. 3. The prover uses the verifier challenges gamma to construct the running product $\vec{Z}$ (1,z1,..,zn) such that for each $i \in [n]$: $$ z_i = \prod_{1 \leq j \leq i} \frac{(a_j + \gamma)}{(b_j + \gamma)}. $$ To check the correctness of RAP: Let us consider an example where $b$ simply contains a shift of the elements in $a$. To check that $z$ (vector) was correctly constructed as a running product, we introduce column $z$ to the execution trace. $$ z_i = \prod_{1 \leq j \leq i} \frac{(a_j + \gamma)}{(b_j + \gamma)} \quad \forall i \in [n] $$ $$ \begin{array}{|c|c|c|c|} \hline \text{step} & a & b & z \\ \hline i = 1 & a_1 & a_2 & 1 \\ i = 2 & a_2 & a_3 & \frac{(a_1 + \gamma)}{(a_2 + \gamma)} \\ i = 3 & a_3 & a_1 & \frac{(a_1 + \gamma)(a_2 + \gamma)}{(a_2 + \gamma)(a_3 + \gamma)} \\ i = 4 & a_1 & a_2 & \frac{(a_1 + \gamma)(a_2 + \gamma)(a_3 + \gamma)}{(a_2 + \gamma)(a_3 + \gamma)(a_1 + \gamma)} \\ \hline \end{array} $$ To check the correctness of the $z$-vector, we can check the following constraints on column $z$: 1. Boundary constraint that the third column starts with one. 2. At each step, we check the constraint: $$ Z^{\text{next}} \cdot (B + \gamma) - Z \cdot (A + \gamma) = 0. $$ As an example, applying this on the row $i = 2$ checks: $$ \frac{(a_1 + \gamma)(a_2 + \gamma)}{(a_2 + \gamma)(a_3 + \gamma)} \cdot (a_3 + \gamma) - \frac{(a_1 + \gamma)}{(a_2 + \gamma)} \cdot (a_2 + \gamma) = 0. $$ 3. At the final row $i = n$: $$ z_n = \prod_{i \in [n]} \frac{(a_i + \gamma)}{(b_i + \gamma)} = 1. $$ The second constraint enforces that the $z$ is accumulating the products of $a$ and $b$ as expected. --- ## Arguments For proving the brainfuck ISA, we use two related but distinct arguments known as permutation and evaluation arguments. ### Permutation Argument To check that two tables contain the same set of values, possibly in a different order, we use the permutation argument. This technique is similar to the RAP, but instead of proving multiset equality on a single column, we prove it on multiple columns. We can assume that the prover has access to random scalars $a,b,c,..$supplied by the verifier. The prover can use these scalars to compress multiple columns to one, by taking a weighted vectorial sum. This construction of taking weighted sum allows us to reduce a claim about the identical sets of rows of two tables, to an equivalent but easier-to-prove a claim about the identical sets of two rows. For example- if a table has 3 columns as $x,y,z$ then the verifier passes the challenges as $a,b,c$ and the prover will take the vectorial sum of all 3 columns as $ax+by+cz$ to reduce the permutation claim on the 3 column to one column of the weighted vectorial sum The verifier uses the same scalars to compute the same weighted sum in select coordinates but obviously never accesses the entire vector, and the verifier checks whether the value computed by him will be equal to the value supplied by the prover at that point or not. Both tables are now reduced to a single column by taking the weighted vectorial sum. Let the element in these columns be $(c_i)_i$ and $(k_i)_i$ and we can use the same algorithm as used in RAP and form an extended column that computes the products $\prod_i (\alpha - c_i)$ and $\prod_i (\alpha - k_i)$, respectively. Specifically, the transition constraint for this extension column is: $$ \forall i > 0: \ e_{i-1} \cdot (\alpha - c_i) = e_i $$ where $e_i$ represents the value from the extension column. $$ \begin{array}{|c|c|} \hline c_i & e \\ \hline w & \alpha - w \\ x & (\alpha - w)(\alpha - x) \\ y & (\alpha - w)(\alpha - x)(\alpha - y) \\ z & (\alpha - w)(\alpha - x)(\alpha - y)(\alpha - z) \\ \hline \end{array} $$ $$ \begin{array}{|c|c|} \hline k_i & e \\ \hline x & \alpha - x \\ y & (\alpha - x)(\alpha - y) \\ w & (\alpha - x)(\alpha - y)(\alpha - w) \\ z & (\alpha - x)(\alpha - y)(\alpha - w)(\alpha - z) \\ \hline \end{array} $$ If the two columns do contain the same values but in a different order, then the products should be the same: $$ \prod_i (\alpha - c_i) = \prod_i (\alpha - k_i). $$ ---- ### Evaluation Arguments Evaluation Arguments will be used when we need to check that one table’s list of rows appears in order as a sublist of another table’s list of rows. Both table columns are compressed into one column with the same technique of weighted vectorial sum with verifier-supplied weights $a,b,c,..$ Additionally, the larger table has to have an indicator column or we can say the selector column, that takes the value 1 if row i is a part of the sublist relation and 0 if it is not and we need to show $(c_i)_{i|j_i=1}$ = $(k_j)_j$ The evaluation argument is somewhat similar to the permutation, there is only one difference in the permutation argument we compute the running product, and in the case of the evaluation argument we will compute the running sum multiplied by some random element supplied by the verifier. The transition constraints for the evaluation argument are given by $$ \forall i > 0 : e_i = j_i \cdot (\alpha e_{i-1} + c_i) + (1 - j_i) \cdot e_{i-1} \text{ for the larger table} $$ $$ \forall j > 0 : e_j = \alpha e_{j-1} + k_j \text{ for the smaller one.} $$ Note that the factors $j_i$ and $(1 - j_i)$ enforce the conditional accumulation of a new term. Specifically, in un-indicated rows, the running sum does not change, whereas in indicated rows it changes in the same way that it changes in the smaller table. $$ \begin{array}{|c|c|c|} \hline j_i & c_i & e_i \\ \hline 0 & u & 0 \\ 1 & x & x \\ 0 & v & x \\ 1 & y & \alpha x + y \\ 0 & w & \alpha x + y \\ 1 & z & \alpha^2 x + \alpha y + z \\ \hline \end{array} $$ $$ \begin{array}{|c|c|} \hline c_j & e_j \\ \hline x & x \\ y & \alpha x + y \\ z & \alpha^2 x + \alpha y + z \\ \hline \end{array} $$ You can see that the final term will be equal in both the tables if the larger table contains the sublist of the smaller table in the same order. However, if the order in the larger table is different from that of the smaller table, then the value computed at the last will also differ. --- We have covered Plonk Arithmetization and the concept of Arguments successfully. We will now look at the working of our zkVM (STARK Engine) in the [next blogpost](https://hackmd.io/@Muskan05/rJ-exWiLJl).

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully