About
## The problem it solves
### The Problem It Solves - **Server-Side Data Harvesting & Logs:** Centralized intermediaries broker, log, and store metadata, IP addresses, contact graphs, and message histories on corporate cloud servers vulnerable to breaches, rogue insiders, and subpoenas. - **Insecure Credential Schemes:** Traditional platforms force users to surrender sensitive personal identifiers (phone numbers, email addresses, and passwords), which are routinely compromised in credential stuffing and SIM-swap attacks. - **Third-Party File Relays:** Sending confidential documents or code snippets usually requires uploading files to third-party cloud buckets (Google Drive, Dropbox, AWS S3), creating permanent data footprints.
### How It Works (Technical Architecture) 1. **Zero-Server Payload Routing (WebRTC DataChannel Mesh):** - Unlike traditional apps that route messages through centralized cloud brokers, BitWhisper establishes direct device-to-device SCTP over DTLS 1.3 channels. - A lightweight Node.js signaling relay brokers initial peer discovery only; 0 bytes of message payload or file data ever touch an intermediate server.
- **Ephemeral Forward Secrecy (NIST P-256 ECDH + AES-GCM-256):**
- Clients negotiate session keys natively in volatile memory via the browser's SubtleCrypto API using ECDH over NIST P-256.
- All messages and file streams are symmetrically encrypted using AES-GCM-256 with unique cryptographically random 12-byte IVs per payload.
- Closing the browser tab destroys the non-extractable keys in RAM forever, guaranteeing true perfect forward secrecy.
- **Passwordless, Pseudonymous Identity (SIWE / EIP-4361):**
- Eliminates phone numbers and emails entirely.
- Identity is verified via Sign-In with Ethereum (EIP-4361) using off-chain cryptographic wallet signatures (100% gasless, self-custodial, and resistant to impersonation).
- **Verified P2P File Streaming with SHA-256 Integrity:**
- Eliminates third-party file upload intermediaries. Files are fragmented into 16KB binary chunks, encrypted with AES-GCM, and streamed directly peer-to-peer.
- Recipients verify a client-side computed SHA-256 checksum upon reassembly before saving, preventing data tampering or file corruption.
### What People Can Use It For
- **DAO & DeFi Core Teams:** Securely discuss unreleased smart contract code, treasury reallocations, multi-sig execution payloads, or emergency incident responses without fear of Telegram/Discord exploits or channel takeovers. - **Developers & Security Researchers:** Transmit private SSH keys, `.env` configs, API tokens, and confidential source archives directly peer-to-peer without leaving records in Slack or cloud drives. - **Journalists, Activists & Whistleblowers:** Conduct unmonitored interviews with verified cryptographic identities, zero digital footprints, and zero central chat logs. - **Disposable, High-Security Collaboration:** Create ephemeral "War Rooms" on the fly for sensitive negotiations, legal discussions, or zero-log team syncs.
## Challenges we ran into
1. **WebRTC Signaling "Glare" & Race Conditions in Full Mesh Topology** - **The Hurdle:** When multiple peers joined a room simultaneously, both clients attempted to initiate WebRTC connections at the exact same millisecond. Both browsers invoked `createOffer()` concurrently, resulting in offer collisions (WebRTC signaling "glare") and throwing `InvalidStateError: HaveLocalOffer` because the signaling state was not stable. - **How We Solved It:** We implemented the **Perfect Negotiation Pattern** in `webrtc.js`. Each peer is deterministically assigned a polite or impolite role (`polite: !shouldInitiate`). When a collision occurs, the impolite peer ignores colliding incoming offers, while the polite peer yields, rolls back its local offer, and accepts the remote description. Additionally, we built an end-to-end encrypted chat-relay fallback via WebSocket so peers never drop messages while data channels are still negotiating.
- **Vite 5 ESM & SIWE Buffer Polyfill Crash in the Browser**
- **The Hurdle:** Integrating Sign-In with Ethereum (SIWE / EIP-4361) and ethers in a Vite 5 frontend caused immediate runtime crashes with `ReferenceError: Buffer is not defined`. Because Vite bundles modern browser ESM without Node.js runtime polyfills, the underlying crypto/serialization routines inside `siwe` broke on page load.
- **How We Solved It:** Instead of dirty hacks or injecting global scripts, we integrated `vite-plugin-node-polyfills` in `vite.config.js`, selectively polyfilling `Buffer: true` globally. This preserved lightweight ESM bundling while allowing SIWE and Ethers to sign and verify cryptographic wallet nonces seamlessly in the browser.
- **RTCDataChannel SCTP Buffer Overflows & File Transfer Verification**
- **The Hurdle:** WebRTC's `RTCDataChannel` has strict message size thresholds (typically capped at 16KB–64KB per SCTP packet depending on browser implementations). Attempting to stream raw multi-megabyte files crashed the data channel or caused silent packet dropouts.
- **How We Solved It:** In `fileTransfer.js`, we engineered a chunked streaming pipeline:
- Files are sliced into 16 KB (16,384 bytes) binary chunks.
- Each chunk is encrypted with AES-GCM-256 and sent with index metadata.
- A backpressure micro-delay is throttled every 10 chunks to prevent data channel queue exhaustion.
- Before sending, a client-side SHA-256 digest is calculated; on arrival, the receiver reconstructs the Blob and validates the SHA-256 hash locally before presenting the download button.
- **Strict Browser "Secure Context" Restrictions for Web Crypto**
- **The Hurdle:** The Web Crypto API (`window.crypto.subtle`) and WebRTC data channels are strictly locked down by modern browsers to Secure Contexts (`https://` or `localhost`). Testing peer-to-peer connections between two separate machines on a local network or non-HTTPS environment completely disabled `crypto.subtle`, rendering ECDH key generation impossible.
- **How We Solved It:** We automated a local TLS Certificate Authority setup using `mkcert` to issue multi-SAN certificates (`localhost`, `127.0.0.1`, loopback, and LAN IPs). We then configured Vite and the Node.js signaling server in `server.js` to serve over dual HTTPS / WSS pipelines, allowing testing of peer discovery and cryptographic handshakes across different network devices.
- **Ephemeral ECDH Handshake Timing & Decryption Sync**
- **The Hurdle:** When an `RTCDataChannel` fired its `onopen` event, clients frequently attempted to send chat messages before the asynchronous ECDH public key exchange had finished deriving the shared secret (`deriveSharedKey`). If a message arrived before the key derivation resolved, it failed with `Shared key not established`.
- **How We Solved It:** We redesigned the handshake into a formal two-way key agreement protocol (`key-exchange-offer` $\rightarrow$ `key-exchange-answer`) coupled with reactive crypto state counters (`peerCryptoReady`). The client UI disables transmission until the ephemeral AES-GCM-256 key is derived, and automatically initiates a handshake retry if an unkeyed message arrives.
Screenshots
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.










