Libit - Professional Multi-Cryptocurrency Wallet Library

A professional, fast and comprehensive Python library for multi-cryptocurrency wallet generation and management. Supports Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, Dash, Ethereum, and Tron networks with all address formats.
Features
- 9 Cryptocurrencies: Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, Dash, Zcash, Vertcoin, Ethereum, Tron
- All Address Types: Legacy, Script, SegWit (where supported)
- Ultra-Short Function Names: Minimal API like
btc()
, eth()
, valid()
, check()
- Professional DataClasses: Type-safe structure with comprehensive error handling
- Enhanced Validation: Auto-detect and validate all supported cryptocurrencies
- Bulk Operations: Generate multiple wallets efficiently
- Secure Generation: Cryptographically secure random key generation
- Full Backward Compatibility: All legacy functions still work
Installation
pip install libit --upgrade
Quick Start
Multi-Cryptocurrency Wallet
from libit import gen_key, multi_wallet
private_key = gen_key()
wallet = multi_wallet(private_key)
btc = wallet.btc()
ltc = wallet.ltc()
doge = wallet.doge()
bch = wallet.bch()
dash = wallet.dash()
eth = wallet.eth()
trx = wallet.trx()
print(f"BTC Legacy: {btc.addresses.legacy}")
print(f"LTC Legacy: {ltc.addresses.legacy}")
print(f"ETH Address: {eth['address']}")
Individual Coin Wallets
from libit import btc_wallet, ltc_wallet, doge_wallet, eth_wallet
private_key = "your_private_key_here"
Individual wallets with short function names
Ultra-Short Function Names
Generate wallets with minimal code:
from libit import btc, ltc, doge, bch, dash, zcash, vtc, eth, trx
btc_wallet = btc()
ltc_wallet = ltc()
doge_wallet = doge()
eth_wallet = eth()
trx_wallet = trx()
print(f"Bitcoin: {btc_wallet.addresses.legacy}")
print(f"Litecoin: {ltc_wallet.addresses.legacy}")
print(f"Dogecoin: {doge_wallet.addresses.legacy}")
print(f"Ethereum: {eth_wallet['address']}")
print(f"Tron: {trx_wallet['address']}")
Traditional Function Names
from libit import gen_key, btc_wallet, ltc_wallet, doge_wallet, eth_wallet
private_key = gen_key()
btc = btc_wallet(private_key)
ltc = ltc_wallet(private_key)
doge = doge_wallet(private_key)
eth = eth_wallet(private_key)
print(f"Bitcoin: {btc.addresses.legacy}")
print(f"Litecoin: {ltc.addresses.legacy}")
print(f"Dogecoin: {doge.addresses.legacy}")
print(f"Ethereum: {eth['address']}")
Address Validation
Enhanced validation with ultra-short function names:
from libit import check_addr, is_valid, valid, coin_type, check
result = check_addr("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa")
print(f"Valid: {result.valid}")
print(f"Coin: {result.coin}")
print(f"Type: {result.addr_type}")
is_valid_addr = valid("bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4")
detected_coin = coin_type("LdP8Qox1VAhCzLJNqrr74YovaWYyNBUWvL")
quick_check = check("DQE1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa")
print(f"valid() → {is_valid_addr}")
print(f"coin_type() → {detected_coin}")
print(f"check() → {quick_check.coin}")
Bulk Wallet Generation
Generate multiple wallets efficiently:
from libit import gen_wallets, gen_multi_wallets
btc_wallets = gen_wallets(100, 'btc')
for wallet in btc_wallets[:3]:
print(f"BTC: {wallet.addresses.legacy}")
ltc_wallets = gen_wallets(50, 'ltc')
multi_wallets = gen_multi_wallets(10)
for wallet in multi_wallets[:2]:
print(f"BTC: {wallet['btc']['addresses']['legacy']}")
print(f"ETH: {wallet['eth']['address']}")
print(f"ZEC: {wallet['zcash']['addresses']['legacy']}")
Multi-Wallet Manager
Use one private key for all cryptocurrencies:
from libit import multi_wallet, gen_key
multi = multi_wallet()
key = gen_key()
multi = multi_wallet(key)
btc_info = multi.btc()
ltc_info = multi.ltc()
eth_info = multi.eth()
zcash_info = multi.zcash()
all_wallets = multi.all()
print(f"Generated wallets for {len(all_wallets)} cryptocurrencies")
Supported Cryptocurrencies
Bitcoin | BTC | ✅ (1...) | ✅ (3...) | ✅ (bc1...) | btc() | btc_wallet() |
Litecoin | LTC | ✅ (L...) | ✅ (M...) | ✅ (ltc1...) | ltc() | ltc_wallet() |
Dogecoin | DOGE | ✅ (D...) | ✅ (9...) | ❌ | doge() | doge_wallet() |
Bitcoin Cash | BCH | ✅ (1...) | ✅ (3...) | ❌ | bch() | bch_wallet() |
Dash | DASH | ✅ (X...) | ✅ (7...) | ❌ | dash() | dash_wallet() |
Zcash | ZEC | ✅ (t1...) | ✅ (t3...) | ❌ | zcash() | zcash_wallet() |
Vertcoin | VTC | ✅ (V...) | ✅ (3...) | ✅ (vtc1...) | vtc() | vtc_wallet() |
Ethereum | ETH | ✅ (0x...) | ❌ | ❌ | eth() | eth_wallet() |
Tron | TRX | ✅ (T...) | ❌ | ❌ | trx() | trx_wallet() |
Quick API Reference
Ultra-Short Functions
from libit import btc, ltc, doge, eth, trx, valid, check, coin_type
btc_wallet = btc()
eth_wallet = eth()
is_valid = valid("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa")
coin = coin_type("bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4")
result = check("LdP8Qox1VAhCzLJNqrr74YovaWYyNBUWvL")
Professional DataClasses
The library uses Python dataclasses for better structure and type safety. Each wallet function returns a structured WalletInfo
dataclass, and validation functions return a ValidationResult
dataclass.
from libit import WalletInfo, ValidationResult, AddressSet
wallet = btc()
print(wallet.addresses.legacy)
print(wallet.to_dict())
result = check("address")
print(result.valid, result.coin, result.addr_type)
Bulk Generation
Bulk Generation
Generate multiple wallets efficiently:
from libit import gen_wallets, gen_multi_wallets
btc_wallets = gen_wallets(100, 'btc')
ltc_wallets = gen_wallets(50, 'ltc')
multi_wallets = gen_multi_wallets(10)
Advanced Usage
Advanced usage includes complete multi-wallet access and professional data structure:
Complete Multi-Wallet Access
Create a multi-wallet that supports all cryptocurrencies with a single private key:
from libit import multi_wallet
wallet = multi_wallet("your_private_key_here")
all_coins = wallet.all_coins()
btc_info = wallet.btc()
print(f"BTC WIF: {btc_info.wif}")
print(f"BTC Decimal: {btc_info.decimal}")
print(f"Legacy: {btc_info.addresses.legacy}")
print(f"Script: {btc_info.addresses.script}")
DataClass Benefits
The library uses Python dataclasses for better structure:
from libit import btc_wallet
wallet = btc_wallet("private_key_here")
print(f"Network: {wallet.network}")
print(f"Compressed: {wallet.compressed}")
print(f"WIF: {wallet.wif}")
addresses = wallet.addresses
print(f"Legacy: {addresses.legacy}")
print(f"Script: {addresses.script}")
Backward Compatibility
All legacy functions continue to work:
from libit import Bitcoin
wallet = Bitcoin("private_key")
addresses = wallet.get_all_addresses()
from libit import privatekey_addr, generate_bitcoin_wallet
addr = privatekey_addr("private_key")
new_wallet = generate_bitcoin_wallet()
from libit import Ethereum, tron
eth = Ethereum("private_key")
trx = tron("private_key")
Security Features
- Cryptographically Secure: Uses
secrets
module for random number generation
- Input Validation: Comprehensive validation of all inputs with proper error handling
- DataClass Safety: Type-safe data structures prevent runtime errors
- No External Dependencies: Minimal dependencies for maximum security
- Professional Error Handling: Graceful error handling with informative messages
Testing
Run the test suite:
python -m pytest tests_enhanced.py -v
Or test basic functionality:
python examples_enhanced.py
API Reference
Core Functions
gen_key()
- Generate secure private key
multi_wallet(key)
- Create multi-cryptocurrency wallet
btc_wallet(key)
- Bitcoin wallet
ltc_wallet(key)
- Litecoin wallet
doge_wallet(key)
- Dogecoin wallet
bch_wallet(key)
- Bitcoin Cash wallet
dash_wallet(key)
- Dash wallet
eth_wallet(key)
- Ethereum wallet
trx_wallet(key)
- Tron wallet
Validation Functions
check_addr(address)
- Comprehensive address validation
is_valid(address)
- Quick validation check
get_coin_type(address)
- Auto-detect cryptocurrency
validate_multiple(addresses)
- Bulk validation
Bulk Generation
gen_wallets(count, coin_type)
- Generate multiple wallets for specific coin
gen_multi_wallets(count)
- Generate multiple multi-crypto wallets
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.
Support
⚠️ Disclaimer: This library is for educational and development purposes. Always ensure proper security practices when handling private keys and cryptocurrency assets in production environments.