You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
constseed=CipherSeed.random();CipherSeed{entropy: <Buffer003fec3fc08b5fe585620d46836da2fd>,
salt: <Buffer1797447e2f>,
internalVersion: 0,
birthday: 4256
}constmnemonic=seed.toMnemonic();'abandon program category judge luggage guitar crash naive close refuse salmon royal question school giraffe spell engine obvious total material title trash together meat'constmnemonicWithPassword=CipherSeed.changePassword(mnemonic,null,'my password');'abandon brain finish guide nose bamboo early weird figure birth egg bargain safe alley diesel acquire tackle judge total material title plate blush bargain'
The high scrypt params also make this quite slow.
Would be great if it could be done with just:
constmnemonic=CipherSeed.generateMnemonic();'abandon program category judge luggage guitar crash naive close refuse salmon royal question school giraffe spell engine obvious total material title trash together meat'// orconstmnemonicWithPassword=CipherSeed.generateMnemonic({password: 'my password'});'abandon brain finish guide nose bamboo early weird figure birth egg bargain safe alley diesel acquire tackle judge total material title plate blush bargain'// orconstmnemonicWithPassword=CipherSeed.generateMnemonic({password: 'my password',internalVersion: 0,});'abandon brain finish guide nose bamboo early weird figure birth egg bargain safe alley diesel acquire tackle judge total material title plate blush bargain'
It then becomes a single command, with or without a passphrase, and avoids extra encryption/decryption.
Some of my comments from our chat: (posted for sharing purposes)
you can pass a password to toMnemonic(), so not 3 steps, but 2.
aezeed is referring to the phrase format itself. I call it mnemonic because that's what people are used to.
CipherSeed is referring to the data structure encoded in the aezeed
also I was mimicing the API for the aezeed package in LND (go)
I'm open to any suggestions, but I think the internal data structure should be its own class like it is now. but you are right the API is a tad awkward
maybe remove some of the static methods and make them exported functions alongside the CipherSeed
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.
The text was updated successfully, but these errors were encountered: