Struct tapyrus::util::bip32::ExtendedPrivKey
source · pub struct ExtendedPrivKey {
pub network: Network,
pub depth: u8,
pub parent_fingerprint: Fingerprint,
pub child_number: ChildNumber,
pub private_key: PrivateKey,
pub chain_code: ChainCode,
}
Expand description
Extended private key
Fields§
§network: Network
The network this key is to be used on
depth: u8
How many derivations this key is from the master (which is 0)
parent_fingerprint: Fingerprint
Fingerprint of the parent key (0 for master)
child_number: ChildNumber
Child number of the key used to derive from parent (0 for master)
private_key: PrivateKey
Private key
chain_code: ChainCode
Chain code
Implementations§
source§impl ExtendedPrivKey
impl ExtendedPrivKey
sourcepub fn new_master(
network: Network,
seed: &[u8]
) -> Result<ExtendedPrivKey, Error>
pub fn new_master( network: Network, seed: &[u8] ) -> Result<ExtendedPrivKey, Error>
Construct a new master key from a seed value
sourcepub fn derive_priv<C: Signing, P: AsRef<[ChildNumber]>>(
&self,
secp: &Secp256k1<C>,
path: &P
) -> Result<ExtendedPrivKey, Error>
pub fn derive_priv<C: Signing, P: AsRef<[ChildNumber]>>( &self, secp: &Secp256k1<C>, path: &P ) -> Result<ExtendedPrivKey, Error>
Attempts to derive an extended private key from a path.
The path
argument can be both of type DerivationPath
or Vec<ChildNumber>
.
sourcepub fn ckd_priv<C: Signing>(
&self,
secp: &Secp256k1<C>,
i: ChildNumber
) -> Result<ExtendedPrivKey, Error>
pub fn ckd_priv<C: Signing>( &self, secp: &Secp256k1<C>, i: ChildNumber ) -> Result<ExtendedPrivKey, Error>
Private->Private child key derivation
sourcepub fn identifier<C: Signing>(&self, secp: &Secp256k1<C>) -> XpubIdentifier
pub fn identifier<C: Signing>(&self, secp: &Secp256k1<C>) -> XpubIdentifier
Returns the HASH160 of the chaincode
sourcepub fn fingerprint<C: Signing>(&self, secp: &Secp256k1<C>) -> Fingerprint
pub fn fingerprint<C: Signing>(&self, secp: &Secp256k1<C>) -> Fingerprint
Returns the first four bytes of the identifier
Trait Implementations§
source§impl Clone for ExtendedPrivKey
impl Clone for ExtendedPrivKey
source§fn clone(&self) -> ExtendedPrivKey
fn clone(&self) -> ExtendedPrivKey
Returns a copy 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 ExtendedPrivKey
impl Debug for ExtendedPrivKey
source§impl Display for ExtendedPrivKey
impl Display for ExtendedPrivKey
source§impl FromStr for ExtendedPrivKey
impl FromStr for ExtendedPrivKey
source§impl PartialEq for ExtendedPrivKey
impl PartialEq for ExtendedPrivKey
source§fn eq(&self, other: &ExtendedPrivKey) -> bool
fn eq(&self, other: &ExtendedPrivKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for ExtendedPrivKey
impl Eq for ExtendedPrivKey
impl StructuralEq for ExtendedPrivKey
impl StructuralPartialEq for ExtendedPrivKey
Auto Trait Implementations§
impl RefUnwindSafe for ExtendedPrivKey
impl Send for ExtendedPrivKey
impl Sync for ExtendedPrivKey
impl Unpin for ExtendedPrivKey
impl UnwindSafe for ExtendedPrivKey
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,
Casts the value.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,
Casts the value.