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-keygen] create cli utility and add new
command
#31641
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31641 +/- ##
=========================================
- Coverage 81.3% 81.3% -0.1%
=========================================
Files 736 736
Lines 207493 207493
=========================================
- Hits 168755 168746 -9
- Misses 38738 38747 +9 |
zk-keygen/src/main.rs
Outdated
.disable_version_flag(true) | ||
.arg( | ||
Arg::new("key_type") | ||
.short('t') |
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.
.short('t') |
(throughout)
we typically avoid declaring shortopts in the solana tools. a few have sneaked in over the years and they are all ambiguous in some contexts today
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.
Okay! I removed the shortopt for key_type
. The rest of the shortops were taken from solana-keygen
so we should probably leave it for consistency?
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.
i'd prefer to not propagate any of the short args from solana-keygen
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.
Okay, all shortopts are now removed!
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.
one more and i think i'm good
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
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.
lgtm now, thanks! @CriesofCarrots mind taking a pass?
Will do first thing tomorrow! |
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.
Generally looks great! Just a nit plus a "short" whiplash
zk-keygen/src/main.rs
Outdated
Arg::new("outfile") | ||
.long("outfile") | ||
.value_name("FILEPATH") | ||
.takes_value(true) | ||
.help("Path to generated file"), |
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.
(Sorry in advance for this 😞) I know @t-nelson had you take out all the short definitions, but I think we should preserve this one. I use solana-keygen -o
all the time; I think it's intuitive and much easier than typing the long flag.
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.
Yeah, I also use the -o
flag often and it is used quite a bit in the solana docs cli examples as well. I added it back in for now, but @t-nelson please let me know if you feel strongly against this. I'd be happy to go either way.
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.
my opinion here isn't strong. would be nice to add it back hidden, but i don't see any obvious what to only hide the short opt with clap v3
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.
Hm, yeah I don't quite see an easy way to hide just the short opt. Since this is not marked for publication just yet, let's keep the short opt for now. There will be a chance to discuss it again before publication.
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.
Sorry, noticed one more nit
Co-authored-by: Tyera <teulberg@gmail.com>
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.
Lgtm! Quick, merge it before @t-nelson notices the outfile thing ;)
Problem
There is currently no cli utility to create encryption keys (ElGamal and authenticated encryption) used for token-2022 and more generally zero-knowledge proofs.
Summary of Changes
Create a
zk-keygen
cli tool to generate encryption keys and add thenew
command that randomly generates encryption keys analogously tokeygen
.Other commands like
recover
(recover key/keypair from passphrase) andpubkey
(print out pubkey from an ElGamal keypair) will be added in a follow-up PR.The
solana-zk-keygen
is marked not for publication for now.Fixes #