Expand description
Secure Bitcoin address generation and cryptographic key management.
This library provides a type-safe implementation of BIP32-compliant Bitcoin address generation with cryptographically secure entropy, automatic memory zeroization for sensitive data, and P2PKH address support for mainnet and testnet.
§Quick Example
use btcaddr::{entropy::Entropy, seed::Seed, network::Network};
use btcaddr::address::public_key_ext::PublicKeyExt;
use secp256k1::{Secp256k1, PublicKey};
let entropy = Entropy::new().expect("Failed to generate entropy");
let seed = Seed::from(entropy);
let secret_key = seed.secret_key().expect("Failed to derive key");
let secp = Secp256k1::new();
let public_key = PublicKey::from_secret_key(&secp, &secret_key);
let address = public_key.to_p2pkh_address(Network::Mainnet);
println!("Address: {}", address);