atlas_seed_derivable/lib.rs
1//! The interface by which keys are derived.
2#![cfg_attr(docsrs, feature(doc_cfg))]
3use {atlas_derivation_path::DerivationPath, std::error};
4
5/// The `SeedDerivable` trait defines the interface by which cryptographic keys/keypairs are
6/// derived from byte seeds, derivation paths, and passphrases.
7pub trait SeedDerivable: Sized {
8 fn from_seed(seed: &[u8]) -> Result<Self, Box<dyn error::Error>>;
9 fn from_seed_and_derivation_path(
10 seed: &[u8],
11 derivation_path: Option<DerivationPath>,
12 ) -> Result<Self, Box<dyn error::Error>>;
13 fn from_seed_phrase_and_passphrase(
14 seed_phrase: &str,
15 passphrase: &str,
16 ) -> Result<Self, Box<dyn error::Error>>;
17}