Aztec
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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
    • Transfer ownership
    • Delete this note
    • 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 Help
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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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
    # Aztec's kernel circuit and client-side IVC ## Notation In Protogalaxy, the symbols $(\phi; \omega)$ refer to, respectively, a committed transcript and transcript of a special-sound-protocol relation. In barretenberg this is defined via the `ProverInstance` class. The symbols $((\phi, \beta, e); \omega)$ refer to the committed transcript and transcript of a randomized relation $\mathcal{R}_{rand}$. N.B. in barretenberg this is referred to via a "relaxed instance" and reuses the `ProverInstance` class. The Aztec architecture has two relations, $\mathcal{R}_{rand}$ (from the Protogalaxy paper) and $\mathcal{R}_{honk}$. The $\mathcal{R}_{honk}$ relation can be modelled as a committed special sound protocol as defined in the Protogalaxy paper. We can abuse notation and split the committed transcript $\phi_x$ for $\mathcal{R}_{honk}$ into two components: $\phi^{precomputed}_{x}$ and $\phi^{witness}_x$. The commitments to precomputed selector polynomials for a given Honk circuit are represented by $\phi^{precomputed}_{circuit}$. The commitments to wire polynomials, as well as challenges and all other Prover messages in the Honk protocol, are represented by $\phi_{witness}$. i.e. for a fixed circuit, $\phi^{precomputed}_{circuit}$ will not change, but $\phi_{witness}$ will be different for every proof. ## Kernel circuit architecture The Aztec kernel circuit takes in the following via public inputs: - An input accumulator committed transcript $(\phi, \beta, e)$ (n.b. in bberg this is a `VerifierInstance`) - An output accumulator committed transcript $(\phi^*, \beta^*, e^*)$ The following are present via _private_ inputs: - An input kernel committed transcript $\phi_{kernel}$ - An input contract function committed transcript $\phi_{func}$ We require the Prover has knowledge of the full transcripts $\omega, \omega^*, \omega_{kernel}, \omega_{func}$. We wish to establish the following: $( (\phi, \beta, e); \omega ) \in \mathcal{R}_{rand}$ $( (\phi^*, \beta^*, e^*); \omega^* ) \in \mathcal{R}_{rand}$ $( \phi_{kernel}; \omega_{kernal} ) \in \mathcal{R}_{honk}$ $( \phi_{func}; \omega_{func} ) \in \mathcal{R}_{honk}$ In addition to the above, the following data structures are present on the public inputs of the kernel circuit: - A function circuit tree root $r_{func}$ - An input "function call stack" $g_{in}$ - An output "function call stack" $g_{out}$ - A "step counter" variable $count$ that tracks the IVC depth - $h_{kernel}$: a hash of the instance component of $\phi_{kernel}$ The function circuit tree root $r_{func}$ is the root of an append-only Merkle tree, where every leaf contains the hash of $\phi^{precomputed}_{func}$ - the precompute component of an Aztec smart contract function. The "function call stack" objects are a set of field elements that describe a fixed-size list of functions that need to be executed in order to process the user transaction. Of relevance to this document is that every function call stack element contains the following: 1. A committed instance $\phi^{precomputed}_{func}$ 2. An $index$ field element that describes the leaf index of $H(\phi^{precomputed}_{func})$, in $r_{func}$ ## Kernel Circuit Logic We want to achieve the following outcomes: 1. Validate that $\phi^*$ is the result of folding $\phi_{func}, \phi_{kernel}$ into $\phi$ 2. Validate that $\phi_{func}$ is a valid Aztec contract function circuit 3. Consistency checks between the current IVC state and the previous IVC state present in $\phi_{kernel}$'s public inputs 4. Validate the IVC step count is consistent (i.e. if previous IVC iteration had step count of $i$, the current IVC step count is $i+1$) 5. Validate the instance commitment to $\phi_{kernel}$ is consistent with previous instance commitments to $\phi_{kernel}$ used at previous IVC steps Note: item 5 is due to the fact that we cannot hardcode the kernel circuit instance commitment into the kernel circuit constraints - circular dependency! The kernel circuit logic evaluates the following steps: 1. Pop the front entry from $g_{in}$ to obtain $(\phi^{precomputed}_{func}, index)$. 2. Validate that $\phi^{precomputed}_{func}$ is the instance component of $\phi_{func}$ present in private inputs 3. Via a hash path presented via private inputs, validate $\phi^{precomputed}_{func} \in r_{func}$ at position $index$ 4. Validate that $h_{kernel}$ is a hash of the instance component of $\phi_{kernel}$ 5. Up to 4 additional function calls may be described by the public inputs of $\phi_{func}$, according to a fixed ABI. Define these extra function calls via $g_{new}$ 6. Validate that $g_{out} = g_{in}.pop().concat(g_{new})$ IF $count = 0$: 1. Validate that $\phi$ is a committed transcript to an _empty_ accumulator 2. Run the protogalaxy folding verifier to validate that $protogalaxy(( \phi, \beta, e ), (\phi_{func}); \omega, (\omega_{func}))$ returns $((\phi^*, \beta^*, e^*); \omega^* )$ IF $count > 0$: 1. Run the protogalaxy folding verifier to validate that $protogalaxy(( \phi, \beta, e ), (\phi_{func}, \phi_{kernel})); \omega, (\omega_{func}, \omega_{kernel})$ returns $((\phi^*, \beta^*, e^*); \omega^* )$ 2. From the public inputs of $\phi_{kernel}$, validate that $\phi_{kernel}.count = count - 1$ 3. From the public inputs of $\phi_{kernel}$, validate that $\phi_{kernel}.h_{kernel} = h_{kernel}$ 4. From the public inputs of $\phi_{kernel}$, validate that $r_{func} = \phi_{kernel}.r_{func}$ 5. From the public inputs of $\phi_{kernel}$, validate that $\phi_{kernel}.g_{out} = g_{in}$ ## Completing the IVC: "Seal" Circuit A user transaction is considered executed when the user produces a kernel instance where $g_{out}$ is empty (i.e. no additional functions to execute). This kernel circuit instance exposes information on its public inputs that we wish to hide from observers. For example, the differences between the input and output function call stacks leaks information about what function is called. A final IVC step is enacted via the use of a new, "seal" circuit. The final user instance $(\phi_{kernel}; \omega_{kernel})$ will contain, on its public inputs, the final output accumulator $((\phi^*, \beta^*, e^*); \omega^*)$. To complete the IVC, we must fold $(\phi_{kernel}; \omega_{kernel})$ into $(\phi^*, \beta^*, e^*); \omega^*)$, producing a final accumulator instance $((\phi_{final}, \beta_{final}, e_{final}); \omega_{final})$. **Public inputs of the seal circuit** - Final accumulator committed transcript $(\phi^*, \beta^*, e^*)$ **Private inputs of the seal circuit** - Committed transcript $\phi_{kernel}$ The seal circuit logic evaluates the following steps: 1. From the public inputs of $\phi_{kernel}$, validate that $\phi_{kernel}.g_{out}$ has a size of 0 2. From the public inputs of $\phi_{kernel}$, validate that $\phi_{kernel}.r_{func}$ is a valid root of the function circuits tree (i.e. the kernel circuit tracks a merkle tree of valid function circuit tree roots: $r_{roots}$, and a membership check of $r_{func} \in r_{roots}$ is satisfied) 3. Validate that the instance component of $\phi_{kernel}$ matches the kernel circuit as defined by the protocol 4. Validate that $\phi_{kernel}.h_{kernel}$ is a valid hash of the instance component of $\phi_{kernel}$ 5. Extract $(\phi^*, \beta^*, e^*)$ from the public inputs of $\phi_{kernel}$. 6. Run the protogalaxy folding verifier to validate that$protogalaxy(( \phi^*, \beta^*, e^* ), (\phi_{kernel}); \omega^*, (\omega_{kernel}))$ returns $((\phi^{**}, \beta^{**}, e^{**}); \omega^{**} )$ (todo: clean up notation here) ## Validating the IVC: Rollup Circuit Logic The Rollup circuit will validate the correctness of the IVC, given an instance of $(\phi_{seal}; \omega_{seal})$. The final user instance $(\phi_{seal}; \omega_{seal})$ will contain, on its public inputs, the accumulator $((\phi^*, \beta^*, e^*); \omega^*)$. To complete the IVC, we must fold $(\phi_{seal}; \omega_{seal})$ into $(\phi^*, \beta^*, e^*); \omega^*)$, producing a final accumulator instance $((\phi_{final}, \beta_{final}, e_{final}); \omega_{final})$. Finally a Decider verifier must validate a proof of correctness that $(\phi_{final}; \omega_{final} ) \in \mathcal{R}_{rand}$ **Public inputs of the rollup circuit** - Committed transcript $\phi_{seal}$ - Final accumulator committed transcript $(\phi_{final}, \beta_{final}, e_{final})$ - Decider proof $\pi_{decider}$ that proves $((\phi_{final}, \beta_{final}, e_{final}); \omega_{final} ) \in \mathcal{R}_{rand}$ The rollup circuit logic evaluates the following steps: 1. Validate the instance component $\phi_{seal}$ matches hardcoded commitments to the seal circuit. 3. Extract $(\phi^*, \beta^*, e^*)$ from the public inputs of $\phi_{seal}$. 4. Run the protogalaxy folding verifier to validate that$protogalaxy(( \phi^*, \beta^*, e^* ), (\phi_{seal}); \omega^*, (\omega_{seal}))$ returns $((\phi_{final}, \beta_{final}, e_{final}); \omega_{final} )$ 5. Run the protogalaxy decider verifier to validate that $((\phi_{final}, \beta_{final}, e_{final}); \omega_{final}) \in \mathcal{R}_{rand}$, using $\pi_{decider}$ # IVC scheme visualised ![image](https://hackmd.io/_uploads/HJjf3j4Ha.png) # Zero-knowledge requirements Assuming Honk is honest-verifier zero-knowledge, we need to ensure that knowledge of any $\phi_{func}$ committed instance cannot be extracted from the $\phi_{kernel}$ instance passed to the rollup circuit, or the accumulator instance $(\phi^*, \beta^*, e^*)$

    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