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

Derive Keystore public key from secret key #1028

Closed
MegaRedHand opened this issue Apr 23, 2024 · 4 comments · Fixed by #1067
Closed

Derive Keystore public key from secret key #1028

MegaRedHand opened this issue Apr 23, 2024 · 4 comments · Fixed by #1067
Assignees
Labels
good first issue Good for newcomers

Comments

@MegaRedHand
Copy link
Collaborator

MegaRedHand commented Apr 23, 2024

Context: #1013

Currently we're parsing it from the file, but the value could be wrong. Also, deriving it from the secret enables us to add an additional check by comparing both the parsed and derived values.

@guha-rahul
Copy link
Contributor

Can i take it?

@MegaRedHand
Copy link
Collaborator Author

Sure! Go ahead! Let me know if you need some pointers.

@MegaRedHand MegaRedHand moved this from Ready to In review in Lambda Ethereum Consensus Node May 6, 2024
@MegaRedHand MegaRedHand moved this from In review to In progress in Lambda Ethereum Consensus Node May 6, 2024
@guha-rahul
Copy link
Contributor

Sure! Go ahead! Let me know if you need some pointers.
Hey sorry for the late reply but dump as many pointers as you like .

@MegaRedHand
Copy link
Collaborator Author

MegaRedHand commented May 8, 2024

  • The keystore is in lib/keystore.ex.
  • We currently parse the public key here:
    # TODO: derive from privkey and validate with this pubkey
    pubkey = Map.fetch!(decoded_json, "pubkey") |> parse_binary!()
  • The idea is to derive the key from the secret key and compare them.
  • You might need to add a function to lib/bls.ex for that (keep in mind it's a NIF, so actual code is in Rust and lives inside native/bls_nif)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Development

Successfully merging a pull request may close this issue.

2 participants