pub struct CompactXpub {
pub parent_fingerprint: [u8; 4],
pub chain_code: [u8; 32],
pub public_key: [u8; 33],
}Expand description
The three components of a DIP-15 compact extended public key.
parent_fingerprint ‖ chain_code ‖ public_key is the 69-byte compact
form DIP-15 defines for encryptedPublicKey. A named struct (rather
than a ([u8; 4], [u8; 32], [u8; 33]) tuple) keeps the component
meaning explicit at every call site — the three byte arrays are
otherwise easy to mis-read.
Fields§
§parent_fingerprint: [u8; 4]4-byte fingerprint of the parent key.
chain_code: [u8; 32]32-byte chain code of the shared (account) key.
public_key: [u8; 33]33-byte compressed secp256k1 public key.
Implementations§
Source§impl CompactXpub
impl CompactXpub
Sourcepub fn to_bytes(&self) -> [u8; 69]
pub fn to_bytes(&self) -> [u8; 69]
Serialize to the 69-byte DIP-15 compact plaintext
(parent_fingerprint ‖ chain_code ‖ public_key). This is the
plaintext fed to encrypt_extended_public_key — not a
BIP32/DIP-14 serialization, which carries extra
version/depth/child-number metadata the wire format omits.
Trait Implementations§
Source§impl Clone for CompactXpub
impl Clone for CompactXpub
impl Copy for CompactXpub
Source§impl Debug for CompactXpub
impl Debug for CompactXpub
impl Eq for CompactXpub
Source§impl PartialEq for CompactXpub
impl PartialEq for CompactXpub
impl StructuralPartialEq for CompactXpub
Auto Trait Implementations§
impl Freeze for CompactXpub
impl RefUnwindSafe for CompactXpub
impl Send for CompactXpub
impl Sync for CompactXpub
impl Unpin for CompactXpub
impl UnsafeUnpin for CompactXpub
impl UnwindSafe for CompactXpub
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more