# CryptoVault - Bootable Multi-Coin USB Cold Wallet

## Project Overview
Build from scratch: A physical USB drive that becomes a cold wallet with boot capability, multi-coin support, and CPU mining.

## Architecture

### Core Components

| File | Language | Purpose |
|------|----------|---------|
| `CryptoVault.py` | Python 3 | Main wallet application |
| `CryptoVault.c` | C (mingw-w64) | Windows executable stub |
| `BuildCryptoVault.bat` | Batch | Builds .exe from source on Windows |
| `CryptoVault-Flasher.py` | Python 3 | USB flashing tool (formats & installs) |

### Directory Structure

```
crypto-vault/
├── flasher/
│   ├── CryptoVault-Flasher.py   # USB formatter
│   ├── CryptoVault-Injector.py  # Builds auto-launch package
│   └── build-installer.py      # Wraps everything
├── wallet-app/                  # React/HTML wallet UI
├── os/                          # Bootable OS files
├── release/                      # Distribution package
│   ├── index.html               # Wallet web UI
│   ├── START.bat                # Auto-launch on USB insert
│   ├── autorun.inf              # Windows autorun config
│   ├── mine.bat                 # CPU mining script
│   ├── wallet-setup.reg         # Windows registry tweaks
│   ├── CryptoVault.py           # Python wallet source
│   ├── CryptoVault.c            # C source for .exe stub
│   └── BuildCryptoVault.bat     # Self-compile script
└── output/                      # Built USB contents
    ├── vault-os/                # Bootable Linux structure
    └── wallet-windows/          # Windows shell integration
```

## Building

### For End Users (Windows 11)
1. Download all files from release/
2. Run `BuildCryptoVault.bat` (NO admin required)
3. Takes ~2-5 minutes, produces `CryptoVault.exe`
4. Run `CryptoVault.exe` → Admin prompt → Formats USB → Done

### For Developers
```bash
# Python wallet
python3 flasher/CryptoVault-Flasher.py --build

# Compile C stub (Linux with mingw-w64)
x86_64-w64-mingw32-gcc release/CryptoVault.c -o release/CryptoVault.exe

# Build distribution zip
zip -r crypto-source.zip .
```

## Features

### Wallet App
- Multi-coin support: BTC, ETH, USDT, USDC, SOL, ARB, XRP, ADA, DOGE, LTC
- Password-protected keystore (AES-256)
- View balances, send transactions, transaction history
- QR code display for addresses
- Dark mode UI

### USB Flasher
- Auto-detect USB drives
- Format drive (FAT32/NTFS/exFAT)
- Install wallet app + auto-launch
- Configure Windows shell integration
- UAC admin prompt for full drive access

### Bootable OS
- Flash drive boots into custom Linux environment
- Offline wallet access
- No hot wallet exposure
- Shamir secret sharing backup

### Mining
- CPU mining built-in
- Mine directly to cold storage addresses
- Automatic coin selection

## Compilation

### BuildCryptoVault.bat Flow
1. Check Python installed → install if missing
2. Download CryptoVault.py if not present
3. Install PyInstaller
4. pyinstaller --uac-admin CryptoVault.py
5. Output: CryptoVault.exe (admin-required installer)

### CryptoVault.exe (Compiled)
- PyInstaller onefile bundle
- --uac-admin flag = requests admin on run
- Formats USB, installs all wallet files
- Sets up autorun, shell integration, boot files

## Supported Coins
- BTC (Bitcoin)
- ETH (Ethereum)
- USDT (Tether)
- USDC (USD Coin)
- SOL (Solana)
- ARB (Arbitrum)
- XRP (Ripple)
- ADA (Cardano)
- DOGE (Dogecoin)
- LTC (Litecoin)
- BNB (BNB Chain)
- DOT (Polkadot)
- MATIC (Polygon)
- AAVE (Aave)
- LINK (Chainlink)

## Security
- AES-256 encrypted keystore
- Password-derived encryption keys
- Shamir secret sharing for backups
- Cold storage only (no hot keys exposed)
- Secure enclave support (when available)

## License
MIT - Do whatever you want with it 🦜