Skip to main content

A Python CLI port of bitchat: serverless peer-to-peer public chat over a Bluetooth LE mesh, wire-compatible with the bitchat app (text + image/voice/file media).

Project description

Bitchat CLI (Python Version)

This is a Python-based, command-line implementation of bitchat, a secure, decentralized, peer-to-peer messaging app that works over Bluetooth mesh networks. This version is designed to be compatible with the original Swift application's protocol.

Original iOS Version by Jack: github.com/jackjackbits/bitchat

Features

  • Decentralized Communication: No internet or servers required.
  • Peer-to-Peer: Connects directly with other bitchat users via Bluetooth LE.
  • Secure: Implements the core cryptographic principles of the original app.
  • Cross-Platform: Built with Python and bleak, with the potential to run on Windows, macOS, and Linux.

Installation

Requires Python 3.8+ and a working Bluetooth LE adapter.

From PyPI (recommended)

pip install bitchat-cli

From source

git clone https://github.com/dearabhin/bitchat-cli.git
cd bitchat-cli
pip install -e .

Usage

Once installed, run it from anywhere:

bitchat-cli      # or simply: bitchat

From a source checkout you can also run python -m bitchat_cli.

The application will automatically start scanning for nearby bitchat peers and broadcast your public messages to them.

Commands

  • /w: List known peers (peer ID → nickname).
  • /name <nickname>: Change your nickname and re-announce.
  • /send <path> (alias /file): Send an image, voice note, or file to peers.
  • /clear: Clear the screen.
  • /help: Show the list of available commands.

Any text that does not start with / is sent as a public (broadcast) message.

How It Works

This application uses the bleak library for Bluetooth Low Energy (BLE) communication, acting as a BLE central that discovers, connects to, and exchanges packets with real bitchat peers in range. It implements bitchat's binary wire protocol — announce/leave/public-message packets, PKCS#7 padding, fragment reassembly, and Ed25519 packet signing — so it can take part in public chat with the official app.

Scope and limitations: Only public/broadcast chat is supported. Private (Noise-encrypted) messaging, multi-hop mesh relaying, and advertising as a BLE peripheral are not implemented — bleak is central-only, so this client works one hop with peers it is connected to and is not itself discoverable when idle.

Protocol self-test

You can verify the wire-protocol implementation without any Bluetooth hardware:

python selftest.py

(Run from a source checkout; it imports the bitchat_cli package and needs only cryptography.)

Contributing to bitchat-cli

We welcome contributions from everyone! Here’s how you can help.

Getting Started

  1. Fork the repository.
  2. Clone your fork: git clone https://github.com/dearabhin/bitchat-cli.git
  3. Install the dependencies: pip install -r requirements.txt

Submitting Changes

  • Create a new branch for your feature or fix.
  • Write a clear commit message.
  • Open a Pull Request with a detailed description of your changes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitchat_cli-0.1.0.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitchat_cli-0.1.0-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file bitchat_cli-0.1.0.tar.gz.

File metadata

  • Download URL: bitchat_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bitchat_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 408aada569c8e95a9e89bf0e615114f913cf478db88aaa783d4c649d50c4c30d
MD5 ebd63fa36335b2df695daf085872a340
BLAKE2b-256 245e014715bb3482947beca2cc1eb903e619ee6a770aa96149c360c6e09286c6

See more details on using hashes here.

File details

Details for the file bitchat_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bitchat_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bitchat_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e09e56b21791329226dae7fef83e221ae78b6bfd4c88eecf21ba2b3fb87621d
MD5 ca3e93e33d4df11f77f79dbbf79562c9
BLAKE2b-256 26dc728f819613574774a9c01c69fb8bb7e8663592e0660c115bcd25fd89126f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page