Trait kaspa_bip32::PrivateKey
source · pub trait PrivateKey: Sized {
type PublicKey: PublicKey;
// Required methods
fn from_bytes(bytes: &PrivateKeyBytes) -> Result<Self>;
fn to_bytes(&self) -> PrivateKeyBytes;
fn derive_child(&self, other: PrivateKeyBytes) -> Result<Self>;
fn public_key(&self) -> Self::PublicKey;
}
Required Associated Types§
Required Methods§
sourcefn from_bytes(bytes: &PrivateKeyBytes) -> Result<Self>
fn from_bytes(bytes: &PrivateKeyBytes) -> Result<Self>
Initialize this key from bytes.
sourcefn to_bytes(&self) -> PrivateKeyBytes
fn to_bytes(&self) -> PrivateKeyBytes
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 the a provided tweak value,
i.e. where other
is referred to as “I sub L” in BIP32 and sourced
from the left half of the HMAC-SHA-512 output.
sourcefn public_key(&self) -> Self::PublicKey
fn public_key(&self) -> Self::PublicKey
Get the Self::PublicKey
that corresponds to this private key.
Object Safety§
This trait is not object safe.