Steve Wang
    • 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
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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
    • 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
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
  • 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    For easier reference and evaluation purpose, **the following document is an exact copy of my grant proposal,** **<font color="#f00">but annotated with my actual progress so far (as of July 11th) in red</font>**. The official grant end date is August 1st. * **Project:** PSE Chiquito (helping with Leo Lara) ## Project Overview :page_facing_up: ### Overview Chiquito is a high-level DSL that provides syntax sugar and abstraction for constraint building and column placement when writing Halo2 circuits. It allows the user to manipulate an AST that’s compiled to a Chiquito Halo2 backend, which can be integrated into any Halo2 circuit. ### Project Details **The following is a holistic list of project ideas, while I only plan to focus on two or three of them.** <font color="#f00">**In reality, I worked on 6 out of 7 project idea categories in the original grant proposal. My primary focuses are on: Chiquito core features, product research for other zkDSLs, and Python front end for Chiquito.**</font> #### Technology Stack * Rust (for circuit library and additional features for the compiler and backend) * Technical writing in Markdown (for documentation, product research, and integration research) #### Core Components to be Deployed ##### Chiquito Library * Additional circuit examples library written in Rust. Examples can include hash functions or primitives such as the xor function. Inspiration will come from existing Halo2 and Circom libraries. Libraries will not only demonstrate the versatility and syntax simplicity of Chiquito but also provide hands on examples for developers to use. * <font color="#f00">MiMC7 example:</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/11 * <font color="#f00">Annotated Fibonacci and MiMC7 examples: </font> * https://github.com/privacy-scaling-explorations/chiquito/commits/main/examples/fibonacci.rs * Develop gadgets for the standard library, such as the IsZero gadget. Again, inspiration will come from existing Halo2 and Circom libraries. * <font color="#f00">Developed "less than" gadget:</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/29 ##### Chiquito Core Features * Implement additional constraint builder, compiler, and Halo2 backend features in Rust. * <font color="#f00">Fixed signal:</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/53 * https://github.com/privacy-scaling-explorations/chiquito/pull/54 * https://github.com/privacy-scaling-explorations/chiquito/pull/55 * <font color="#f00">Shared signal:</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/49 * https://github.com/privacy-scaling-explorations/chiquito/pull/50 * https://github.com/privacy-scaling-explorations/chiquito/pull/51 * <font color="#f00">Lookup table abstraction: </font> * https://github.com/privacy-scaling-explorations/chiquito/pull/47 * <font color="#f00">Public signal:</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/42 * <font color="#f00">Typed constraint builder:</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/35 * <font color="#f00">Additional backend for Plaf:</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/34 * Write unit tests for existing features. * <font color="#f00">Unit test for constraint builder:</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/19 ##### Potential Integration with zkEVM * Rewrite existing circuit components of the zkEVM * <font color="#f00">Not started</font> * Conduct performance benchmarking using existing Halo2 code v.s. Chiquito adaptation * <font color="#f00">Benchmarked bytecode circuit witness assignment in PSE zkEVM vs Chiquito and found Chiquito to be 30x faster:</font> * https://github.com/privacy-scaling-explorations/chiquito/issues/36 ##### Product Research * Compare the technical implementation of fellow zkDSLs, such as Aztec Noir and Zokrates. Publish the research as blog posts. * <font color="#f00">Researched 10 products in conjunction with PSE's zkDSL working group:</font> * https://mud-jaguar-906.notion.site/cc5b5071240143d1805aad8bbc6cd583?v=aecbd25df3db44a3912112c48672be63&pvs=4 * <font color="#f00">Also in conjunction with the zkDSL working group, summarized the technical route of these products:</font> * https://mud-jaguar-906.notion.site/zkDSL-Technical-Routes-1027097ca441422a816034cca75376d9?pvs=4 * <font color="#f00">Not published as blog post yet</font> ##### Community and Adoption * Partner with AntAlpha Lab's PLONK-themed zk co-learning camp to teach a Chiquito course to circuit developers * <font color="#f00">Not started</font> ##### Miscellaneous * Json standard for different frontends, such as Python, which can be written by other developers * <font color="#f00">Research done. To be implemented this week as a part of Python frontend of Chiquito.</font> ##### Leo's Visions (probably not me to implement) * Backend for additional proof system * <font color="#f00">Not started, but Leo mentioned that there might be such work for the CCS proof system in the future.</font> * Cmd tool and npm package for developers * <font color="#f00">Not started</font> * Python frontend * <font color="#f00">Finished 2/3 of the first pass and successfully tested existing progress on an example. Not reviewed yet.</font> ##### <font color="#f00">Additional Work not Mentioned in the Original Proposal</font> * <font color="#f00">README and API docs</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/18 * https://github.com/privacy-scaling-explorations/chiquito/pull/13 * https://github.com/privacy-scaling-explorations/chiquito/pull/12 * <font color="#f00">CI workflows</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/30 * https://github.com/privacy-scaling-explorations/chiquito/pull/15 * <font color="#f00">Better debug messages</font> * https://github.com/privacy-scaling-explorations/chiquito/pull/26 #### Prior Work (by Leo) The current implementation includes: * A DSL in Rust * A backend in Halo2 * Composability with Halo2 circuits * A working prototype that passes zkEVM bytecode circuit tests ## Team :busts_in_silhouette: ### Team members Leo Lara * Email: leo@leolara.me * TG: @leolara Steve Wang * Email: qian.wang.wg24@wharton.upenn.edu * TG: @SteveIsEmployed ### Team Website https://github.com/privacy-scaling-explorations/chiquito ### Team's experience Leo Lara * 20 years experience in software engineering, experience in embedded and distributed systems * Graduated 1st class Comp Sci, at University of Bath * Worked at ARM, on server software * Co-founder CTO Uniplaces * 2021 start Blockchain journey, Gitcoin Kernel -> EthLisbon hackathon -> Ethereum Protocol Fellowship grantee (prysm) -> zkEVM < PSE < Ethereum Foundation * Working on zkEVM of EF Steve Wang * Current MBA/Computer Science dual degree student at University of Pennsylvania * Worked on Chiquito library, additional compiler features, and documentation while at AntAlpha Chiang Mai Hackerhouse * Repo link: https://github.com/privacy-scaling-explorations/chiquito * Won Aptos Official Grant for a DAO management tool. Was frontend and smart contract developer of the team. Smart contract written in Move, a Rust-based lanaguage. * Grant link: https://dorahacks.io/buidl/4334 * Repo (fork) link: https://github.com/qwang98/Airdropper-Based-On-Github * Technical research report about ERC4337: * Link: https://mirror.xyz/0x7333aB7AE068Ef92fb77A2bcab32FA273c45185c/cF55-mUlStUDn0aqrhEAfNRRY8sLVM97sJgLNor1BUw * Other personal Move and Solidity projects (mostly frontend and smart contract): * Github page: https://github.com/qwang98?tab=repositories * 3 years experience in data science using R and SQL at a consulting firm in the US * Math and Economics double major and Computer Science minor at Macalester College, full tuition scholarship and graduated rank 1 in both majors ### Team Code Repos * https://github.com/privacy-scaling-explorations/chiquito ## Development Roadmap :nut_and_bolt: This section should break out the development roadmap into a number of milestones. Since the milestones will appear in the grant contract, it helps to describe the functionality we should expect, plus how we can check that such functionality exists. Below we provide an **example roadmap**. We recommend that the scope of the work can fit within a 3 month period and that teams structure their roadmap as 2 weeks = 1 milestone. For each milestone: * Please be sure to include a specification of the software. The level of detail must be enough so that we are able to verify that the software meets the specification. * Please include total amount of funding requested per milestone. * Please note that we require documentation (e.g. tutorials, API specifications, architecture details) in each milestone. This ensures that the code can be widely used by the community. * Please provide a test suite, comprising unit and integration tests, along with a guide on how to run these. * Please indicate the milestone duration, as well as number of Full-Time Employees working on each milestone, and include the number of days along with their cost per day. ### Overview * **Total Estimated Duration:** Duration of the whole project * **Full-time equivalent (FTE):** Workload of an employed person ([see](https://en.wikipedia.org/wiki/Full-time_equivalent)) * **Total Costs:** Amount of Payment for the whole project. ### Milestone 1 * **Estimated Duration:** 1 month * **FTE:** 1 * **Costs:** $62.5/hr, i.e. $10k for the milestone * **Estimated delivery date**: May 31st, 2023 **WORK ON TWO OF THE FOLLOWING** | Number | Deliverable | Specification | | ------------- | ------------- | ------------- | | 0a. | README | Provide a README file explaining the high level design principles, architecture, and a getting started boiler plate code suite for devs. | | 0b. | API docs | Provide a full API documentation for DSL functions exposed to devs, including an example file using these APIs | | 1. | Research | Compare the technical architecture and feature difference of fellow zkDSLs such as Aztec Noir and Zokrates. Will document our understanding in Notion. | | 2. | Circuit library | Write 1-2 more circuit examples in Chiquito, adapted from base Halo2 library or Circom library | | 3. | Chiquito features | Work on implementing TODOs in the compiler and backend at Leo's discretion | | 4. | Learning | Understand the zkEVM bytecode example in both base Halo2 and Chiquito. A stretch goal is to understand the testing requirements and performance specs as well. | ### Milestone 2 * **Estimated Duration:** 1 month * **FTE:** 1 * **Costs:** $62.5/hr, i.e. $10k for the milestone * **Estimated delivery date**: June 30th, 2023 **WORK ON TWO OF THE FOLLOWING** | Number | Deliverable | Specification | | ------------- | ------------- | ------------- | | 1. | Research | Keep researching zkDSLs such as Aztec Noir and Zokrates. Go into the technical details, such as PLONK table construction, circuit performance, and computation complexity of large circuits. Research will be documented in Notion | | 2. | Circuit library | Write 1-2 more circuit examples in Chiquito, adapted from base Halo2 library or Circom library | | 3. | Chiquito features | Work on implementing TODOs in the compiler and backend at Leo's discretion | | 4. | Potential zkEVM integration | Adapt one more Halo2 circuit in the zkEVM to Chiquito | | 5. | Learning | Analyze more zkEVM circuits. A stretch goal is to dive into the source code of base Halo2. | ### Milestone 3 * **Estimated Duration:** 1 month * **FTE:** 1 * **Costs:** $62.5/hr, i.e. $10k for the milestone * **Estimated delivery date**: July 31st, 2023 **WORK ON TWO OF THE FOLLOWING** | Number | Deliverable | Specification | | ------------- | ------------- | ------------- | | 1. | Research | Publish zkDSL research piece as a blog post. | | 2. | Circuit library | Write 1-2 more circuit examples in Chiquito, adapted from base Halo2 library or Circom library | | 3. | Chiquito features | Work on implementing TODOs in the compiler and backend at Leo's discretion | | 4. | Potential zkEVM integration | Adapt one more Halo2 circuit in the zkEVM to Chiquito | | 5. | Learning | Analyze more zkEVM circuits. A stretch goal is to dive into the source code of base Halo2. | ## Additional Information :heavy_plus_sign: The following are general information about Chiquito ### Design Principles **Abstraction**. As circuit complexity increases, abstraction is inevitable. By abstracting constraint building and column placement, Chiquito improves the readability and learnability of Halo2 circuits, which can not only standardize and simplify the code base for complex projects such as the zkEVM, but also onboard more circuit developers. **Composability**. Chiquito circuits are fully composable with Halo2 circuits, which allows developers to write any part or the entirety of a circuit in Chiquito and integrate with other Halo2 circuits. **Modularity**. The AST and IR representations of a circuit allow Chiquito to integrate any frontend that can compile into the AST data structure and any backend that can compile from the IR data structure. For example, we can have a Python frontend that compiles to Chiquito AST/IR, which compiles to a Sangria backend. Modularity allows for future extensions. **User Experience**. Chiquito simplifies and optimizes user experience. For example, annotations for constraints are automatically generated for debugging messages. ### Architecture There are two major architectural differences between Chiquito and Halo2: - Chiquito circuit is composed of “steps”. Each step defines the constraints among witnesses, fixed columns, and lookup tables, and can be composed of one or multiple rows in a PLONKish table. That’s why steps are also called “super rows”. We made this design choice to allow for more complex constraints, which sometimes require allocating multiple Halo2 rows. - Chiquito DSL is based on “signals” rather than columns in order to abstract away column placements. One signal can be placed in different columns across different steps, all handled by Chiquito’s compiler. Chiquito circuit has the following architecture - Circuit (with optional input from Halo2) - Forward signals (signals with constraints across different steps) - Fixed columns - Step types - Internal signals (signals with constraints only within one step) - Internal constraints (constraints for internal signals only) - Transition constraints (constraints involving forward signals) - Witness generation function for one step type instance - Trace (global circuit witness generation) - Adds instances of step types

    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
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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