[−][src]Struct hdwallet::extended_key::ExtendedPubKey
ExtendedPubKey is used for public child key derivation. See secp256k1 crate documentation for PublicKey signatures usage.
Examples
use hdwallet::{ExtendedPrivKey, ExtendedPubKey, KeyIndex}; let priv_key = ExtendedPrivKey::random().unwrap(); let pub_key = ExtendedPubKey::from_private_key(&priv_key); // Public hardened child key derivation from parent public key is impossible let hardened_key_index = KeyIndex::hardened_from_normalize_index(0).unwrap(); assert!(pub_key.derive_public_key(hardened_key_index).is_err()); // Derive public normal child key let normal_key_index = KeyIndex::Normal(0); assert!(pub_key.derive_public_key(normal_key_index).is_ok());
Fields
public_key: PublicKey
chain_code: Vec<u8>
Methods
impl ExtendedPubKey
[src]
pub fn derive_public_key(
&self,
key_index: KeyIndex
) -> Result<ExtendedPubKey, Error>
[src]
&self,
key_index: KeyIndex
) -> Result<ExtendedPubKey, Error>
Derive public normal child key from ExtendedPubKey, will return error if key_index is a hardened key.
pub fn from_private_key(extended_key: &ExtendedPrivKey) -> Self
[src]
ExtendedPubKey from ExtendedPrivKey
Trait Implementations
impl Clone for ExtendedPubKey
[src]
fn clone(&self) -> ExtendedPubKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ExtendedPubKey
[src]
impl<'_> Deserialize<&'_ [u8], Error> for ExtendedPubKey
[src]
impl Eq for ExtendedPubKey
[src]
impl PartialEq<ExtendedPubKey> for ExtendedPubKey
[src]
fn eq(&self, other: &ExtendedPubKey) -> bool
[src]
fn ne(&self, other: &ExtendedPubKey) -> bool
[src]
impl Serialize<Vec<u8>> for ExtendedPubKey
[src]
impl StructuralEq for ExtendedPubKey
[src]
impl StructuralPartialEq for ExtendedPubKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for ExtendedPubKey
impl Send for ExtendedPubKey
impl Sync for ExtendedPubKey
impl Unpin for ExtendedPubKey
impl UnwindSafe for ExtendedPubKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,