pub struct AccountPrivKey(/* private fields */);
Expand description
A BIP44 private key at the account path level m/44'/<coin_type>'/<account>'
.
Implementations§
Source§impl AccountPrivKey
impl AccountPrivKey
Sourcepub fn from_seed<P: Parameters>(
params: &P,
seed: &[u8],
account: AccountId,
) -> Result<AccountPrivKey, Error>
pub fn from_seed<P: Parameters>( params: &P, seed: &[u8], account: AccountId, ) -> Result<AccountPrivKey, Error>
Performs derivation of the extended private key for the BIP44 path:
m/44'/<coin_type>'/<account>'
.
This produces the root of the derivation tree for transparent viewing keys and addresses for the provided account.
pub fn from_extended_privkey(extprivkey: ExtendedPrivateKey<SecretKey>) -> Self
pub fn to_account_pubkey(&self) -> AccountPubKey
Sourcepub fn derive_secret_key(
&self,
scope: TransparentKeyScope,
address_index: NonHardenedChildIndex,
) -> Result<SecretKey, Error>
pub fn derive_secret_key( &self, scope: TransparentKeyScope, address_index: NonHardenedChildIndex, ) -> Result<SecretKey, Error>
Derives the BIP44 private spending key for the child path
m/44'/<coin_type>'/<account>'/<scope>/<address_index>
.
Sourcepub fn derive_external_secret_key(
&self,
address_index: NonHardenedChildIndex,
) -> Result<SecretKey, Error>
pub fn derive_external_secret_key( &self, address_index: NonHardenedChildIndex, ) -> Result<SecretKey, Error>
Derives the BIP44 private spending key for the external (incoming payment) child path
m/44'/<coin_type>'/<account>'/0/<address_index>
.
Sourcepub fn derive_internal_secret_key(
&self,
address_index: NonHardenedChildIndex,
) -> Result<SecretKey, Error>
pub fn derive_internal_secret_key( &self, address_index: NonHardenedChildIndex, ) -> Result<SecretKey, Error>
Derives the BIP44 private spending key for the internal (change) child path
m/44'/<coin_type>'/<account>'/1/<address_index>
.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Returns the AccountPrivKey
serialized using the encoding for a
BIP 32 ExtendedPrivateKey, excluding the
4 prefix bytes.
Sourcepub fn from_bytes(b: &[u8]) -> Option<Self>
pub fn from_bytes(b: &[u8]) -> Option<Self>
Decodes the AccountPrivKey
from the encoding specified for a
BIP 32 ExtendedPrivateKey, excluding the
4 prefix bytes.
Trait Implementations§
Source§impl Clone for AccountPrivKey
impl Clone for AccountPrivKey
Source§fn clone(&self) -> AccountPrivKey
fn clone(&self) -> AccountPrivKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for AccountPrivKey
impl RefUnwindSafe for AccountPrivKey
impl Send for AccountPrivKey
impl Sync for AccountPrivKey
impl Unpin for AccountPrivKey
impl UnwindSafe for AccountPrivKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more