-
Notifications
You must be signed in to change notification settings - Fork 17
zk framework ppt #28
base: main
Are you sure you want to change the base?
zk framework ppt #28
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| [//]: # (SPDX-License-Identifier: CC-BY-4.0) | ||
|
|
||
| - Feature Name: r1cs-select | ||
| - Start Date: 2021-11-10 | ||
| - RFC PR: (leave this empty) | ||
| - Ursa Issue: (leave this empty) | ||
| - Version: 1 | ||
|
|
||
| # Summary | ||
| [summary]: #summary | ||
| Generic zero knowledge libraries such as bellman, bulletproof, etc come with two components | ||
| frontends and backends. Application programmers write their business logic using the frontend. The | ||
| backend handles the underlying cryptography. Traditional zero knowledge libraries do not allow mix | ||
| and match between different backends and frontends. In this zero knowledge framework one can use | ||
| rust r1cs library as front end and either bellman or bulletproof as backend. In future versions we | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'a' rust R1CS library or 'the' R1CS library? In other words, does this sentence talk about how this zero knowledge framework is a rust library for R1CS, or how this zero knowledge framework uses an R1CS library? |
||
| plan to support more backends. | ||
|
|
||
| Current version of the implementation: https://github.com/hyperledger/ursa/pull/192 | ||
|
|
||
| # Motivation | ||
| [motivation]: #motivation | ||
|
|
||
| Finding the appropriate zero knowledge framework (specifically the backend) is a non-trivial design | ||
| choice for application developers. Different backends have different performance numbers depending | ||
| on deployment options which might not be obvious to the application developer. Moreover, application | ||
| developers can have different preferences for different frontends. To make life easy for application | ||
| developers, ideally we should have seemless compatibility between different frontend and backends. In | ||
| the first version of this framework we support rust r1cs as front end, bellman and bullet proof as | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another place for links |
||
| backend. | ||
|
|
||
| # Guide-level explanation | ||
| [guide-level-explanation]: #guide-level-explanation | ||
|
|
||
| This project demonstrates R1CS logic with backends to Bellman and Bulletproofs. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another place for links |
||
|
|
||
| Use the following commands to execute each step of the process. The steps are setup (bellman), | ||
| prove, and verify. | ||
|
|
||
| Setup | ||
|
|
||
| `cargo run -- setup --backend=bellman | tee params.json` | ||
|
|
||
| Prove | ||
|
|
||
| `echo '"1234"' > witness.hex` | ||
| `cargo run -- prove --backend=bellman --parameters=params.json --witness=witness.hex | tee | ||
| proof.json` | ||
|
|
||
| or | ||
|
|
||
| `cargo run -- prove --backend=bulletproofs --witness=witness.hex | tee proof.json` | ||
|
|
||
| Verify | ||
|
|
||
| `cargo run -- verify --backend=bellman --parameters=params.json --input=proof.json` | ||
|
|
||
| or | ||
|
|
||
| `cargo run -- verify --backend=bulletproofs --input=proof.json` | ||
|
|
||
| # Reference-level explanation | ||
| [reference-level-explanation]: #reference-level-explanation | ||
| An R1CS instance can be defined by three matrices A, B and C. They correspond to the NP-complete | ||
| decision problem: whether there is a witness vector w s.t. Aw x Bw = Cw ? | ||
|
|
||
| main.rs: this file contains sample code on how to use the framework, get_circuit function defines | ||
| the circuit for which zero knowledge proofs will be generated | ||
| r1csbellman.rs, r1csbulletproof.rs: modules that convert r1cs spec to underlying backends | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you include a normative r1cs definition and/or spec?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in the new commit
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Above it talked about an R1CS library. This talks about an R1CS spec. In my mind those are two very different things. I don't see references here to either. |
||
|
|
||
|
|
||
| # Drawbacks | ||
| [drawbacks]: #drawbacks | ||
|
|
||
| We have chosen r1cs rust library (https://github.com/mir-protocol/r1cs) as frontend, which might | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here we have a link to the R1CS library! I recommend creating a |
||
| not be the preferred frontend for all users. | ||
|
|
||
| # Rationale and alternatives | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to see some content in this section
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in the new commit |
||
| [alternatives]: #alternatives | ||
|
|
||
| - Why is this design the best in the space of possible designs? | ||
| - What other designs have been considered and what is the rationale for not | ||
| choosing them? | ||
| - What is the impact of not doing this? | ||
| - For incorporating new protocol implementations what other implementations | ||
| exist and why were they not selected? | ||
| - For new protocols, what related protocols exist and why do the not satisfy | ||
| requirements? | ||
|
Comment on lines
+80
to
+87
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are questions that should be answered in the alternatives section. The snippet below is okay, but doesn't go into the detail that answering these questions would. While I would prefer to have actual answers to these questions, if the text below is intended to be sufficient, then the questions themselves should be removed. |
||
|
|
||
| One alternative is to use zk-interface (mentioned in prior arts). However, in our | ||
| experience setting up zk-interface can be difficult. Other alternative can be directly using the | ||
| underlying Zero Knowledge libraries such as Bellman, Bulletproof, etc. However, that would make the | ||
| development process less flexible. | ||
|
|
||
| # Prior art | ||
| [prior-art]: #prior-art | ||
|
|
||
| zk-interface (https://github.com/QED-it/zkinterface) is the defacto prior art. It has extensive | ||
| features. However, it is not being actively maintained and set up is relatively complex. | ||
|
|
||
| # Unresolved questions | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section as well should be filled out
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in the new commit |
||
| [unresolved]: #unresolved-questions | ||
|
|
||
| - What parts of the design do you expect to resolve through the RFC process | ||
| before this gets merged? | ||
| - What parts of the design do you expect to resolve through the implementation | ||
| of this feature before stabilization? | ||
| - What related issues do you consider out of scope for this RFC that could be | ||
| addressed in the future independently of the solution that comes out of this | ||
| RFC? | ||
|
Comment on lines
+103
to
+109
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comments here as in the alternatives section. The text is okay, but doesn't directly answer the questions. |
||
| This proposal is very basic bare bone version of the framework. As a future work we would like to | ||
| include more Zero Knowledge Backends and Frontends. However, we might require a balance between | ||
| extensive functionality (zk-interface) and simplicity (this proposal). | ||
|
|
||
| # Changelog | ||
| [changelog]: #changelog | ||
|
|
||
| - [10 Jan 2019] - v2 - a one-line summary of the changes in this version. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would like to see references to bellman and bulletproof libraries