Trait iop_keyvault::ExtendedPrivateKey[][src]

pub trait ExtendedPrivateKey<C: KeyDerivationCrypto + ?Sized>: Clone {
    fn derive_normal_child(&self, idx: i32) -> Result<C::ExtendedPrivateKey>;
fn derive_hardened_child(&self, idx: i32) -> Result<C::ExtendedPrivateKey>;
fn neuter(&self) -> C::ExtendedPublicKey;
fn private_key(&self) -> C::PrivateKey; }

Extended private key not only contains a private key, but also a chain code that is some additional entropy that is used to derive child keys. Some cryptographic suites implement both normal (public) and hardened (private) derivation, some, like Ed25519 is missing normal derivation and just err when called.

An extended private key can be neutered to an extended public key, which contains the same chain code, but its public key part does not reveal any information about the private key.

Required methods

fn derive_normal_child(&self, idx: i32) -> Result<C::ExtendedPrivateKey>[src]

Normal derivation allows the neutered extended public key to calculate child extended public keys without revealing any private keys.

fn derive_hardened_child(&self, idx: i32) -> Result<C::ExtendedPrivateKey>[src]

Hardened derivation makes it impossible to the neutered extended public key to calculate children. It uses a different derivation algorithm.

fn neuter(&self) -> C::ExtendedPublicKey[src]

Neutering an extended private key gives an extended public key that contains the private key neutered, plus the chain code. It is useless to reveal the chain code when hardened derivation is used.

fn private_key(&self) -> C::PrivateKey[src]

Throws away the chain code and gives back only the private key from the extended private key.

Loading content...

Implementors

impl ExtendedPrivateKey<Ed25519> for EdExtPrivateKey[src]

fn derive_hardened_child(&self, idx: i32) -> Result<EdExtPrivateKey>[src]

There is a potential vulnerability in that might affect all SLIP-0010 compatible Ed25519 wallets. We should never assume that there is only 1 public key that can verify a given signature. Actually, there are 8 public keys.

impl ExtendedPrivateKey<Secp256k1> for SecpExtPrivateKey[src]

Loading content...