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-sdk] Add sigma_proofs and transcript modules #1065

Merged
merged 4 commits into from
Apr 26, 2024

Conversation

samkim-crypto
Copy link

@samkim-crypto samkim-crypto commented Apr 26, 2024

Summary of Changes

This is a follow-up to #1019, which migrates the transcript and sigma_proofs modules from zk-token-sdk into zk-sdk. The only additional change to these modules is that the suffix _proof is removed from the sigma proof module names.

As in zk-token-sdk, the sigma_proofs and transcript modules were not included in the sbf target since they rely on the curve25519 dalek crate, which does not build well in sbf.

The dead_code and unused_imports were added since the rest of the zk-token-sdk, which uses these modules, have not been migrated yet.

There are some naming changes that are required in the sigma_proofs module as specified in #671. These will be done in subsequent PRs.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 79.12000% with 261 lines in your changes are missing coverage. Please review.

Project coverage is 82.1%. Comparing base (8e331e1) to head (4e594dd).
Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #1065     +/-   ##
=========================================
+ Coverage    82.0%    82.1%   +0.1%     
=========================================
  Files         860      880     +20     
  Lines      232898   235280   +2382     
=========================================
+ Hits       191071   193351   +2280     
- Misses      41827    41929    +102     

@samkim-crypto samkim-crypto requested a review from joncinque April 26, 2024 12:37
@samkim-crypto samkim-crypto marked this pull request as ready for review April 26, 2024 12:37
Copy link

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

I mainly skimmed, since it should just be a copy, but it looks good! Thanks for separating the commits

Comment on lines +65 to +73
fn rangeproof_from_key_domain_separator(&mut self, n: u64) {
self.append_message(b"dom-sep", b"rangeproof from opening v1");
self.append_u64(b"n", n);
}

fn rangeproof_from_opening_domain_separator(&mut self, n: u64) {
self.append_message(b"dom-sep", b"rangeproof from opening v1");
self.append_u64(b"n", n);
}

Choose a reason for hiding this comment

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

Are these meant to be the same? It seems like the first one should be a different name

Copy link
Author

Choose a reason for hiding this comment

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

Yeah so the rangeproof_from_key_... should append the message rangeproof from key v1. We also seem to have function close_account_proof_domain_separator, which is not deprecated and not used any more... I will clean up transcript on a follow-up. Sorry I should have caught this when I am migrating things over.

@samkim-crypto samkim-crypto merged commit 1bd7406 into anza-xyz:master Apr 26, 2024
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants