Struct coins_bip32::derived::DerivedXPriv
source · [−]pub struct DerivedXPriv { /* private fields */ }
Expand description
An XPriv with its derivation.
Implementations
sourceimpl DerivedXPriv
impl DerivedXPriv
sourcepub fn new(xpriv: XPriv, derivation: KeyDerivation) -> Self
pub fn new(xpriv: XPriv, derivation: KeyDerivation) -> Self
Instantiate a derived XPub from the XPub and derivatin. This usually should not be called directly. Prefer deriving keys from parents.
sourcepub fn is_private_ancestor_of(
&self,
other: &DerivedXPub
) -> Result<bool, Bip32Error>
pub fn is_private_ancestor_of(
&self,
other: &DerivedXPub
) -> Result<bool, Bip32Error>
Check if this XPriv is the private ancestor of some other derived key. To check ancestry of another private key, derive its public key first
sourcepub fn root_node(
hmac_key: &[u8],
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, Bip32Error>
pub fn root_node(
hmac_key: &[u8],
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, Bip32Error>
Generate a customized root node using the stati
sourcepub fn root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, Bip32Error>
pub fn root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, 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<DerivedXPriv, Bip32Error>
pub fn custom_root_node(
hmac_key: &[u8],
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, Bip32Error>
Instantiate a root node using a custom HMAC key.
sourcepub fn custom_root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, Bip32Error>
pub fn custom_root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, 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 verify_key(&self) -> DerivedXPub
pub fn verify_key(&self) -> DerivedXPub
Derive the corresponding xpub
Trait Implementations
sourceimpl AsRef<SigningKey> for DerivedXPriv
impl AsRef<SigningKey> for DerivedXPriv
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<XKeyInfo> for DerivedXPriv
impl AsRef<XKeyInfo> for DerivedXPriv
sourceimpl AsRef<XPriv> for DerivedXPriv
impl AsRef<XPriv> for DerivedXPriv
sourceimpl Clone for DerivedXPriv
impl Clone for DerivedXPriv
sourcefn clone(&self) -> DerivedXPriv
fn clone(&self) -> DerivedXPriv
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DerivedXPriv
impl Debug for DerivedXPriv
sourceimpl DerivedKey for DerivedXPriv
impl DerivedKey for DerivedXPriv
sourcefn derivation(&self) -> &KeyDerivation
fn derivation(&self) -> &KeyDerivation
Return this key’s derivation
sourcefn same_root<K: DerivedKey>(&self, other: &K) -> bool
fn same_root<K: DerivedKey>(&self, other: &K) -> bool
true
if the keys share a root fingerprint, false
otherwise. Note that on key
fingerprints, which may collide accidentally, or be intentionally collided. Read more
sourcefn is_possible_ancestor_of<K: DerivedKey>(&self, other: &K) -> bool
fn is_possible_ancestor_of<K: DerivedKey>(&self, other: &K) -> bool
true
if this key is a possible ancestor of the argument, false
otherwise. Read more
sourcefn path_to_descendant<K: DerivedKey>(&self, other: &K) -> Option<DerivationPath>
fn path_to_descendant<K: DerivedKey>(&self, other: &K) -> Option<DerivationPath>
Returns the path to the descendant, or None
if the argument is definitely not a
descendant. Read more
sourceimpl<'de> Deserialize<'de> for DerivedXPriv
impl<'de> Deserialize<'de> for DerivedXPriv
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<D> DigestSigner<D, Signature<Secp256k1>> for DerivedXPriv where
D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
impl<D> DigestSigner<D, Signature<Secp256k1>> for DerivedXPriv 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 DerivedXPriv where
D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
impl<D> DigestSigner<D, Signature> for DerivedXPriv 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 DerivedXPriv
impl Parent for DerivedXPriv
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
sourceimpl Serialize for DerivedXPriv
impl Serialize for DerivedXPriv
Auto Trait Implementations
impl RefUnwindSafe for DerivedXPriv
impl Send for DerivedXPriv
impl Sync for DerivedXPriv
impl Unpin for DerivedXPriv
impl UnwindSafe for DerivedXPriv
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