Struct coins_bip32::xkeys::XPriv
source · [−]pub struct XPriv { /* private fields */ }
Expand description
A BIP32 eXtended Privkey
Implementations
sourceimpl XPriv
impl XPriv
sourcepub fn new(key: SigningKey, xkey_info: XKeyInfo) -> Self
pub fn new(key: SigningKey, xkey_info: XKeyInfo) -> Self
Instantiate a new XPriv.
sourcepub fn verify_key(&self) -> XPub
pub fn verify_key(&self) -> XPub
Derive the associated XPub
sourcepub fn fingerprint(&self) -> KeyFingerprint
pub fn fingerprint(&self) -> KeyFingerprint
The fingerprint is the first 4 bytes of the HASH160 of the public key
sourcepub fn root_node(
hmac_key: &[u8],
data: &[u8],
hint: Option<Hint>
) -> Result<XPriv, Bip32Error>
pub fn root_node(
hmac_key: &[u8],
data: &[u8],
hint: Option<Hint>
) -> Result<XPriv, Bip32Error>
Generate a customized root node
sourcepub fn root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<XPriv, Bip32Error>
pub fn root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<XPriv, Bip32Error>
Generate a root node from some seed data. Uses the BIP32-standard hmac key.
Important:
Use a seed of AT LEAST 128 bits.
sourcepub fn custom_root_node(
hmac_key: &[u8],
data: &[u8],
hint: Option<Hint>
) -> Result<XPriv, Bip32Error>
pub fn custom_root_node(
hmac_key: &[u8],
data: &[u8],
hint: Option<Hint>
) -> Result<XPriv, Bip32Error>
Instantiate a root node using a custom HMAC key.
sourcepub fn custom_root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<XPriv, Bip32Error>
pub fn custom_root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<XPriv, Bip32Error>
Generate a root node from some seed data. Uses the BIP32-standard hmac key.
Important:
Use a seed of AT LEAST 128 bits.
sourcepub fn derive_path<E, P>(&self, p: P) -> Result<Self, Bip32Error> where
E: Into<Bip32Error>,
P: TryInto<DerivationPath, Error = E>,
pub fn derive_path<E, P>(&self, p: P) -> Result<Self, Bip32Error> where
E: Into<Bip32Error>,
P: TryInto<DerivationPath, Error = E>,
Derive a series of child indices. Allows traversing several levels of the tree at once. Accepts an iterator producing u32, or a string.
Trait Implementations
sourceimpl AsRef<SigningKey> for XPriv
impl AsRef<SigningKey> for XPriv
sourcefn as_ref(&self) -> &SigningKey
fn as_ref(&self) -> &SigningKey
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl AsRef<XPriv> for DerivedXPriv
impl AsRef<XPriv> for DerivedXPriv
sourceimpl<'de> Deserialize<'de> for XPriv
impl<'de> Deserialize<'de> for XPriv
sourcefn deserialize<D>(deserializer: D) -> Result<XPriv, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<XPriv, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<D> DigestSigner<D, Signature<Secp256k1>> for XPriv where
D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
impl<D> DigestSigner<D, Signature<Secp256k1>> for XPriv where
D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
sourcefn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
sourcefn sign_digest(&self, digest: D) -> S
fn sign_digest(&self, digest: D) -> S
sourceimpl<D> DigestSigner<D, Signature> for XPriv where
D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
impl<D> DigestSigner<D, Signature> for XPriv where
D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
sourcefn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
sourcefn sign_digest(&self, digest: D) -> S
fn sign_digest(&self, digest: D) -> S
sourceimpl Parent for XPriv
impl Parent for XPriv
sourcefn derive_child(&self, index: u32) -> Result<Self, Bip32Error>
fn derive_child(&self, index: u32) -> Result<Self, Bip32Error>
Derive the child at index
. Note that this may produce the child at
index+1
in rare circumstances. For public keys this will derive public
children. For private keys it will derive private children. Read more
sourcefn derive_path<E, P>(&self, p: P) -> Result<Self, Bip32Error> where
E: Into<Bip32Error>,
P: TryInto<DerivationPath, Error = E>,
fn derive_path<E, P>(&self, p: P) -> Result<Self, Bip32Error> where
E: Into<Bip32Error>,
P: TryInto<DerivationPath, Error = E>,
Derive a series of child indices. Allows traversing several levels of the tree at once. Accepts an iterator producing u32, or a string. Read more
Auto Trait Implementations
impl RefUnwindSafe for XPriv
impl Send for XPriv
impl Sync for XPriv
impl Unpin for XPriv
impl UnwindSafe for XPriv
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more