Trait grin_keychain::Keychain [−][src]
pub trait Keychain: Sync + Send + Clone {}Show methods
fn from_seed(seed: &[u8], is_test: bool) -> Result<Self, Error>; fn from_mnemonic(
word_list: &str,
extension_word: &str,
is_test: bool
) -> Result<Self, Error>; fn from_random_seed(is_test: bool) -> Result<Self, Error>; fn mask_master_key(&mut self, mask: &SecretKey) -> Result<(), Error>; fn root_key_id() -> Identifier; fn derive_key_id(
depth: u8,
d1: u32,
d2: u32,
d3: u32,
d4: u32
) -> Identifier; fn public_root_key(&self) -> PublicKey; fn derive_key(
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<SecretKey, Error>; fn commit(
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Commitment, Error>; fn blind_sum(&self, blind_sum: &BlindSum) -> Result<BlindingFactor, Error>; fn sign(
&self,
msg: &Message,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Signature, Error>; fn sign_with_blinding(
&self,
_: &Message,
_: &BlindingFactor
) -> Result<Signature, Error>; fn secp(&self) -> &Secp256k1;
Required methods
fn from_seed(seed: &[u8], is_test: bool) -> Result<Self, Error>
[src]
Generates a keychain from a raw binary seed (which has already been decrypted if applicable).
fn from_mnemonic(
word_list: &str,
extension_word: &str,
is_test: bool
) -> Result<Self, Error>
[src]
word_list: &str,
extension_word: &str,
is_test: bool
) -> Result<Self, Error>
Generates a keychain from a list of space-separated mnemonic words
fn from_random_seed(is_test: bool) -> Result<Self, Error>
[src]
Generates a keychain from a randomly generated seed. Mostly used for tests.
fn mask_master_key(&mut self, mask: &SecretKey) -> Result<(), Error>
[src]
XOR masks the keychain’s master key against another key
fn root_key_id() -> Identifier
[src]
Root identifier for that keychain
fn derive_key_id(depth: u8, d1: u32, d2: u32, d3: u32, d4: u32) -> Identifier
[src]
Derives a key id from the depth of the keychain and the values at each
depth level. See KeychainPath
for more information.
fn public_root_key(&self) -> PublicKey
[src]
The public root key
fn derive_key(
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<SecretKey, Error>
[src]
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<SecretKey, Error>
fn commit(
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Commitment, Error>
[src]
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Commitment, Error>
fn blind_sum(&self, blind_sum: &BlindSum) -> Result<BlindingFactor, Error>
[src]
fn sign(
&self,
msg: &Message,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Signature, Error>
[src]
&self,
msg: &Message,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Signature, Error>
fn sign_with_blinding(
&self,
_: &Message,
_: &BlindingFactor
) -> Result<Signature, Error>
[src]
&self,
_: &Message,
_: &BlindingFactor
) -> Result<Signature, Error>
fn secp(&self) -> &Secp256k1
[src]
Implementors
impl Keychain for ExtKeychain
[src]
impl Keychain for ExtKeychain
[src]fn from_random_seed(is_test: bool) -> Result<ExtKeychain, Error>
[src]
fn from_random_seed(is_test: bool) -> Result<ExtKeychain, Error>
[src]For testing - probably not a good idea to use outside of tests.
fn from_seed(seed: &[u8], is_test: bool) -> Result<ExtKeychain, Error>
[src]
fn from_mnemonic(
word_list: &str,
extension_word: &str,
is_test: bool
) -> Result<Self, Error>
[src]
word_list: &str,
extension_word: &str,
is_test: bool
) -> Result<Self, Error>
fn mask_master_key(&mut self, mask: &SecretKey) -> Result<(), Error>
[src]
fn root_key_id() -> Identifier
[src]
fn derive_key_id(depth: u8, d1: u32, d2: u32, d3: u32, d4: u32) -> Identifier
[src]
fn public_root_key(&self) -> PublicKey
[src]
fn derive_key(
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<SecretKey, Error>
[src]
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<SecretKey, Error>
fn commit(
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Commitment, Error>
[src]
&self,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Commitment, Error>
fn blind_sum(&self, blind_sum: &BlindSum) -> Result<BlindingFactor, Error>
[src]
fn sign(
&self,
msg: &Message,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Signature, Error>
[src]
&self,
msg: &Message,
amount: u64,
id: &Identifier,
switch: SwitchCommitmentType
) -> Result<Signature, Error>
fn sign_with_blinding(
&self,
msg: &Message,
blinding: &BlindingFactor
) -> Result<Signature, Error>
[src]
&self,
msg: &Message,
blinding: &BlindingFactor
) -> Result<Signature, Error>