Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zk-token-sdk] Refactor ciphertext validity sigma proof and rename ValidityProof to GroupedCiphertextValidityProof #32040

Merged
merged 9 commits into from
Jun 13, 2023
Merged

[zk-token-sdk] Refactor ciphertext validity sigma proof and rename ValidityProof to GroupedCiphertextValidityProof #32040

merged 9 commits into from
Jun 13, 2023

Conversation

samkim-crypto
Copy link
Contributor

@samkim-crypto samkim-crypto commented Jun 9, 2023

Problem

The instructions VerifyGroupedCiphertext2HandlesValidity and VerifyBatchedGroupedCiphertext2HandlesValidity have been added to the proof program (#31816). The actual sigma proofs that are used as proof data for these instructions are named ValidityProof and AggregatedValidityProof, which doesn't quite match with the proof program instructions.

Summary of Changes

  • renamed type ValidityProof to GroupedCiphertext2HandlesValidityProof
  • renamed type AggregatedValidityProof to BatchedGroupedCiphertext2HandlesValidityProof
  • refactored the two types above into their own separate submodules
  • updated function, variable, and test names accordingly

Fixes #

@samkim-crypto samkim-crypto added work in progress This isn't quite right yet v1.16 PRs that should be backported to v1.16 labels Jun 9, 2023
@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Merging #32040 (99d54b9) into master (4ebec90) will decrease coverage by 0.1%.
The diff coverage is 98.7%.

@@            Coverage Diff            @@
##           master   #32040     +/-   ##
=========================================
- Coverage    81.9%    81.9%   -0.1%     
=========================================
  Files         764      765      +1     
  Lines      208095   208095             
=========================================
- Hits       170500   170496      -4     
- Misses      37595    37599      +4     

@samkim-crypto samkim-crypto removed the work in progress This isn't quite right yet label Jun 9, 2023
Copy link
Contributor

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some doc suggestions

/// Append a domain separator for validity proof.
fn validity_proof_domain_sep(&mut self);
/// Append a domain separator for grouped ciphertext validity proof.
fn grouped_ciphertext_validity_proof_domain_sep(&mut self);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to spell out separator, in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, sounds good! Will do!

@samkim-crypto samkim-crypto merged commit 84e28c2 into solana-labs:master Jun 13, 2023
mergify bot pushed a commit that referenced this pull request Jun 13, 2023
…alidityProof` to `GroupedCiphertextValidityProof` (#32040)

* rename `CiphertextValidityProof` to `GroupedCiphertext2HandlesValidityProof`

* rename `AggregatedValidityProof` to `BatchedGroupedCiphertext2HandlesValidityProof`

* refactor `validity_proof` module into separate modules

* update test names

* update `aggregated` variable names

* update transcript function names

* Update zk-token-sdk/src/sigma_proofs/batched_grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Update zk-token-sdk/src/sigma_proofs/grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Reword constructor docs

---------

Co-authored-by: Tyera <[email protected]>
(cherry picked from commit 84e28c2)
samkim-crypto pushed a commit that referenced this pull request Jun 13, 2023
…name `ValidityProof` to `GroupedCiphertextValidityProof` (backport of #32040) (#32096)
jeffwashington pushed a commit to HaoranYi/solana that referenced this pull request Jun 13, 2023
…alidityProof` to `GroupedCiphertextValidityProof` (solana-labs#32040)

* rename `CiphertextValidityProof` to `GroupedCiphertext2HandlesValidityProof`

* rename `AggregatedValidityProof` to `BatchedGroupedCiphertext2HandlesValidityProof`

* refactor `validity_proof` module into separate modules

* update test names

* update `aggregated` variable names

* update transcript function names

* Update zk-token-sdk/src/sigma_proofs/batched_grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Update zk-token-sdk/src/sigma_proofs/grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Reword constructor docs

---------

Co-authored-by: Tyera <[email protected]>
wen-coding pushed a commit to wen-coding/solana that referenced this pull request Aug 15, 2023
…alidityProof` to `GroupedCiphertextValidityProof` (solana-labs#32040)

* rename `CiphertextValidityProof` to `GroupedCiphertext2HandlesValidityProof`

* rename `AggregatedValidityProof` to `BatchedGroupedCiphertext2HandlesValidityProof`

* refactor `validity_proof` module into separate modules

* update test names

* update `aggregated` variable names

* update transcript function names

* Update zk-token-sdk/src/sigma_proofs/batched_grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Update zk-token-sdk/src/sigma_proofs/grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Reword constructor docs

---------

Co-authored-by: Tyera <[email protected]>
wen-coding pushed a commit to wen-coding/solana that referenced this pull request Aug 15, 2023
…alidityProof` to `GroupedCiphertextValidityProof` (solana-labs#32040)

* rename `CiphertextValidityProof` to `GroupedCiphertext2HandlesValidityProof`

* rename `AggregatedValidityProof` to `BatchedGroupedCiphertext2HandlesValidityProof`

* refactor `validity_proof` module into separate modules

* update test names

* update `aggregated` variable names

* update transcript function names

* Update zk-token-sdk/src/sigma_proofs/batched_grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Update zk-token-sdk/src/sigma_proofs/grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Reword constructor docs

---------

Co-authored-by: Tyera <[email protected]>
wen-coding pushed a commit to wen-coding/solana that referenced this pull request Aug 15, 2023
…alidityProof` to `GroupedCiphertextValidityProof` (solana-labs#32040)

* rename `CiphertextValidityProof` to `GroupedCiphertext2HandlesValidityProof`

* rename `AggregatedValidityProof` to `BatchedGroupedCiphertext2HandlesValidityProof`

* refactor `validity_proof` module into separate modules

* update test names

* update `aggregated` variable names

* update transcript function names

* Update zk-token-sdk/src/sigma_proofs/batched_grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Update zk-token-sdk/src/sigma_proofs/grouped_ciphertext_validity_proof.rs

Co-authored-by: Tyera <[email protected]>

* Reword constructor docs

---------

Co-authored-by: Tyera <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.16 PRs that should be backported to v1.16
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants