Trait kaspa_bip32::PublicKey
source · pub trait PublicKey: Sized {
// Required methods
fn from_bytes(bytes: PublicKeyBytes) -> Result<Self>;
fn to_bytes(&self) -> PublicKeyBytes;
fn derive_child(&self, other: PrivateKeyBytes) -> Result<Self>;
// Provided method
fn fingerprint(&self) -> KeyFingerprint { ... }
}
Expand description
Trait for key types which can be derived using BIP32.
Required Methods§
sourcefn from_bytes(bytes: PublicKeyBytes) -> Result<Self>
fn from_bytes(bytes: PublicKeyBytes) -> Result<Self>
Initialize this key from bytes.
sourcefn to_bytes(&self) -> PublicKeyBytes
fn to_bytes(&self) -> PublicKeyBytes
Serialize this key as bytes.
sourcefn derive_child(&self, other: PrivateKeyBytes) -> Result<Self>
fn derive_child(&self, other: PrivateKeyBytes) -> Result<Self>
Derive a child key from a parent key and a provided tweak value.
Provided Methods§
sourcefn fingerprint(&self) -> KeyFingerprint
fn fingerprint(&self) -> KeyFingerprint
Compute a 4-byte key fingerprint for this public key.
Default implementation uses RIPEMD160(SHA256(public_key))
.
Object Safety§
This trait is not object safe.