btc_wallet_manager
Bitcoin Wallet Manager Module
Handles HD wallet creation, derivation, and encrypted storage in Redis. Supports BIP39 mnemonics and BIP84 derivation paths (m/84’/0’/0’/0/x) for Native SegWit.
- class btc_wallet_manager.BTCWalletManager[source]
Bases:
objectManages Bitcoin HD wallets with encrypted storage in Redis.
Features: - BIP39 mnemonic generation and import - BIP84 derivation (m/84’/0’/0’/0/x) for Native SegWit - AES-256-GCM encryption for seeds at rest - Per-user wallet isolation - Address caching for derived addresses
Accepts an async Redis client via method parameters for v3 compatibility.
- async create_wallet(user_id, wallet_name, mnemonic, redis_client, network='bitcoin')[source]
Create a new wallet.
- async derive_address(user_id, wallet_name, index, redis_client, address_type='bech32')[source]
Derive address.
- async get_private_key(user_id, wallet_name, redis_client, index=0)[source]
Retrieve the private key.