Open lukechilds opened 3 years ago
Some of my comments from our chat: (posted for sharing purposes)
I think maybe we should mimic the BIP39 API except instead of inserting Buffers and getting out mnemonic strings it should be inserting CipherSeeds and getting out mnemonic strings.
Thanks for this Jon! This actually came in really helpful for something I was working on.
Could I suggest a few API changes that I think make it a little simpler to use?
To generate a mnemonic there are currently three steps involved and it involves generating a seed, encrypting it with the default password, decrypting it, and then re-encrypting with a user supplied password.
The high scrypt params also make this quite slow.
Would be great if it could be done with just:
It then becomes a single command, with or without a passphrase, and avoids extra encryption/decryption.
Also maybe
could be:
That way if the old password is the default, instead of having to pass in null params like:
You can just skip them and pass in the properties you care about like:
Also why is the exported class called
CipherSeed
? MaybeAezeed
would be a better name?Let me know what you think and if you're interested in a PR for any of these.