Crate btcaddr

Crate btcaddr 

Source
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);

§Modules

  • address: P2PKH address generation with type-safe format handling
  • seed: BIP32 seed derivation using HMAC-SHA512
  • entropy: Cryptographically secure random number generation (OsRng)
  • network: Bitcoin network type definitions (Mainnet/Testnet)

Modules§

address
Bitcoin address generation and representation.
entropy
network
Bitcoin network type definitions.
seed