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

Custom child derivation path does not parse 'p' correctly. #1

Open
sbuss opened this issue Feb 23, 2014 · 3 comments
Open

Custom child derivation path does not parse 'p' correctly. #1

sbuss opened this issue Feb 23, 2014 · 3 comments

Comments

@sbuss
Copy link

sbuss commented Feb 23, 2014

While using your awesome tool to build some test vectors in sbuss/bitmerchant#10 I noticed that custom child derivation paths are not parsed correctly if the path contains a 'p' character.

Reproducing the failure

Given the BIP32 key dgpv51eADS3spNJh8qd8KgFeT3V2QZBDSkYUqbaKDwZpDN4jd3uLcR7i6CruVDsbacyx3NL2puToxM9MQYhZSsD8tBkXeQkm5btsKxpZawwPQND on DogecoinMainNet, consider the paths m/0, m/0p, and m/0'.

The path m/0 produces expected results:

screen shot 2014-02-23 at 1 50 53 am

But if you try to do a standard path using p instead of ' it ignores the p and treats it as a non-prime derivation (You can see these results are the same as m/0):

screen shot 2014-02-23 at 1 54 22 am

Finally, the m/0' path works and produces expected results (different from above):
screen shot 2014-02-23 at 1 53 21 am

@sarchar
Copy link
Collaborator

sarchar commented Feb 24, 2014

Should m/0p be evaluated just like m/0'? Or should m/0p (and any other non-standard characters) raise an error?

@sbuss
Copy link
Author

sbuss commented Feb 24, 2014

Should m/0p be evaluated just like m/0'? Or should m/0p (and any other non-standard characters) raise an error?

I think so, yes. This syntax is supported in money tree, pycoin, and bitmerchant. (Note that I'm currently developing bitmerchant.)

I just realized that the 'p' derivation isn't actually in the BIP32 spec. Parts of the BIP32 spec are a little vague and so I was using the money tree readme as a supplementary reference, and its support of this alternate syntax made me think it was official. I guess this isn't actually a bug, but an improvement request. The tools that I've seen all support this alternate syntax, so I think this tool should also support it.

Feel free to mark this as a feature request and put it on the back burner.

@sarchar
Copy link
Collaborator

sarchar commented Mar 4, 2014

@sbuss

I've followed a little bit of your work on Bitmerchant, so it's pretty cool you've found bip32.org useful. Unfortunately as you said, 'p' isn't actually part of the official BIP32 spec, so I think I want to not implement it (at this time). My goal is to be as close as possible to the spec (which is hard to say for litecoin and dogecoin, but whatever)...

@sipa is making some larger changes to BIP32, so let's see where that goes first.

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