Struct bitcoin::util::bip32::ExtendedPrivKey [−][src]
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
Construct a new master key from a seed value
pub 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>
.
pub 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
Decoding extended private key from binary data according to BIP 32
Returns the HASH160 of the public key belonging to the xpriv
Returns the first four bytes of the identifier
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
Mutably borrows from an owned value. Read more