-
Notifications
You must be signed in to change notification settings - Fork 171
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
Support encoding to / decoding from mnemonic versions of SINs #4
Comments
... and i accidentally deleted my comment, while trying to edit it. Go me. I think this would be great, but it might make more sense to implement the mnemonic generation in bitcore and pass through an options object from bitauth like: bitauth.generateSin({ mnemonic: true }); I'd like to hear @ryanxcharles thoughts on this. As far as the proposed methods for |
Yeah I agree it should probably be in bitcore first, and then we can pass it through. |
Thanks to @devrandom, bitcore supports BIP39. This is a way of converting secure random entropy into a mnemonic seed. Note that you must derive your private keys this way from the start, since the private key is the hash of the mnemonic. You can't convert an existing private key into a mnemonic using BIP39. Here's an example session where I generate a new random mnemonic and use that to make a Key:
|
Nice use of BIP39! BTW, I wonder if it would be appropriate for SINKeys to be generated using BIP32. You'd have just one secret for convenient backups while allowing the creation of any number of unlinkable credentials for different apps. |
Just like electrum provides mnemonic versions of private keys, it would be great if Bitauth could provide this too, directly within the library itself.
This would make memorizing the key much easier for the end user, allowing them to carry their identity with them across devices with minimum friction.
For example, provide two more methods:
bitauth.decodeSinMnemonic(String) -> String
- Would take in the mnemonic string as an argument, and output the raw SIN as the return value. This method would be used internally by:bitauth.getPublicKeyFromPrivateKeyMnemonic(String) -> String
- Would take in the mnemonic string as an argument, and output the public key.I'm not certain at which point the mnemonic should be generated. I considered inside
bitauth. generateSin()
, but it seems it would be out of place there - thoughts on how you would go about it?The text was updated successfully, but these errors were encountered: