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

Implement ed25519 HD keyring #24

Closed
ethanfrey opened this issue Jun 2, 2018 · 8 comments
Closed

Implement ed25519 HD keyring #24

ethanfrey opened this issue Jun 2, 2018 · 8 comments
Assignees

Comments

@ethanfrey
Copy link
Contributor

ethanfrey commented Jun 2, 2018

Like #23, except instead of generating a random key each time, we generate a unique seed on initialization, which we expose as a bip39 mneumonic. We then use a bip32 hd key derivation to generate a sequence of keys, based on a path that can be provided in the constructor.

We can generate new keys from this seed at will, and we can sign with any of them.

Please verify that you can generate a key in this KeyRing, properly sign a message, and verify the signature with @iov/crypto:Ed25519 using the public key returned from the keyring. This serves mainly as an example of normal usage of the HD Keyring, as well as a sanity check.

@ethanfrey
Copy link
Contributor Author

@will-iov
Copy link
Contributor

will-iov commented Jun 3, 2018

I've used https://github.com/bitcoinjs/bip39 before: solid with some multi-language support.

@ethanfrey
Copy link
Contributor Author

Builds upon #52

@webmaster128
Copy link
Contributor

The signatures from the keys should be verifiable with the normal ed25519 keyring #23

Could you elaborate what you mean by that @ethanfrey? What use case do you have in mind here? Right now we have no concept of verifying other people's signatures in a Keyring

@ethanfrey
Copy link
Contributor Author

At one point, I thought we would expose verify in a keyring, but this is done in @iov/crypto:Ed25519.

I guess you are just using the Slip0010 class to create a private key to feed into the above class, so of course the signatures should verify with the same class. I guess a proper rewording would just be:

"Verify that you can generate a key in this KeyRing, properly sign a message, and verify the signature with @iov/crypto:Ed25519 using the public key returned from the keyring. This serves mainly as an example of normal usage of the HD Keyring, as well as a sanity check."

Does that work? If so, I will update the issue text.

@webmaster128
Copy link
Contributor

Thanks for clarification, this makes sense. Given that Slip0010 outputs private keys only, the rest is done using @iov/crypto:Ed25519 anyway. So the requested feature comes for free :)

@webmaster128
Copy link
Contributor

Status: the heavy work is done. Just the proper derivation paths are missing

@ethanfrey
Copy link
Contributor Author

Yeah, looks like 95% done, just a bit of polish.
But then, I am not 100% sure how the polish would look.
Maybe we can leave this as is and polish it when we have a concrete issue to use it with multiple chains

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

No branches or pull requests

3 participants