You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

libit

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libit

Professional Bitcoin, Ethereum and Tron wallet generation library with support for multiple address formats

5.3.6
pipPyPI
Maintainers
1

Libit - Professional Multi-Cryptocurrency Wallet Library

Read the Docs GitHub commit check runs GitHub last commit GitHub commit activity GitHub top language PyPI - Downloads Website

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

# Generate secure private key
private_key = gen_key()
# Create multi-crypto wallet
wallet = multi_wallet(private_key)
# Access different cryptocurrencies
btc = wallet.btc()      # Bitcoin
ltc = wallet.ltc()      # Litecoin  
doge = wallet.doge()    # Dogecoin
bch = wallet.bch()      # Bitcoin Cash
dash = wallet.dash()    # Dash
eth = wallet.eth()      # Ethereum
trx = wallet.trx()      # Tron

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

# Auto-generate private keys and create wallets
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

# Generate with custom private key
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

# Traditional validation
result = check_addr("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa")
print(f"Valid: {result.valid}")
print(f"Coin: {result.coin}")
print(f"Type: {result.addr_type}")

# Ultra-short validation
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}")  # ltc
print(f"check() → {quick_check.coin}")   # doge

Bulk Wallet Generation

Generate multiple wallets efficiently:

from libit import gen_wallets, gen_multi_wallets

# Generate 100 Bitcoin wallets
btc_wallets = gen_wallets(100, 'btc')
for wallet in btc_wallets[:3]:  # Show first 3
    print(f"BTC: {wallet.addresses.legacy}")

# Generate 50 Litecoin wallets  
ltc_wallets = gen_wallets(50, 'ltc')

# Generate multi-cryptocurrency wallets
multi_wallets = gen_multi_wallets(10)
for wallet in multi_wallets[:2]:  # Show first 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

# Create multi-wallet (auto-generates key)
multi = multi_wallet()

# Or use custom key
key = gen_key()
multi = multi_wallet(key)

# Access individual cryptocurrencies
btc_info = multi.btc()
ltc_info = multi.ltc()
eth_info = multi.eth()
zcash_info = multi.zcash()

# Get all supported cryptocurrencies
all_wallets = multi.all()
print(f"Generated wallets for {len(all_wallets)} cryptocurrencies")

Supported Cryptocurrencies

CoinSymbolLegacyScriptSegWitShort FunctionFull Function
BitcoinBTC✅ (1...)✅ (3...)✅ (bc1...)btc()btc_wallet()
LitecoinLTC✅ (L...)✅ (M...)✅ (ltc1...)ltc()ltc_wallet()
DogecoinDOGE✅ (D...)✅ (9...)doge()doge_wallet()
Bitcoin CashBCH✅ (1...)✅ (3...)bch()bch_wallet()
DashDASH✅ (X...)✅ (7...)dash()dash_wallet()
ZcashZEC✅ (t1...)✅ (t3...)zcash()zcash_wallet()
VertcoinVTC✅ (V...)✅ (3...)✅ (vtc1...)vtc()vtc_wallet()
EthereumETH✅ (0x...)eth()eth_wallet()
TronTRX✅ (T...)trx()trx_wallet()

Quick API Reference

Ultra-Short Functions

from libit import btc, ltc, doge, eth, trx, valid, check, coin_type

# Generate wallets (auto-generates private keys)
btc_wallet = btc()
eth_wallet = eth()

# Validation
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

# All wallet functions return structured dataclasses
wallet = btc()  # Returns WalletInfo dataclass
print(wallet.addresses.legacy)  # Type-safe access
print(wallet.to_dict())  # Convert to dictionary

# Validation returns structured results
result = check("address")  # Returns ValidationResult dataclass
print(result.valid, result.coin, result.addr_type)

Bulk Generation

Bulk Generation

Generate multiple wallets efficiently:

from libit import gen_wallets, gen_multi_wallets

# Generate 100 Bitcoin wallets
btc_wallets = gen_wallets(100, 'btc')

# Generate 50 Litecoin wallets
ltc_wallets = gen_wallets(50, 'ltc')

# Generate 10 multi-cryptocurrency wallets
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")

# Get all cryptocurrencies at once
all_coins = wallet.all_coins()

# Access specific 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")

# Professional data structure
print(f"Network: {wallet.network}")
print(f"Compressed: {wallet.compressed}")
print(f"WIF: {wallet.wif}")

# Type-safe address access
addresses = wallet.addresses
print(f"Legacy: {addresses.legacy}")
print(f"Script: {addresses.script}")

Backward Compatibility

All legacy functions continue to work:

# Legacy Bitcoin class (still supported)
from libit import Bitcoin
wallet = Bitcoin("private_key")
addresses = wallet.get_all_addresses()

# Legacy functions (still supported)
from libit import privatekey_addr, generate_bitcoin_wallet
addr = privatekey_addr("private_key")
new_wallet = generate_bitcoin_wallet()

# Legacy Ethereum & Tron (still supported)
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.

Keywords

bitcoin

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts