Metadata-Version: 2.4
Name: cryptowall
Version: 1.0.0
Summary: Cryptocurrency Wallet Compact Library
Home-page: https://github.com/asinerum/cryptowall
Author: Asinerum Conlang Project
Author-email: asinerum.com@gmail.com
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ecdsa>=0.19.1
Requires-Dist: base58>=2.1.1
Requires-Dist: pynacl>=1.6.2
Requires-Dist: cryptography>=46.0.3
Dynamic: license-file

# CRYPTOWALL: THE SIMPLEST CRYPTOCURRENCY WALLET LIBRARY
SUPPORTED COINS: BTC, ETH, BCH, LTC, DOGE, DASH, XRP, SOL, TON

## Installation
```bash
pip install cryptowall
```

## Usage
```bash
import cryptowall as cw
cw.create_wallet("BCH", "VeryStrongPassword", "./tmp")
```

## Functions
- **generate_hex_private_key()**  
  Generate a cryptographically secure random 32-byte private key.  
  Returns a 64-character hex string valid for all supported coins.
- **hex_to_wif(hex_priv: str, coin: str, compressed: bool)**  
  Convert hex private key to Wallet Import Format (WIF)
  for BTC, BCH, LTC, DOGE, DASH.
- **convert_private_key(hex_priv: str, coin: str)**  
  Convert a hex private key to the native format(s) used by *coin*.  
  Returns a dict with at least 'hex' and coin-specific format keys.
- **generate_rsa_keypair(key_size: int)**  
  Generate an RSA key pair.  
  Returns (pem_private_key, pem_public_key) as PEM strings.
- **encrypt_private_key(hex_priv: str, password: str)**  
  Encrypt a hex private key using a *hybrid RSA plus AES-GCM* scheme:  
  - Derive a 256-bit AES key from *password* via PBKDF2-HMAC-SHA256,
  - Encrypt the private key bytes with AES-256-GCM,
  - Generate a fresh 2048-bit RSA key pair,
  - RSA-OAEP encrypt the AES key plus salt together.  
  Returns a dict with all material needed for decryption except
  the RSA private key, which the caller must store securely.
- **decrypt_private_key(encrypted: Dict[str, str], password: str)**  
  Reverse of *encrypt_private_key*, encrypted must be the dict returned by *encrypt_private_key*.  
  Returns the hex private key string.
- **generate_public_key_and_address(hex_priv: str, coin: str)**  
  Derive the public key and wallet address for *coin* from a hex private key.  
  Returns a dict with 'public_key' and 'address' (plus any extras).
- **save_wallet_to_json(coin: str, hex_priv: str, password: str, output_path: str)**  
  Full pipeline:  
  - Encrypt the hex private key,
  - Derive public key and address,
  - Write JSON file with public key, address, encrypted private key.  
  Returns the path of the written JSON file.  
  The RSA private key (required for decryption) is stored in a separate *_rsa_private_key.pem* file.
- **create_wallet(coin: str, password: str, output_dir: str)**  
  Generate a complete wallet for *coin*:  
  - Random private key,
  - All key formats,
  - Public key and address,
  - Encrypted private key,
  - Saved JSON and PEM files.  
  Returns a summary dict.

Detailed tips, tricks, and examples, can be found at project's repository
https://github.com/asinerum/cryptowall

(C) 2026 Asinerum Conlang Project
