sungmingwu
    • 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
    • Engagement control
    • 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 Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control 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
    1
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    How state proof/range-check proof works in Ceno zkVM ============ ### lookup argument: Logup The LogUp formula in summary like this ![image](https://hackmd.io/_uploads/Bkh-QWj9A.png) Where - LHS is the witness vector `W` to be lookup and $W(j) = W_j$, for $j \in [1, l]$ - RHS is the target table $T(x)$ with $T(i) = T_i$, for $i \in [1, i]$ - $i << j$ range check scenario - $M(x)$ is the couting for the respective lookup record, for $M(i) = m_i$ > This is called Indexed Lookup A random challenge `alpha` derived for `X`, and prover witness $W(x), M(x)$ There is a nice property, for the $W(X)$ and $T(X)$ can be concat as a super vector/table. The tricks is by make $W(X)$ and $T(X)$ as a rlc result, by deriving another challenge `beta`, with define constant as table derivative. For example, we can concat u5 and u16 table as this way ``` T := [ // U5 Table ROMType::U5 * beta^0 + 0 * beta^1, ROMType::U5 * beta^0 + 1 * beta^1, ... ROMType::U5 * beta^0 + (max_u5 - 1) * beta^1, // U16 table ROMType::U16 * beta^0 + 0 * beta^1, ROMType::U16 * beta^0 + 1 * beta^1, ... ROMType::U16 * beta^0 + (max_u16 - 1) * beta^1, ] ``` And the similar RLC tricks applid $W(X)$ so we make literally treat there is a huge table T for `Indexed Lookup` ### GKR sumcheck for fraction sum proof refer: https://eprint.iacr.org/2023/1284.pdf ![image](https://hackmd.io/_uploads/Hk0L8Ws5A.png) it can be view as $$ \frac{p(1)}{q(1)} + \frac{p(2)}{q(2)} + ... \frac{p(N)}{q(N)} = 0 $$ - we can select any pair of them in any order, e.g. 2 consecutive, or divide into 2 equal sub slice and point-wise sum - from math we know to sum 2 frac $$ \frac{p(1)}{q(1)} + \frac{p(2)}{q(2)} = \frac{p(1) \times q(2) + p(2) \times q(1)}{q(1) \times q(2)} $$ So we can design GKR circuit to layer by layer reduce $p(x), q(x)$ half size from k+1 -> k ![image](https://hackmd.io/_uploads/BywwubocA.png) and finally in output layer we just check ![image](https://hackmd.io/_uploads/Hkkidbs50.png) for $q_0 > 0$ and $p_0 = 0$ the ### GKR logup and codebase Recap ![image](https://hackmd.io/_uploads/Bkh-QWj9A.png) Both left hand side & right hand side are exposing pattern for fraction sum. For example, in LHS, $p(x)$ is constant vector 1, and $q(x)$ is witness vector to be lookup. In practice, we concat all expression to be lookup into a huge vector ![image](https://hackmd.io/_uploads/HJ1TFbocA.png) notes that concated vector size will be > column vector. This can't be achieved in traditional plonkish without GKR. GKR + sumcheck will assure source + flatten vector are well form. The concated vector is the LHS $q(x)$, and $p(x)$ is constant vector 1. Then we can use GKR+Logup to reduce huge concated vector half each time and check final result in output layer ![image](https://hackmd.io/_uploads/SyE65WiqC.png) The RHS table part $p(x) = m(x)$ and $q(x) = T(x)$. This part is agnostic for any opcode, so we can have a separate GKR + sumcheck to prove it. At the end, we just collect output layer from RHS and LHS and check they are equal, with both demoninato > 0. ### Logup application in zkVM - range check - bitwise operation, e.g. z = xor8(x, y), where x, y are 8 bit ### Padding to Power of 2 ![image](https://hackmd.io/_uploads/Bkh-QWj9A.png) There are 2 option for padding 1. set 0 on LHS numerator 2. or set $w_i$ = 0 in LHS denominator, and on RHS prover witness $M(x)$ for $m_i$ counting on $t_i$ = 0 We choose option 2 for constant vector p(x) is friendly to deal with in verifier. ### Another variant: set equality check Logup is optimal when ![image](https://hackmd.io/_uploads/Bkh-QWj9A.png) when j >> i. In zkVM, we have another kind of set equality: memory offline check protocol, such that giving R, W, at the end we check $R$ ?= $W$. Giving a global state in/out case, we will append record [pc, ts] to $R$ and [pc_next, ts_next] to $W$ set. You can imagine at the end $|R|$ == $|W|$. We can use logup to prove $R$ == $W$, via treat $R$ and $W$ in LHS/RHS demominator of Logup, and make $m_i$ also be constant vector 1. However we can have another choice by prove it via product arguments ![image](https://hackmd.io/_uploads/rkEtDMjqR.png) > $r$ challenge can be alpha, and $v_i$ can be rlc from beta, similar tricks as logup Product argument is good in this case due to - LHS set and RHS set are equal, so we benefit less from Logup - For Logup, in GKR when do fraction sum we need 3 multiplication $p1 \times q2$, $p2 \times q1$, $q1 \times q2$ and 1 sum $p1 \times q2 + p2 \times q1$ vs 1 multiplication in product check.

    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