pub struct ExtendedPrivKey {
pub network: Network,
pub depth: u8,
pub parent_fingerprint: Fingerprint,
pub child_number: ChildNumber,
pub secret_key: SecretKey,
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)
secret_key: SecretKey
Secret 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>(
&self,
secp: &Secp256k1<C>,
cnums: &[ChildNumber],
) -> Result<ExtendedPrivKey, Error>
pub fn derive_priv<C: Signing>( &self, secp: &Secp256k1<C>, cnums: &[ChildNumber], ) -> Result<ExtendedPrivKey, Error>
Attempts to derive an extended private key from a path.
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>) -> Hash
pub fn identifier<C: Signing>(&self, secp: &Secp256k1<C>) -> Hash
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 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 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
impl Copy for ExtendedPrivKey
impl Eq for ExtendedPrivKey
impl StructuralPartialEq for ExtendedPrivKey
Auto Trait Implementations§
impl Freeze for ExtendedPrivKey
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