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

Account derivation not according to EIP 2334 #1

Closed
alonmuroch opened this issue May 26, 2020 · 4 comments
Closed

Account derivation not according to EIP 2334 #1

alonmuroch opened this issue May 26, 2020 · 4 comments

Comments

@alonmuroch
Copy link

When creating a wallet the derivation path for new accounts is /m/12381/3600/i/0
https://github.com/wealdtech/go-eth2-wallet-hd/blob/master/wallet.go#L339

EIP 2334 defines the derivation to be:
/m/12381/3600/i/0 for withdrawal keys
/m/12381/3600/i/0/z for signing keys
https://github.com/ethereum/EIPs/pull/2334/files

@mcdee
Copy link
Collaborator

mcdee commented May 26, 2020

Those pieces of EIP-2334 are not a good idea. I've created a pull request to remove those restrictions, as they will preclude adherence to the EIP in many common staking situations.

ethereum/EIPs#2670

@mcdee mcdee closed this as completed May 26, 2020
@alonmuroch
Copy link
Author

That's open for discussion I guess but for now the implementation also prohibits multi wallet support from 1 seed.

derivation, as a minimum, should be m/12381/3600/{wallet_index}/{account_index}
Maybe even m/12381/3600/{wallet_index}/{0 for withdrawal, 1 for signing}/{account_index}

@alonmuroch
Copy link
Author

@mcdee made a fix multi account support, let me know what you think
https://github.com/alonmuroch/go-eth2-wallet-hd/tree/fix/EIP2334

@mcdee
Copy link
Collaborator

mcdee commented May 27, 2020

Thanks for the idea. Wallets are a level of separation, adding the ability to create multiple wallets from a single HD seed breaks that separation.

If multiple wallets are required, different seeds can be used. If multiple accounts with the same seed are required, they can all be in the same wallet. Creating two wallets from the same seed could cause confusion. If, for example, a 'withdrawal' and a 'validator' wallet created from the same seed and the 'validator' wallet copied to an internet-connected server, the user may believe that their 'withdrawal' wallet is safe but in fact the seed will be exposed on the internet-connected server.

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

2 participants