GetNotes Tools
permissionlesstech/bitchat
Tool นี้คืออะไร
bitchat เป็นแอปส่งข้อความแบบกระจายศูนย์แบบ peer-to-peer ที่ใช้สถาปัตยกรรมสองระบบ: เครือข่าย Bluetooth mesh สำหรับการสื่อสารแบบออฟไลน์ และโปรโตคอล Nostr สำหรับการเข้าถึงทั่วโลก เหมาะสำหรับผู้ที่ต้องการแชทแบบไร้บัญชี ไร้เซิร์ฟเวอร์ และมีความเป็นส่วนตัวสูง ทั้งในสถานการณ์ออฟไลน์และออนไลน์
ข้อมูลโปรเจกต์
ดาว
33.1K
Forks
5.2K
License
Unlicense
อัปเดต GitHub ล่าสุด
28 ก.ค. 2569
เพิ่มใน GetNotes
30 ก.ค. 2569
Repository
permissionlesstech/bitchat
รูปแบบ
เหมาะกับงาน
Ecosystem
Swift
แปลและเรียบเรียงโดย AI
เนื้อหาฉบับภาษาไทย
ใช้อ่านเพื่อทำความเข้าใจเบื้องต้น โปรดตรวจสอบรายละเอียดสำคัญกับเอกสารต้นฉบับด้านล่าง
bitchat
แอปส่งข้อความแบบ peer-to-peer แบบกระจายศูนย์พร้อมสถาปัตยกรรมสองระบบ: เครือข่าย Bluetooth mesh ในพื้นที่สำหรับการสื่อสารแบบออฟไลน์ และโปรโตคอล Nostr บนอินเทอร์เน็ตสำหรับการเข้าถึงทั่วโลก ไม่ต้องมีบัญชี ไม่ต้องมีเบอร์โทรศัพท์ ไม่ต้องมีเซิร์ฟเวอร์กลาง นี่คือกลุ่มแชทข้างเคียง
การรับสำเนาที่คุณเชื่อถือได้
ติดตั้งจาก App Store หรือสร้างจากซอร์สโค้ดที่คุณได้ตรวจสอบแล้ว การสร้างที่คอมไพล์จากที่อื่นไม่สามารถตรวจสอบได้ — ดู Verifying bitchat สำหรับวิธีการตรวจสอบซอร์สโค้ดเทียบกับ hash manifest ของแต่ละเวอร์ชัน และสิ่งที่ต้องทำหากนั่นเป็นเวอร์ชันเดียวที่คุณสามารถหาได้
เรื่องนี้สำคัญกว่าปกติ: repository นี้เคยเป็นเป้าหมายของการเรียกร้องให้ลบออก และเมื่อ repository หรือหน้า releases หายไป จะมี mirrors ปรากฏขึ้นที่ไม่มีใครสามารถตรวจสอบได้
ใบอนุญาต
โครงการนี้เผยแพร่สู่สาธารณสมบัติ ดูไฟล์ LICENSE สำหรับรายละเอียด
คุณสมบัติ
- สถาปัตยกรรม Dual Transport: Bluetooth mesh สำหรับออฟไลน์ + โปรโตคอล Nostr สำหรับการส่งข้อความผ่านอินเทอร์เน็ต
- ช่องทางตามตำแหน่ง: ห้องแชททางภูมิศาสตร์โดยใช้พิกัด geohash ผ่าน Nostr relays ทั่วโลก
- การกำหนดเส้นทางข้อความอัจฉริยะ: เลือกการส่งข้อมูลที่ดีที่สุดโดยอัตโนมัติ (Bluetooth → Nostr fallback)
- เครือข่าย Mesh แบบกระจายศูนย์: การค้นหา peer อัตโนมัติและการส่งต่อข้อความแบบ multi-hop ผ่าน Bluetooth LE
- ความเป็นส่วนตัวเป็นอันดับแรก: ไม่มีบัญชี ไม่มีเบอร์โทรศัพท์ ไม่มีเซิร์ฟเวอร์ โปรดทราบว่า mesh ใช้ตัวระบุแบบถาวรต่ออุปกรณ์ที่ได้มาจากคีย์ระบุตัวตนของคุณ — ดู whitepaper เกี่ยวกับตัวตนและ metadata สำหรับสิ่งที่วิทยุที่อยู่ใกล้เคียงสามารถสังเกตได้
- การเข้ารหัสข้อความส่วนตัวแบบ End-to-End: Noise Protocol สำหรับ mesh, BitChat private envelopes สำหรับ Nostr fallback
- คำสั่งสไตล์ IRC: อินเทอร์เฟซที่คุ้นเคยสไตล์
/slap,/msg,/who - แอปสากล: รองรับ iOS และ macOS แบบ Native
- การล้างข้อมูลฉุกเฉิน: แตะสามครั้งเพื่อล้างข้อมูลทั้งหมดทันที
- การเพิ่มประสิทธิภาพ: การบีบอัดข้อความ LZ4, โหมดแบตเตอรี่แบบปรับได้ และการเชื่อมต่อเครือข่ายที่ปรับให้เหมาะสม
สถาปัตยกรรมทางเทคนิค
BitChat ใช้ สถาปัตยกรรมการส่งข้อความแบบไฮบริด ที่มีเลเยอร์การส่งข้อมูลสองชั้นที่เสริมกัน:
เครือข่าย Bluetooth Mesh (ออฟไลน์)
- การสื่อสารในพื้นที่: Peer-to-peer โดยตรงภายในระยะ Bluetooth
- การส่งต่อแบบ Multi-hop: ข้อความจะถูกส่งผ่านอุปกรณ์ใกล้เคียง (สูงสุด 7 hops)
- ไม่จำเป็นต้องใช้อินเทอร์เน็ต: ทำงานได้สมบูรณ์แบบออฟไลน์ในสถานการณ์ภัยพิบัติ
- การเข้ารหัส Noise Protocol: การเข้ารหัสแบบ End-to-End พร้อม forward secrecy สำหรับเซสชันสด (store-and-forward mail จะถูกปิดผนึกโดยไม่มีสิ่งนี้ — ดู whitepaper)
- โปรโตคอลไบนารี: รูปแบบแพ็กเก็ตที่กะทัดรัดซึ่งปรับให้เหมาะสมกับข้อจำกัดของ Bluetooth LE
- การค้นหาอัตโนมัติ: การค้นหา peer และการจัดการการเชื่อมต่อ
- พลังงานแบบปรับได้: การทำงานแบบ duty cycling ที่ปรับให้เหมาะสมกับแบตเตอรี่
โปรโตคอล Nostr (อินเทอร์เน็ต)
- การเข้าถึงทั่วโลก: เชื่อมต่อกับผู้ใช้ทั่วโลกผ่าน Nostr relays
- ช่องทางตำแหน่ง: ห้องแชททางภูมิศาสตร์โดยใช้พิกัด geohash
- เครือข่าย Relay กว่า 290 แห่ง: กระจายอยู่ทั่วโลกเพื่อความน่าเชื่อถือ
- BitChat Private Envelopes: ข้อความส่วนตัวที่เข้ารหัสเฉพาะแอปผ่าน Nostr relays
- Ephemeral Keys: รหัสประจำตัวทางคริปโตกราฟีใหม่สำหรับแต่ละพื้นที่ geohash
รูปแบบ private-envelope ของ BitChat เป็นกรรมสิทธิ์และ ไม่ เข้ากันได้กับ NIP-17,
NIP-44 หรือ NIP-59 โดยใช้ Nostr เป็นการส่งต่อข้อมูลแต่ทำงานร่วมกันได้เฉพาะกับ
BitChat clients เท่านั้น: เพย์โหลดส่วนตัวจะเดินทางภายใน kind-1059
events ซึ่งเนื้อหาที่นำหน้าด้วย v2: เป็นโครงสร้าง XChaCha20-Poly1305
เฉพาะของ BitChat ไม่ใช่การเข้ารหัส NIP-44
ประเภทช่องทาง
mesh #bluetooth
- การส่งข้อมูล: เครือข่าย Bluetooth Low Energy mesh
- ขอบเขต: อุปกรณ์ในพื้นที่ภายในระยะ multi-hop
- อินเทอร์เน็ต: ไม่จำเป็น
- กรณีการใช้งาน: การสื่อสารแบบออฟไลน์, การประท้วง, ภัยพิบัติ, พื้นที่ห่างไกล
ช่องทางตำแหน่ง (block #dr5rsj7, neighborhood #dr5rs, country #dr)
- การส่งข้อมูล: โปรโตคอล Nostr ผ่านอินเทอร์เน็ต
- ขอบเขต: พื้นที่ทางภูมิศาสตร์ที่กำหนดโดยความแม่นยำของ geohash- `block` (7 ตัวอักษร): ระดับบล็อกเมือง - `neighborhood` (6 ตัวอักษร): เขต/ย่าน - `city` (5 ตัวอักษร): ระดับเมือง - `province` (4 ตัวอักษร): รัฐ/จังหวัด - `region` (2 ตัวอักษร): ประเทศ/ภูมิภาคขนาดใหญ่
- อินเทอร์เน็ต: จำเป็น (เชื่อมต่อกับ Nostr relays)
- กรณีการใช้งาน: แชทชุมชนตามตำแหน่ง, กิจกรรมในพื้นที่, การสนทนาระดับภูมิภาค
การกำหนดเส้นทางข้อความโดยตรง
ข้อความส่วนตัวใช้ การเลือกการส่งข้อมูลอัจฉริยะ:
- 1Bluetooth เป็นอันดับแรก (แนะนำเมื่อมี)- การเชื่อมต่อโดยตรงกับ Noise session ที่สร้างขึ้นแล้ว - ตัวเลือกที่เร็วที่สุดและเป็นส่วนตัวที่สุด
- 2Nostr Fallback (เมื่อ Bluetooth ไม่พร้อมใช้งาน)- ใช้ Nostr public key ของผู้รับ - การเข้ารหัส private-envelope เฉพาะแอปของ BitChat - กำหนดเส้นทางผ่านเครือข่าย relay ทั่วโลก
- 3Smart Queuing (เมื่อไม่มีทั้งสองอย่าง)- ข้อความจะถูกจัดคิวจนกว่าการส่งข้อมูลจะพร้อมใช้งาน - จัดส่งอัตโนมัติเมื่อสร้างการเชื่อมต่อแล้ว
สำหรับเอกสารโปรโตคอลโดยละเอียด โปรดดู Technical Whitepaper
การตั้งค่า
ตัวเลือกที่ 1: การใช้ Xcode
open bitchat.xcodeprojสำหรับการสร้างอุปกรณ์ที่ลงนาม ให้สร้างการกำหนดค่าภายในเครื่องที่คุณละเว้นและแทนที่ ID ทีมตัวอย่างด้วย Apple Developer Team ID ของคุณ:
cp Configs/Local.xcconfig.example Configs/Local.xcconfigLocal.xcconfig.example จะสร้างตัวระบุแอปและ App Group ที่ไม่ซ้ำกันจาก
Team ID นั้น ไฟล์ entitlement อ้างอิง $(APP_GROUP_ID) อยู่แล้ว ดังนั้นไฟล์
project หรือ entitlement ที่ถูกติดตามจึงไม่จำเป็นต้องแก้ไข
การตรวจสอบบรรทัดคำสั่งที่เป็นประโยชน์จาก root ของ repository:
# macOS Debug build โดยไม่มีการลงนาม
xcodebuild -project bitchat.xcodeproj -scheme "bitchat (macOS)" \
-configuration Debug CODE_SIGNING_ALLOWED=NO build
# ชุดทดสอบ SwiftPM เต็มรูปแบบ
swift test
# การทดสอบ iOS simulator
xcodebuild -project bitchat.xcodeproj -scheme "bitchat (iOS)" \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 17' testหาก iPhone 17 ไม่พร้อมใช้งาน ให้เลือก simulator ที่ติดตั้งจาก:
xcodebuild -showdestinations -project bitchat.xcodeproj -scheme "bitchat (iOS)"ตัวเลือกที่ 2: การใช้ just
brew install just
just check
just runjust build และ just run ใช้ scheme bitchat (macOS) ปัจจุบันและเก็บ
เอาต์พุต Xcode ไว้ในไดเรกทอรี .DerivedData/ ที่ถูกละเว้น พวกเขาไม่เคยแพตช์
source, project, configuration หรือ entitlement files
just clean จะลบเฉพาะ .DerivedData/ และ .build/ เท่านั้น ไม่ได้เรียกใช้ Git
หรือกู้คืนไฟล์ที่ถูกติดตาม ดังนั้นงานที่ยังไม่ได้คอมมิตจะยังคงอยู่ just test
จะรันชุด SwiftPM และ just test-ios จะรันชุด iPhone 17 simulator
การแปลภาษา
- การแปลภาษาของแอปอยู่ใน
bitchat/Localizable.xcstrings - สตริงส่วนขยายการแชร์แยกอยู่ใน
bitchatShareExtension/Localization/Localizable.xcstrings - ควรใช้คีย์ที่อธิบายเจตนา (
app_info.features.offline.title) และนำคีย์ที่มีอยู่กลับมาใช้ใหม่หากเป็นไปได้ - รัน
xcodebuild -project bitchat.xcodeproj -scheme "bitchat (macOS)" -configuration Debug CODE_SIGNING_ALLOWED=NO buildเพื่อตรวจสอบการคอมไพล์ของการอัปเดตการแปลภาษาใดๆ
เอกสารโปรเจกต์
อ่านเอกสารต้นฉบับ
README วิธีติดตั้ง วิธีใช้งาน และข้อกำหนดจาก repository ต้นฉบับ
bitchat
A decentralized peer-to-peer messaging app with dual transport architecture: local Bluetooth mesh networks for offline communication and internet-based Nostr protocol for global reach. No accounts, no phone numbers, no central servers. It's the side-groupchat.
Getting a copy you can trust
Install from the App Store, or build from source you have verified. A compiled build from anywhere else cannot be verified — see Verifying bitchat for how to check source against the per-release hash manifest, and for what to do if that is the only build you can get.
This matters more than it usually would: this repository has been the target of takedown demands, and when a repository or releases page disappears, mirrors appear that nobody can check.
License
This project is released into the public domain. See the LICENSE file for details.
Features
- Dual Transport Architecture: Bluetooth mesh for offline + Nostr protocol for internet-based messaging
- Location-Based Channels: Geographic chat rooms using geohash coordinates over global Nostr relays
- Intelligent Message Routing: Automatically chooses best transport (Bluetooth → Nostr fallback)
- Decentralized Mesh Network: Automatic peer discovery and multi-hop message relay over Bluetooth LE
- Privacy First: No accounts, no phone numbers, no servers. Note that the mesh does use a persistent per-device identifier derived from your identity key — see the whitepaper on identity and metadata for what a nearby radio can observe
- Private Message End-to-End Encryption: Noise Protocol for mesh, BitChat private envelopes for Nostr fallback
- IRC-Style Commands: Familiar
/slap,/msg,/whostyle interface - Universal App: Native support for iOS and macOS
- Emergency Wipe: Triple-tap to instantly clear all data
- Performance Optimizations: LZ4 message compression, adaptive battery modes, and optimized networking
Technical Architecture
BitChat uses a hybrid messaging architecture with two complementary transport layers:
Bluetooth Mesh Network (Offline)
- Local Communication: Direct peer-to-peer within Bluetooth range
- Multi-hop Relay: Messages route through nearby devices (max 7 hops)
- No Internet Required: Works completely offline in disaster scenarios
- Noise Protocol Encryption: End-to-end encryption, with forward secrecy for live sessions (store-and-forward mail is sealed without it — see the whitepaper)
- Binary Protocol: Compact packet format optimized for Bluetooth LE constraints
- Automatic Discovery: Peer discovery and connection management
- Adaptive Power: Battery-optimized duty cycling
Nostr Protocol (Internet)
- Global Reach: Connect with users worldwide via internet relays
- Location Channels: Geographic chat rooms using geohash coordinates
- 290+ Relay Network: Distributed across the globe for reliability
- BitChat Private Envelopes: App-specific encrypted private messages over Nostr relays
- Ephemeral Keys: Fresh cryptographic identity per geohash area
BitChat's private-envelope format is proprietary and is not NIP-17,
NIP-44, or NIP-59 compatible. It uses Nostr as a relay transport but only
interoperates with BitChat clients: private payloads travel inside kind-1059
events whose v2:-prefixed content is a BitChat-specific XChaCha20-Poly1305
construction, not NIP-44 encryption.
Channel Types
mesh #bluetooth
- Transport: Bluetooth Low Energy mesh network
- Scope: Local devices within multi-hop range
- Internet: Not required
- Use Case: Offline communication, protests, disasters, remote areas
Location Channels (block #dr5rsj7, neighborhood #dr5rs, country #dr)
- Transport: Nostr protocol over internet
- Scope: Geographic areas defined by geohash precision- `block` (7 chars): City block level - `neighborhood` (6 chars): District/neighborhood - `city` (5 chars): City level - `province` (4 chars): State/province - `region` (2 chars): Country/large region
- Internet: Required (connects to Nostr relays)
- Use Case: Location-based community chat, local events, regional discussions
Direct Message Routing
Private messages use intelligent transport selection:
- 1**Bluetooth First** (preferred when available) - Direct connection with established Noise session - Fastest and most private option
- 2**Nostr Fallback** (when Bluetooth unavailable) - Uses recipient's Nostr public key - BitChat's app-specific private-envelope encryption - Routes through global relay network
- 3**Smart Queuing** (when neither available)- Messages queued until transport becomes available - Automatic delivery when connection established
For detailed protocol documentation, see the Technical Whitepaper.
Setup
Option 1: Using Xcode
open bitchat.xcodeprojFor a signed device build, create your ignored local configuration and replace the example team ID with your Apple Developer Team ID:
cp Configs/Local.xcconfig.example Configs/Local.xcconfigLocal.xcconfig.example derives unique app and App Group identifiers from that
team ID. The entitlement files already reference $(APP_GROUP_ID), so tracked
project or entitlement files do not need to be edited.
Useful command-line checks from the repository root:
# macOS Debug build without signing
xcodebuild -project bitchat.xcodeproj -scheme "bitchat (macOS)" \
-configuration Debug CODE_SIGNING_ALLOWED=NO build
# Full SwiftPM test suite
swift test
# iOS simulator tests
xcodebuild -project bitchat.xcodeproj -scheme "bitchat (iOS)" \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 17' testIf iPhone 17 is unavailable, choose an installed simulator from:
xcodebuild -showdestinations -project bitchat.xcodeproj -scheme "bitchat (iOS)"Option 2: Using just
brew install just
just check
just runjust build and just run use the current bitchat (macOS) scheme and keep
Xcode output in the ignored .DerivedData/ directory. They never patch source,
project, configuration, or entitlement files.
just clean removes only .DerivedData/ and .build/. It does not invoke Git
or restore tracked files, so uncommitted work is preserved. just test runs the
SwiftPM suite and just test-ios runs the iPhone 17 simulator suite.
Localization
- App localizations live in
bitchat/Localizable.xcstrings. - Share extension strings are separate in
bitchatShareExtension/Localization/Localizable.xcstrings. - Prefer keys that describe intent (
app_info.features.offline.title) and reuse existing ones where possible. - Run
xcodebuild -project bitchat.xcodeproj -scheme "bitchat (macOS)" -configuration Debug CODE_SIGNING_ALLOWED=NO buildto compile-check any localization updates.
