-
Notifications
You must be signed in to change notification settings - Fork 697
Use HD Wallet for account generation #44
Conversation
Here's an example of the
|
@axic Mind giving it a review? |
I should add that |
Hmm, I probably don't need the rng code anymore as the seed could just be passed as the entropy. Let me check that out. |
Oops, I take that back. I do need that as entropy needs to be a hex value. Leaving it in. |
@kumavis @FlySwatter - can you guys test and see if these mnemonics work with your lightwallet inside metamask? |
Absolutely, will get back to you later this afternoon, this will hugely improve the developing experience with test rpc and metamask! |
@FlySwatter According to Christian the lightwallet uses a different hd path than the default BIP44 hd path, above. He eventually wants to move to the BIP44 path, but he says the path is currently configurable in the lightwallet. You should talk to him about how to configure the hd path so that the lightwallet and the testrpc are using the same one. Also, thanks! |
You're using the bip44 path in test rpc?
|
@FlySwatter Ya, it's |
Can you elaborate? Why do you still need that rng? |
You're also missing the account index in front of the addresses/private keys. |
So someone can specify a seed and still get an associated mnemonic. Bip39's
|
Do we need to print the indexes? Indexes are zero based and are displayed
|
You could simplify that by running any hash over the input and using only 128 or 256 bits (that's what bip39 wants). And to further simplify it, you can make it slightly insecure by eliminating BIP39 entirely and just feeding Re indexes. With 2 accounts it is simple, but with 10 accounts it is a bit more work to line them up. It is only a UI nitpick. |
To be precise, the input to |
Never mind the avoid bip39 part, at least with using it, even when seeding with something defined in the command line, the user will still get the valid mnemonic displayed. |
As a side note, I think you should submit your |
@tcoulter this is really useful! i approve |
@kumavis FYI: |
@axic So I'm futzing over which numbered list style looks the best (I kinda think the numbers look "meh"). That said, they're important to have. What do you think of this?
|
Alright, executive decision time, I'm gonna go ahead and merge to master. This is going to sit on master for awhile while I fix a really-hard-to-debug race condition. After that 2.0.0 will be released. File a new issue if you guys run into any errors or have changes to propose. Thanks guys! |
I think it looks great! Very clean. The A small nit: the HD Wallet section shouldn't be displayed in case |
Good point. I'll add an issue. |
FYI: When this is pushed to npm, this needs to be testrpc 2.0 as it includes breaking changes.
Include in this PR:
-m
/--mnemonic
to input an HD wallet mnemonicSeed is used to create mnemonic.-d
option uses a default mnemonic instead of default seed.TestRPC.startServer()
has been moved to./bin/testrpc
as its sole purpose was to support the cli version.