Crate rustywallet_export

Crate rustywallet_export 

Source
Expand description

§rustywallet-export

Export private keys to various formats.

§Supported Formats

  • WIF - Wallet Import Format (compressed/uncompressed)
  • Hex - Raw hex string (with optional 0x prefix)
  • JSON - Structured JSON with address, WIF, hex, public key
  • CSV - Comma-separated values for batch export
  • Paper Wallet - Address + WIF pair for cold storage
  • BIP38 - Password-encrypted private key
  • BIP21 - Bitcoin URI format for QR codes

§Quick Start

use rustywallet_export::prelude::*;
use rustywallet_keys::prelude::PrivateKey;

let key = PrivateKey::random();

// Export to WIF
let wif = export_wif(&key, Network::Mainnet, true);
println!("WIF: {}", wif);

// Export to hex
let hex = export_hex(&key, HexOptions::new());
println!("Hex: {}", hex);

// Export to JSON
let json = export_json(&key, Network::Mainnet).unwrap();
println!("{}", json);

// Generate paper wallet
let paper = to_paper_wallet(&key, Network::Mainnet, AddressType::P2PKH).unwrap();
println!("Address: {}", paper.address);
println!("WIF: {}", paper.wif);

Re-exports§

pub use error::ExportError;
pub use error::Result;
pub use types::Network;
pub use types::HexOptions;
pub use types::KeyExport;
pub use types::CsvColumn;
pub use types::CsvOptions;
pub use types::PaperWallet;
pub use types::AddressType;
pub use types::Bip21Options;

Modules§

error
Error types for export operations.
prelude
Prelude module for convenient imports.
types
Types for export operations.

Functions§

export_bip38
Export a private key to BIP38 encrypted format.
export_csv
Export multiple private keys to CSV format.
export_hex
Export a private key to hex format.
export_json
Export a private key to JSON format.
export_json_batch
Export multiple private keys to JSON array.
export_wif
Export a private key to WIF format.
to_bip21_uri
Generate a BIP21 URI for a Bitcoin address.
to_paper_wallet
Generate paper wallet data from a private key.