export_bip38

Function export_bip38 

Source
pub fn export_bip38(
    key: &PrivateKey,
    password: &str,
    compressed: bool,
) -> Result<String>
Expand description

Export a private key to BIP38 encrypted format.

BIP38 keys start with ā€œ6Pā€ and are password-protected.

§Example

ā“˜
use rustywallet_export::{export_bip38, Network};
use rustywallet_keys::prelude::PrivateKey;

let key = PrivateKey::random();
let encrypted = export_bip38(&key, "mypassword", true).unwrap();
assert!(encrypted.starts_with("6P"));