Struct iop_keyvault::Seed
source · [−]pub struct Seed { /* private fields */ }
Expand description
The seed used for BIP32 derivations. A seed cannot be turned back into a phrase, because there is salted hashing involed in creating it from the BIP39 mnemonic phrase.
Implementations
sourceimpl Seed
impl Seed
sourcepub const DEMO_PHRASE: &'static str = "include pear escape sail spy orange cute despair witness trouble sleep torch wire burst unable brass expose fiction drift clock duck oxygen aerobic already"
pub const DEMO_PHRASE: &'static str = "include pear escape sail spy orange cute despair witness trouble sleep torch wire burst unable brass expose fiction drift clock duck oxygen aerobic already"
A BIP39 phrase we use in most of the demo videos and proof-of-concept applications. Do not use it in production code.
sourcepub const PASSWORD: &'static str = "morpheus"
pub const PASSWORD: &'static str = "morpheus"
Legacy password used in the 0.0.1 version of the crate. Since 0.0.2 the crate always requires a password, which should be “” by default when the user does not provide one.
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Creates seed from a raw 512-bit binary seed
Example
let bytes = "86f07ba8b38f3de2080912569a07b21ca4ae2275bc305a14ff928c7dc5407f32a1a3a26d4e2c4d9d5e434209c1db3578d94402cf313f3546344d0e4661c9f8d9";
let seed_res = Seed::from_bytes(hex::decode(bytes).unwrap().as_slice());
assert!(seed_res.is_ok());
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Seed
impl<'de> Deserialize<'de> for Seed
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Seed
impl Send for Seed
impl Sync for Seed
impl Unpin for Seed
impl UnwindSafe for Seed
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more