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: NetworkThe network this key is to be used on
depth: u8How many derivations this key is from the master (which is 0)
parent_fingerprint: FingerprintFingerprint of the parent key (0 for master)
child_number: ChildNumberChild number of the key used to derive from parent (0 for master)
private_key: PrivateKeyPrivate key
chain_code: ChainCodeChain 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 ExtendedPrivKeyimpl Send for ExtendedPrivKeyimpl Sync for ExtendedPrivKeyimpl Unpin for ExtendedPrivKeyimpl UnwindSafe for ExtendedPrivKeyBlanket Implementations
Mutably borrows from an owned value. Read more