Overview
p2pIM is a prototype peer-to-peer instant messaging system designed around proof-of-work spam protection. Larger messages require stronger proofs, while existing proofs decay over time so newer messages can eventually compete for limited message storage.
The repository includes two server prototypes, message generation utilities, peer handling, and message-store components. Its documented browser interface supports entering messages and observing their proof values over time.
Key Features
- Adjusts required proof of work according to message size.
- Decays proof strength over time to make room for newer messages.
- Replaces stored messages when stronger proofs arrive under constrained memory.
- Connects server peers and transfers messages through a communication interface.
- Exposes controls for proof-update timing, peer polling intervals, and message memory.
Prototype Server 2
The second prototype separates browser-facing and peer-communication addresses. After starting a node, users can submit messages in the browser, refresh to observe proof updates, and add another node's communication address to the peer list for message transfer.
As storage fills, messages with weaker proof can disappear. Newly generated nonces increase the proof quality needed to replace retained messages, or senders can wait for older proofs to decay.
Protocol and Earlier Prototype
The communication port supports operations for listing peers, retrieving message identifiers, fetching messages, and submitting generated messages. The message format is defined by the project's versioned message class, and a bundled generator creates correctly structured payloads with configurable proof targets.
The first prototype uses a simpler TCP server. It accepts generated messages, returns stored messages through a control payload, and can transfer those messages between server instances.