4th ZKProof Workshop
      • 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
    • 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 Versions and GitHub Sync Note Insights 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    ![](https://i.imgur.com/WeIvTiX.png =150x) **#4 - Home Edition** # ZkpComRef: Interfaces, Formats and Interoperability Please start by reading the [**editorial disclaimer**](https://hackmd.io/@workshop4/zcr-disclaimer) to ensure proper expectations about the process. ## Collaboration Instructions This page was prepared for a breakout session during the [ZKProof 4th workshop](https://zkproof.org/events/workshop4/) in order to receive concurrent/collaborative suggestions of content that may be useful for the "[ZKProof Community Reference](https://github.com/zkpstandard/zkreference/raw/master/zkproof-community-reference-v0.2.pdf)" (ZkpComRef). **Goal:** *this document will focus on expanding Section 3.4 on APIs and File Formats and Section 3.7 on Constraint-System Interoperability*. ### Content Each contribution should be either self-contained or written within the context of the section (as an edit of the current subsections). The field is advancing fast, and more interesting solutions for interfacing between frontends and backends are being published, different formats (PLONK, R1CS, Circuits, etc.) are being built and more needs for interoperability exist. Contributors are free to chose the relevant topics, either expanding on existing titles or adding new subsections. Here is a list of potential topics to be covered: **Examples of topics:** - *Concrete / reference APIs for the different systems:* can we build a generic API that would be used across the board in a "plug-and-play" manner? what would be the challenges? - Backends APIs - Frontend APIs - Communication APIs - *Descriptions of file formats:* what other formats exist (aside from R1CS) that can be used with ZK systems? For each maybe describe them, their mathematics, what are the (dis)advantages over others and how are they used in ZK proving systems? - R1CS and different versions. There are other "light-weight" constraint systems that are similar to R1CS. - Arithmetic and Boolean Circuits. The most common form of encoding computational statements is in circuit form. - PLONK and Custom Gates. The PLONK encoding format comes with the advantage of defining custom gates that can compute functions in a "cheaper form". - *Expand on the Frontend-Backend interoperability section:* what are some more advanced "features" that can be supported by such intermediate representations in the interoperability systems? What should be the scope of such systems (tooling, communication framework?) - Textual vs binary representations - *Recursive composition of proofs:* these can improve the performance and functionality ofZK proof systems in applications that deal with multi-stage computation or large amounts of data. - Proof-carrying data (PCD) compliance predicates are constraint systems with additional conventions that determine theirsemantics, and for interoperability these conventions require precise specification. - If we are to use different ZK systems for different parts of the composition, how are these interoperable? - *Extended forms of interoperability:* Beyond interfacing between frontend and backend, there are other forms of interoperability (see Section 3.7) - Proof interoperability - Procedural interoperability - Common reference string ### Guidelines **What to include in the contribution:** Each contribution may have a different set of requirements or "titles", please try to think about the following questions when you write the contribution: - What would be most relevant to discuss in the context of ZKProof and the ZkpComRef? - How can you describe the topic in the simplest way without losing technical depth? - How does the topic at hand fit within the larger picture of ZKP systems? - Are there any efficiency trade-offs to keep in mind? - What kind of adoption would be required in order for this topic to become a standard? **Add your contribution:** :::success **Email confirmation:** After adding a contribution, please send a brief email to editors@zkproof.org to confirm your suggestion (mention the suggestion number and title). ::: --- ## Contribution #0: TEMPLATE VERSION :::danger **Do not edit or delete this template; instead, copy-paste its content inside one of the available suggestion placeholders below, and then edit it there.** ::: >Suggested by : [name=Daniel Benarroch (daniel@qed-it.com)][name=Example] ### Topic Description > what are you contributing about? ### Specification > please say more, with technical details? ### Considerations > how does this fit in the larger picture? --- ## Contribution #1: PFCS (Prime Field Constraint System) >Suggested by : [name=Alessandro Coglio (coglio@kestrel.edu, acoglio@aleo.org)][name=Eric McCarthy (mccarthy@kestrel.edu, ericm@aleo.org)][name=...] ### Topic Description This is a possible generalization of R1CS and other constraint systems used in zero-knowledge proofs. The inspiring purpose is to facilitate formal proofs of correctness of R1CS with respect to higher-level specifications, but it may have broader uses. ### Specification A PFCS is a system of constraints over a prime field; the constraints include variables that range over a prime field. The motivation for PFCS stems from zero-knowledge proofs, but there may be more general applications. PFCS generalizes R1CS in two ways: - Constraints in PFCS are not limited to the R1CS form (i.e. equality between a product of two linear polynomials and a linear polynomial). They are equalities between any combinations of additions and multiplications (and perhaps more operations in the future); note that addition and multiplication suffice to describe arithmetic circuits. Thus, PFCS generalize R1CS, and likely (or eventually) other forms of constraints used in zero-knowledge proofs, e.g. PLONK. The richer representation also supports more elaborate transformations of the constraints. - Constraints in PFCS may be hierarchically organized, by naming sets of them as relations with parameters, which may be referenced (i.e. “called”) in the definition of other relations. This explicates the natural hierarchical structure of zero-knowledge gadgets (R1CS or others), and supports more modular verification, analysis, transformation, and synthesis. This is a prototype formalization of PFCS in the ACL2 theorem prover: https://github.com/acl2/acl2/tree/master/books/kestrel/crypto/pfcs This is the hyperlinked documentation generated from that code: https://www.cs.utexas.edu/users/moore/acl2/manuals/current/manual/?topic=PFCS____PRIME-FIELD-CONSTRAINT-SYSTEMS ### Considerations This seems a fairly simple idea, and may overlap with other similar initiatives in zkinterface and elsewhere. The details may vary, but the main idea is to provide more structure. Formal verification is facilitated by the additional structure in the same way as procedural decomposition facilitates traditional program verification. --- ## Contribution #2: zkInterface >Suggested by : [name=Eran Tromer][name=...] **(copy-paste here the template)** --- ## Contribution #3: SIEVE IR >Suggested by : [name=Eran Tromer][name=Kimberlee Model (kimee@stealthsoftwareinc.com)][name=...] Not yet public, but we can start preparing. **(copy-paste here the template)** The SIEVE IR is a circuit based intermediate representation currently in progress within DARPA's SIEVE program. The IR is based on circuits, and is parameterizable along two axis. - Gate set: Arithmetic or Boolean gate sets. - Uniformity: non uniform is a list of gates for streaming. Uniformity (work in progress) uses nested scopes to convey structure. The IR comes with three "resources" as the inputs to a proof system. The relation defines a circuit, while two input streams provide common inputs (instance) and prover inputs (short witness). --- ## Contribution #4: ACIR (Abstract Circuit Intermediate Representation) >Suggested by : [name=Kev][name=name2] A uniform constraint system over proving systems and NP relation (R1CS and PLONK-CSAT). It allows uniformity over any proving system by allowing for black box functions, and special opcodes which allow for prover provided values. **(copy-paste here the template)** --- ## Contribution #5: UltraPLONK > Suggested by : [name=Eran Tromer] _Format_ To specify the constraint system used in PLONK in an abstract manner, we need to specify: - The width - The available custom constraints One format which can be used to accomodate for custom constraints, is to view them as blackbox functions, where their functionality is known beforehand. This suggestion assumes the custom constraints are known along with their functionality. The width is unbounded, which means that you can have any fan-in, fan-out configuration. The available constraints are not theoretically bounded, so the format should accomodate for this. A custom constraint can be seen as a polynomial identity which is encoded in this PLONK configuration. The available custom constraints are accumulated into a quotient polynomial, where the degree of the quotient polynomial is a function of the degree of the highest polynomial identity. **(copy-paste here the template)** --- ## Contribution #6: <Title Here> >Suggested by : [name=name1][name=name2] **(copy-paste here the template)** --- ## Contribution #7: Uniformity Matrix >Suggested by : [name=Kimberlee Model][name=name2] Multiple of the interfaces given here express uniformity. TODO: explain what is uniformity - Uniformity for the purpose of the representation being "smaller" than the computation - or for allowing the proof to be "smaller" than the computation TODO: fill in the table | interface |constraint type | fixed repetition | conditional | encapsulated functionality | | --- | ---- | --- | --- | --- | | PFCS | expr1 = expr2 | no | not currently | yes | | zkInterface | R1CS | TODO | TODO | TODO | | SIEVE IR | Circuits | (in progress) | (in progress) | (in progress) | | ACIR | Circuits | no | no | yes | | PLONK | TODO | TODO | TODO | TODO | TODO: explain each column on the table (possibly add more cols?) - **constraint type**: Form of the constraints. - **fixed repetition**: Support for bounded loops. - **conditional**: Support for branching (i.e. alternatives) on private conditions. - **encapsulated functionality**: Support for hierarchical/procedural structure and scoping. ---

    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