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, }
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
impl ExtendedPrivKey
[src]
impl ExtendedPrivKey
[src]pub fn new_master(
network: Network,
seed: &[u8]
) -> Result<ExtendedPrivKey, Error>
[src]
network: Network,
seed: &[u8]
) -> Result<ExtendedPrivKey, Error>
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>
[src]
&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>
[src]
&self,
secp: &Secp256k1<C>,
i: ChildNumber
) -> Result<ExtendedPrivKey, Error>
Private->Private child key derivation
pub fn decode(data: &[u8]) -> Result<ExtendedPrivKey, Error>
[src]
Decoding extended private key from binary data according to BIP 32
pub fn encode(&self) -> [u8; 78]
[src]
Extended private key binary encoding according to BIP 32
pub fn identifier<C: Signing>(&self, secp: &Secp256k1<C>) -> XpubIdentifier
[src]
Returns the HASH160 of the public key belonging to the xpriv
pub fn fingerprint<C: Signing>(&self, secp: &Secp256k1<C>) -> Fingerprint
[src]
Returns the first four bytes of the identifier
Trait Implementations
impl Clone for ExtendedPrivKey
[src]
impl Clone for ExtendedPrivKey
[src]fn clone(&self) -> ExtendedPrivKey
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'de> Deserialize<'de> for ExtendedPrivKey
[src]
impl<'de> Deserialize<'de> for ExtendedPrivKey
[src]fn deserialize<D>(deserializer: D) -> Result<ExtendedPrivKey, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl FromStr for ExtendedPrivKey
[src]
impl FromStr for ExtendedPrivKey
[src]impl PartialEq<ExtendedPrivKey> for ExtendedPrivKey
[src]
impl PartialEq<ExtendedPrivKey> for ExtendedPrivKey
[src]fn eq(&self, other: &ExtendedPrivKey) -> bool
[src]
fn ne(&self, other: &ExtendedPrivKey) -> bool
[src]
impl<'de> Serialize for ExtendedPrivKey
[src]
impl<'de> Serialize for ExtendedPrivKey
[src]