ChildPubKey derive from ExtendedPubKey, or from ChildPrivKey
use hdwallet::{ExtendedPrivKey, ExtendedPubKey, ChildPubKey, KeyIndex};
let priv_key = ExtendedPrivKey::random().unwrap();
let pub_key = ExtendedPubKey::from_private_key(&priv_key).unwrap();
let normal_key_index = KeyIndex::Normal(0);
let child_pub_key = pub_key.derive_public_key(normal_key_index).unwrap();
let child_priv_key = priv_key.derive_private_key(KeyIndex::Normal(0)).unwrap();
assert_eq!(child_pub_key, ChildPubKey::from_private_key(&child_priv_key).unwrap());
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static