##\ ##\ ##\ ##\ ##\ ## | \__| ## | ## | ## | #######\ ##\ ######\ #######\ #######\ ######\ ######\ ## __##\ ## |\_## _| ## _____|## __##\ \____##\\_## _| ## | ## |## | ## | ## / ## | ## | ####### | ## | ## | ## |## | ## |##\ ## | ## | ## |## __## | ## |##\ ####### |## | \#### |\#######\ ## | ## |\####### | \#### | \_______/ \__| \____/ \_______|\___| \__| \_______| \____/
bitchat the terminal v1.0.0
Decentralized • Encrypted • Peer-to-Peer • Open Source | Written in Python
Python implementation of BitChat Terminal - a decentralized, encrypted, peer-to-peer chat application over Bluetooth LE.
- Decentralized: No central server required
- End-to-end Encryption: Uses X25519 + Ed25519 + ChaCha20-Poly1305
- Peer-to-Peer: Direct connection via Bluetooth LE
- Cross-platform: Compatible with Rust, iOS and Android versions
- Password-protected Channels: Support for private channels
- Message Fragmentation: Handles large messages
- Delivery Confirmation: Message delivery acknowledgments
- Terminal Interface: Simple command-line interface
- Python 3.11 or newer
- Bluetooth LE hardware
- Windows 10/11, macOS or Linux
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Linux/macOS
# or
venv\Scripts\activate # Windows
# Install dependencies
pip install -e .# Run normally
python -m src.main
# Or with debug mode
python -m src.main -d # Basic debug
python -m src.main -dd # Verbose debug/help- Show help/exit- Exit application/clear- Clear screen/status- Show connection status
/name <nickname>- Change nickname/online- See who's online/block @user- Block user/unblock @user- Unblock user
/j #channel- Join public channel/j #channel <password>- Join password-protected channel/channels- List discovered channels/leave- Leave current channel/pass <password>- Set channel password (owner only)/transfer @user- Transfer channel ownership
/dm <nickname>- Start DM with user/dm <nickname> <message>- Send direct private message/reply- Reply to last private message
/list- Show active conversations/switch- Interactive conversation switching1,2,3... - Quick switch by number
Simply type your message and press Enter to send to current context (public, channel, or DM).
src/
├── __init__.py # Package initialization
├── main.py # Entry point and main logic
├── encryption.py # Encryption handling (X25519, Ed25519, ChaCha20)
├── compression.py # Data compression (Zstandard)
├── fragmentation.py # Large message fragmentation
├── terminal_ux.py # Terminal interface and chat context
└── persistence.py # Settings and state storage
The Python Terminal implementation is based on the original Bitchat projects:
All use the same:
- Bluetooth LE service UUID:
F47B5E2D-4A9E-4C5A-9B3F-8E1D2C3A4B5C - Characteristic UUID:
A1B2C3D4-E5F6-4A5B-8C9D-0E1F2A3B4C5D - Binary protocol format
- Encryption algorithms
bleak- Bluetooth LE librarycryptography- Cryptographic operationspynacl- NaCl cryptography (Ed25519, X25519)pybloom-live- Bloom filter implementationzstandard- Fast compressioncolorama- Terminal colors
pytest- Testing frameworkblack- Code formatterflake8- Lintingmypy- Type checking
The application automatically saves settings at:
- Windows:
%APPDATA%\BitChat\state.json - macOS/Linux:
~/.config/bitchat/state.json
- Nickname
- Blocked users (by fingerprint)
- Channel creators and settings
- Password-protected channels (passwords encrypted)
- Identity key for encryption
- X25519 for key exchange
- Ed25519 for digital signatures
- ChaCha20-Poly1305 for symmetric encryption
- HKDF for key derivation
- Message padding to hide message length
- Cover traffic for iOS compatibility
- Local storage with encrypted passwords
- No telemetry or analytics
- Peer authentication via public key cryptography
- Message replay protection with bloom filters
- TTL-based message propagation
- Forward secrecy for ephemeral keys
# Linux: Ensure user has bluetooth permissions
sudo usermod -a -G bluetooth $USER
# Check Bluetooth service
systemctl status bluetooth- Windows: Run as Administrator if needed
- macOS: Allow app to access Bluetooth in System Preferences
- Linux: Ensure user is in
bluetoothgroup
# Basic debug - shows connection info
python -m src.main -d
# Verbose debug - shows all packet info
python -m src.main -ddgit clone https://github.com/bxdoan/py-bitchat
cd py-bitchat
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"pytest tests/black src/
flake8 src/
mypy src/- GUI wrapper with tkinter/PyQt
- File transfer support
- Voice message support
- Group calls
- Mobile notifications
- Plugin system
MIT License - see LICENSE file
All contributions are welcome! Please:
- Fork the repository
- Create feature branch
- Commit changes
- Push to branch
- Create Pull Request