pub struct ExtendedPublicKey { /* private fields */ }
Expand description
A wrapper around PublicKey
to allow Hierarchical Deterministic Wallets
public key derivation.
Implementations§
Source§impl ExtendedPublicKey
impl ExtendedPublicKey
Sourcepub fn new_master(
public_key: PublicKey,
chain_code: [u8; 32],
) -> ExtendedPublicKey
pub fn new_master( public_key: PublicKey, chain_code: [u8; 32], ) -> ExtendedPublicKey
Construct a new master public key.
Sourcepub fn get_public_key(&self) -> &PublicKey
pub fn get_public_key(&self) -> &PublicKey
Get the underlying PublicKey
.
Sourcepub fn into_public_key(self) -> PublicKey
pub fn into_public_key(self) -> PublicKey
Convert into the underlying PublicKey
.
Sourcepub fn derive_public_path<C, P>(
&self,
secp: &Secp256k1<C>,
path: &P,
) -> Result<ExtendedPublicKey, DeriveError>
pub fn derive_public_path<C, P>( &self, secp: &Secp256k1<C>, path: &P, ) -> Result<ExtendedPublicKey, DeriveError>
Attempts to derive an ExtendedPublicKey
from a path.
The path
must consist of an iterable collection of ChildNumber
s.
Sourcepub fn derive_public_child<C>(
&self,
secp: &Secp256k1<C>,
child_number: ChildNumber,
) -> Result<ExtendedPublicKey, DeriveError>where
C: Verification,
pub fn derive_public_child<C>(
&self,
secp: &Secp256k1<C>,
child_number: ChildNumber,
) -> Result<ExtendedPublicKey, DeriveError>where
C: Verification,
Derive the child ExtendedPublicKey
from a ChildNumber
.
Trait Implementations§
Source§impl Clone for ExtendedPublicKey
impl Clone for ExtendedPublicKey
Source§fn clone(&self) -> ExtendedPublicKey
fn clone(&self) -> ExtendedPublicKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ExtendedPublicKey
impl Debug for ExtendedPublicKey
Source§impl PartialEq for ExtendedPublicKey
impl PartialEq for ExtendedPublicKey
impl Copy for ExtendedPublicKey
impl Eq for ExtendedPublicKey
impl StructuralPartialEq for ExtendedPublicKey
Auto Trait Implementations§
impl Freeze for ExtendedPublicKey
impl RefUnwindSafe for ExtendedPublicKey
impl Send for ExtendedPublicKey
impl Sync for ExtendedPublicKey
impl Unpin for ExtendedPublicKey
impl UnwindSafe for ExtendedPublicKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.