-
Notifications
You must be signed in to change notification settings - Fork 14
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 extended BIP32 #13
base: main
Are you sure you want to change the base?
Conversation
The extended BIP 32 derivation tests are missing and failing if they are added AFAIU as:
|
I think this issue is that the xpub serialization format assumes the index is exactly 4 bytes, no more or less. Probably attempting to serialize an extended key without that size index should fail. |
5b93d58
to
92a2575
Compare
I am fine with this argument as the PR looks good to me and this test problem would requite to redesign them a bit as they are currently based on UPDATE: Having the same tests for both Rust and Motoko may makes sense if it's worth it, as discussed with @THLO, it's up to @tgalal to adapt its tests to make sure that the extended BIP-32 you proposed is correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to support standard Nat32
indices at all? In the changes they are just converted to [Nat8]
which I am not sure if it's on purpose or was just a quick fix. To me the options are:
- Keep the implicit conversion as is done at the moment
- Support extended and standard indices by treating them independently by never converting one to the other, then we need to bring back the
isHardenedIndex
check and its associated couple of tests. - Completely omit
Nat32
indices (but then we also either omit the function parsing paths from strings or still convert the parsed indices into[Nat8]
, and callers must always supply extended paths.
I understand the extended derivation is a generalization of the standard one, so I am just talking from an API perspective here.
I think we should support standard ( As far as the implementation is concerned, I'm not sure which option is better: Having completely separate implementations or checking that each level is non-hardened and then converting the 32-bit vector to an 8-bit vector to be fed into the other function. |
No description provided.