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§

source

fn from_bytes(bytes: PublicKeyBytes) -> Result<Self>

Initialize this key from bytes.

source

fn to_bytes(&self) -> PublicKeyBytes

Serialize this key as bytes.

source

fn derive_child(&self, other: PrivateKeyBytes) -> Result<Self>

Derive a child key from a parent key and a provided tweak value.

Provided Methods§

source

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.

Implementations on Foreign Types§

source§

impl PublicKey for PublicKey

Implementors§