-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cargo spec infra and some sample speccing.
- Loading branch information
Showing
6 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.PHONY: spec-build spec-watch | ||
|
||
OUT_MD_FILE := ./spec/specification.md | ||
OUT_HTML_FILE := ./spec/specification.html | ||
OUT_TEX_FILE := ./spec/specification.tex | ||
OUT_PDF_FILE := ./spec/specification.pdf | ||
OUT_SPEC_DIRECTORY := ./spec/ | ||
|
||
# builds the specification once | ||
spec-build: | ||
cargo spec build --output-file $(OUT_MD_FILE) | ||
pandoc $(OUT_MD_FILE) --to=latex --standalone --output $(OUT_TEX_FILE) | ||
pandoc $(OUT_TEX_FILE) --to=pdf --standalone --output $(OUT_PDF_FILE) | ||
# this gives lots of error and does not compile corretly | ||
# pdftex -shell-escape -output-directory $(OUT_SPEC_DIRECTORY) \\nonstopmode\\input specification.tex | ||
|
||
# watches specification-related files and rebuilds them on the fly | ||
spec-watch: | ||
cargo spec watch --output-file $(OUT_MD_FILE) | ||
|
||
spec-build-html: | ||
cargo spec build --output-format respec --output-file $(OUT_HTML_FILE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[metadata] | ||
name = "Ring Proof" | ||
description = "zk proof of knowledge of blindinng factor of a Pedersen commitment" | ||
authors = ["Alistair, Davide, Jeff, Syed, Sergey"] | ||
|
||
[config] | ||
template = "specification_template.md" | ||
|
||
[sections] | ||
# Plonk Prover | ||
plonk-prover = "common/src/prover.rs" | ||
|
||
# Plonk Verifier | ||
plonk-verifier = "common/src/verifier.rs" | ||
|
||
# Ring Prover | ||
ring-prover = "ring/src/ring_prover.rs" | ||
|
||
## Ring Verifier | ||
ring-verifier = "ring/src/ring_verifier.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Ring Proof | ||
|
||
for a vector commitment to a list of public keys, and a Pedersen commitment to one of the secret keys, | ||
implements a zk proof of knowledge of the blinding factor for the Pedersen commitment, and the position of the | ||
corresponding public key in the list. | ||
|
||
### Preliminaries | ||
|
||
### Plonk Prover | ||
|
||
|
||
### Plonk Verifier | ||
|
||
#### Plonk.Verify\ | ||
**Inputs**:\ | ||
- $Piop$: an object of Piop type\ | ||
- $Proof$: a proof tuple as defined in ???\ | ||
- $Challenges: ([\alpha_1,...,\alpha_n, \zeta, [\nu_1,..,nu_n])$ A Plonk Verifier challenge defined in ???\ | ||
- $H$: R Random oracle\ | ||
**Output**:\ | ||
- A boolean value indicating if the $Proof$ represents a correct proof\ | ||
|
||
***** | ||
$C \leftarrow EvaluateConsttrain(Poip)$ | ||
$E \leftarrow \sum_i^n \alpha[i] * C[i]$ | ||
$D \leftarrow DomainEvaluated(Piop)$ | ||
$q_zeta \leftarrow \frac{D}{\Omega(C + Proof.x)}$ | ||
**return** $BatchVerify()$ | ||
|
||
***** | ||
### Challenge | ||
|
||
**Definition**: *Plonk verifier challange* is defined as triple: | ||
$$([\alpha_1,...,\alpha_n, \zeta, [\nu_1,..,nu_n])$$ | ||
where \alpha_i, zeta and nu_i are all elements of Plonk Scalar Field. | ||
|
||
|
||
|
||
### Ring Prover | ||
|
||
|
||
|
||
### Ring Verifier | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Ring Proof | ||
|
||
for a vector commitment to a list of public keys, and a Pedersen commitment to one of the secret keys, | ||
implements a zk proof of knowledge of the blinding factor for the Pedersen commitment, and the position of the | ||
corresponding public key in the list. | ||
|
||
### Preliminaries | ||
|
||
### Plonk Prover | ||
{sections.plonk-prover} | ||
|
||
### Plonk Verifier | ||
|
||
{sections.plonk-verifier} | ||
|
||
### Ring Prover | ||
|
||
{sections.ring-prover} | ||
|
||
### Ring Verifier | ||
|
||
{sections.ring-verifier} | ||
|