-
Notifications
You must be signed in to change notification settings - Fork 550
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
Validate keypair app and command #7617
Conversation
38de5f8
to
5d618db
Compare
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.
Looks good from product + infra view, but still waiting on the VRF changes before we ship it
src/lib/cli_lib/commands.ml
Outdated
match%map Secrets.Keypair.read ~privkey_path ~password with | ||
| Ok keypair -> | ||
validate_transaction keypair | ||
(* TODO: add validation using VRF eval_and_test_public_key *) |
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.
The VRF is effectively a hash function built out of a signature. The only test you can do is to re-evaluate it and check that they're equal, which doesn't seem to give us anything of value. eval_and_check_public_key
is for snarks, so the additional checks are not relevant for normal use.
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.
In other words, you're saying there is no possible universe that a key could properly sign transactions but not evaluate VRFs? I guess if this is the case, then we don't need that extra check.
New
validate_keypair
app, and commandadvanced validate-keypair
.As with
generate-keypair
, the app and command useCODA_PRIVKEY_PASS
, if set, and prompt for a password otherwise, and both take theprivkey-path
flag.Validation consists of signing a dummy transaction and verifying the signature.
TODO: add a test of the keys using the VRF machinery (as commented in the code).
Update: won't add VRF bits, see comment below.
Example session: