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
keytree: serialization for xpub, xprv #179
Comments
What should be serialized/deserialized here? For the private key, is the deserialized form composed of the deserialized scalar (a u8 of length 32) followed by the deserialized derivation key (also a u8 of length 32)? For the pub key, is it the same thing but the deserialized point instead of the scalar? |
Yes:
Now that Xpub holds a decompressed point, the |
(clicked wrong button) |
Resolved by #228 |
For both
Xprv
andXpub
types:::to_bytes(&self) -> [u8; 64]
::from_bytes(&[u8]) -> Option<Self>
(checking that slice is exactly 64-byte-long)For later: implement Serde on top of these (example)
Note: the
from_bytes
won't benefit from using fixed-length array ([u8; 64]
) because at leastXprv
would still have to check if scalar is canonically encoded. So we might as well make decoding of all of these failable and take byteslices to let user not to make extra 64-byte copies.The text was updated successfully, but these errors were encountered: