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

Add support for BIP32 (Heirarchical Deterministic Wallets) #88

Merged
merged 17 commits into from
Feb 12, 2020

Conversation

fubuloubu
Copy link
Contributor

Split off commits related to BIP32 implemented from #87

@pipermerriam
Copy link
Member

@kclowes will you give this a first pass?

Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fubuloubu Thanks for breaking up these PRs, it's really helpful to not think about mnemonics in this one :) On a high level this is looking good to me, I don't see anything major to change. I think it would be good to see some more testing around the error cases in the derive_child_key method, and any other corner cases you can think of. I only made it through the CKD section in the BIP32 spec/this code, so I'll pick up at the HD Path/key tree part of the specification on Wednesday!

eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Show resolved Hide resolved
@fubuloubu
Copy link
Contributor Author

@kclowes Made updates per your suggestions!

Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, @fubuloubu! I left a few comments, but nothing major sticks out I see.

Just to make sure I understand, it looks to me that this PR returns a private (right?) child key given a path and a seed. Is that correct/am I missing anything?

@pipermerriam do you want to take a look?

eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/_utils.py Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
@fubuloubu
Copy link
Contributor Author

@kclowes that's correct. The seed gets generated using BIP39

@fubuloubu
Copy link
Contributor Author

Any updates on merging this PR?

@pipermerriam
Copy link
Member

Lemme give it a pass and I'll leave the final merge up to @kclowes

Copy link
Member

@pipermerriam pipermerriam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I left a few comments on cleanup things but overall the structure is nice and clean. 👍

eth_account/hdaccount/_utils.py Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
eth_account/hdaccount/deterministic.py Outdated Show resolved Hide resolved
@kclowes
Copy link
Collaborator

kclowes commented Feb 12, 2020

@fubuloubu I'll merge this shortly! I started going through BIP39 today and should have a review for that PR soon.

As general feedback on the HD wallet feature: I spoke with @pipermerriam and before we release it, we'll want to put it behind a flag that makes this API inaccessible by default because it hasn't been audited. Here is an example of putting EthPM behind a similar sort of flag in web3: ethereum/web3.py#1216. I think we can get away with only adding the flag in eth-account, but we may also want to add it to web3.

And when you're adding documentation, we'll also need to add a warning there so that users know to use at their own risk.

@kclowes kclowes merged commit dc8c9b0 into ethereum:master Feb 12, 2020
@fubuloubu
Copy link
Contributor Author

@kclowes sounds good, however I think we can talk about this when we get to #87, as that's where all the API stuff is

@fubuloubu fubuloubu deleted the bip32 branch February 13, 2020 05:13
@kclowes
Copy link
Collaborator

kclowes commented Feb 13, 2020

Yep, that sounds good to me!

pacrob added a commit to pacrob/eth-account that referenced this pull request Jan 30, 2024
* remove testall because it doesnt work
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

Successfully merging this pull request may close these issues.

3 participants