Skip to content

gowriter/SilentMesh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SilentMesh - A P2P Event Protocol

A research-oriented peer-to-peer distributed event protocol written in Go using libp2p and GossipSub.

This project explores:

  • decentralized event replication
  • cryptographically signed events
  • peer-to-peer synchronization
  • append-only event systems
  • metadata-resistant communication concepts
  • distributed trust and identity systems

The current implementation is intentionally minimal and focused on protocol primitives rather than application features.


Goals

The long-term goal is to build a modular distributed protocol layer that can support:

  • decentralized communication
  • encrypted asynchronous messaging
  • replicated event feeds
  • distributed forums
  • marketplace-like systems
  • pseudonymous identities
  • store-and-forward messaging
  • metadata minimization research

This repository is currently focused only on the foundational distributed systems layer.


Current Features

Identity System

Uses libp2p peer identities:

  • Ed25519 keypairs
  • Peer IDs derived from public keys
  • Cryptographic signing support

Each node acts as a cryptographic identity.


Signed Immutable Events

Events are:

  • deterministic
  • content-addressed
  • cryptographically signed
  • verifiable

Each event contains:

  • author
  • timestamp
  • type
  • payload
  • signature
  • deterministic hash ID

Gossip-Based Event Replication

Nodes use GossipSub pubsub topics for:

  • event propagation
  • decentralized replication
  • peer synchronization

All peers subscribed to the topic receive propagated events.


Local Event Store

Current storage implementation:

  • filesystem-based
  • one JSON file per event

Advantages:

  • easy debugging
  • inspectable state
  • portable storage
  • simple recovery

Event Verification

Incoming events are:

  • deserialized
  • signature verified
  • hash verified
  • deduplicated
  • stored locally

Test Coverage

Current tests include:

  • deterministic serialization
  • deterministic hashing
  • event signing
  • signature verification
  • tamper detection
  • filesystem storage
  • loading/saving events
  • deduplication checks

Current Architecture

stdin
  ->
create unsigned event
  ->
sign event
  ->
store locally
  ->
publish via GossipSub
  ->
peer receives event
  ->
verify event
  ->
deduplicate
  ->
store locally

Repository Structure

cmd/node/
    main.go

internal/
    event/
    network/
    store/

Packages

internal/event

Contains:

  • event models
  • serialization
  • hashing
  • signing
  • verification

This package is intended to remain deterministic and highly testable.


internal/network

Contains:

  • GossipSub integration
  • topic subscriptions
  • event publishing
  • event receiving loops

This package should remain transport-focused only.


internal/store

Contains:

  • event storage abstraction
  • filesystem storage implementation

Future backends may include:

  • BadgerDB
  • Pebble
  • SQLite

Current State

This project is still in a very early prototype stage.

Implemented:

  • peer nodes
  • GossipSub propagation
  • signed events
  • filesystem persistence
  • verification pipeline
  • tests

Not implemented yet:

  • persistent identities
  • encrypted direct messages
  • peer discovery
  • synchronization replay
  • historical event sync
  • encrypted payloads
  • access control
  • capability tokens
  • private topics
  • anonymous routing
  • metadata minimization
  • DHT integration
  • store-and-forward mailboxes
  • relay infrastructure
  • reputation systems
  • forums
  • marketplace logic
  • moderation systems

Important Notes

This repository is experimental research software.

The focus is currently:

distributed cryptographically verifiable event replication

NOT:

  • production anonymity
  • operational security
  • censorship resistance
  • financial systems
  • marketplace deployment

The current implementation does NOT provide:

  • anonymity guarantees
  • metadata protection
  • traffic analysis resistance
  • secure operational deployment

Planned Next Steps

Persistent Identity Storage

Persist node identities locally:

data/identity.key

instead of generating new identities each startup.


Event Replay Synchronization

Nodes currently only receive live events.

Future work:

  • synchronize historical events
  • peer catch-up
  • append-only replication

Encrypted Direct Messages

Planned architecture:

encrypted payload
    ->
signed event
    ->
gossip propagation
    ->
recipient decrypts

Better Storage Backend

Potential future migration to:

  • BadgerDB
  • Pebble

for scalable local persistence.


Event Deduplication Optimization

Current deduplication is filesystem-based.

Future improvements:

  • in-memory indexes
  • bloom filters
  • efficient content indexing

Protocol Evolution

Potential future protocol areas:

  • CRDT replication
  • append-only feeds
  • store-and-forward mailboxes
  • relay nodes
  • metadata-resistant messaging
  • asynchronous communication
  • distributed trust systems
  • reputation graphs
  • decentralized moderation
  • capability-based access control

Development

Run node:

go run ./cmd/node

Run tests:

go test ./...

Design Principles

The protocol currently follows several core principles:

Immutable Signed Events

Everything is represented as immutable signed events.


Content Addressing

Event IDs are derived from event content hashes.


Transport Separation

The protocol layer should remain independent from the underlying transport.


Append-Only Replication

Events are intended to become append-only replicated state.


Minimal Trusted State

Trust is derived from cryptographic signatures rather than network location.


Disclaimer

This project is experimental research software intended for distributed systems and protocol experimentation.

It should not be considered production-ready, secure, anonymous, or safe for sensitive real-world usage.

About

A research-oriented peer-to-peer distributed event protocol written in Go using libp2p and GossipSub.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages