
👉 "peerset.DB doesn’t care—drop anything you want:
raw, JSON, blob, audio, video, stream. Works out of the box.
No need to rethink your DB concept or spend an all-nighter configuring—literally plug the component and play.
Moderation? Your call: from ‘let it fly’ to ‘Fort Knox’.
The simplest way to plug a global, self-synchronizing swarm into your app."

- Signaling happens via public BitTorrent trackers
- Peers connect directly via WebRTC, no servers, no middlemen.
- A peer-to-peer record synchronization system where every record is:
- ✅ Signed
- ✅ SHA-256 hashed
- ✅ Moderated
- ✅ Locally stored
- ✅ Auto-synced across peers
A fully self-moderated swarm with:
- 🔄 Automatic deduplication
- 📦 Merkle Tree
- ⏳ Session enforcement
- 🔐 End-to-end encryption and serialization
No servers. No central control. No infrastructure except the public tracker network — which is, by design, unbannable.
Anyone on Earth with a browser can join the swarm and instantly share data with everyone else.
LIVE DEMO: Try it yourself — open duplicated windows on your laptop, phone, tablet, or across multiple devices.
👉 cloud-atlas-peerset.pages.dev
It stupidly syncs everything you throw at it.
- Network Web UI

- Decentralized peer-to-peer network using Trystero: A hash of the room name is announced on the public BitTorrent tracker network. Everyone interested in that UUID gets connected into a shared WebRTC buffer (our Trystero room)
- Incremental Merkle Tree: allowing O(log n) updates and subtree comparisons. Lazy Updates: Hashes are computed asynchronously to avoid blocking operations.
- Full record deduplication and IndexedDB persistence
- Broadcast and request missing records automatically among peers
- Basic Moderation & strike system: bad-word detection and regex on text field (no link in text policy), regex check on link field
- Garbage Collection: records are pruned if older than 90 days, subscriptions are closed, memory purged (needs improvement)
- User "login" via Bech32 npub/nsec keys (secp256k1) (ready code, implementation soon)
- Automatic SHA-256 hashing and secp256k1 signing of records and related checks (ready snippet, implementation soon)
- Handshake + Nonce Challenge authentication for secure peer connections (ready code, implementation soon)
- Session enforcement: handshake timeout, challenge timeout, max peer & client session times and many more (ready code, implementation soon)
- Strict state machine for peer handshake and session management (ready code, implementation soon)
- more Moderation filters: max 5 records in indexeddb per author.npub, duplicate detection, (ready snippets, implementation soon)
- Phase Rotating Announcements (🖖)
peerset.DB is a new primitive for the decentralized web — think BitTorrent for live data, IPFS without infrastructure, or GUN/OrbitDB without servers.
It’s not just storage. It’s not just messaging. It’s a fully peer-to-peer database layer that anyone can drop into their app.
- Like BitTorrent, it uses public trackers for signaling — the unbannable backbone of peer discovery.
- Like IPFS, it creates a content-addressable network — every record is hashed and signed.
- Like GunDB/OrbitDB, it’s a distributed database — but without external nodes, bootstrap servers, or infrastructure.
- Unlike all of them, it’s just a Svelte component / JS bundle — you can throw it on a CDN, drop it in a browser, and the swarm takes care of the rest.
peerset.DB is a zero-infrastructure, end-to-end encrypted, self-moderating P2P record synchronization engine.
Only you have the Nostr keys in possession but this service offers their recovery via your email address for free: NSTART.ME
Here’s a GitHub-ready version of your peerset.DB workflow for the README with proper Markdown formatting:
A brief overview of how peerset.DB synchronizes records across peers using incremental Merkle trees.
- Load persisted records from IndexedDB into
recordStore
. - Build an incremental AVL-based Merkle tree from these records.
- Compute the initial root hash asynchronously.
- When a new peer joins, send them the current root hash.
- Track traffic statistics per peer.
On receiving a peer's root hash:
- Fresh peer (
freshNode
) → send all local records. - Hashes differ → send subtree hashes for Merkle comparison.
- Hashes match → no sync needed.
On receiving peer subtree hashes:
- Compare with local tree to find differing paths.
- Extract records corresponding to differing paths and send them to the peer.
-
Received records are buffered incrementally.
-
Each record is moderated before saving.
-
After processing:
- Rebuild the Merkle tree.
- Update the root hash.
- Send updated root hash to the originating peer and optionally broadcast to all peers.
- If a peer is idle for a defined timeout, broadcast the latest root hash to ensure synchronization.
- Periodically prune old records from IndexedDB and the Merkle tree (e.g., records older than 90 days).
- Rebuild the Merkle tree as needed after pruning.
- Incremental Merkle Tree: AVL-balanced, allowing O(log n) updates and subtree comparisons.
- Lazy Updates: Hashes are computed asynchronously to avoid blocking operations.
- Batching: Records are sent in batches for efficient network usage.
- Moderation: Incoming records are verified before integration.
- Peer-to-Peer Sync: Only differences are exchanged using root and subtree hashes, minimizing data transfer.
-
Rename the file
RenameApp.svelte
toPeersetDB.svelte
. -
Move all components into the a folder in your existing plain svelte project
CopyPeersetDB.svelte
into: /src/peerset/ -
import it in your main
app.svelte
Example:
<script>
import PeersetDB from './peerset/PeersetDB.svelte';
</script>
<main>
<h1>My App</h1>
<PeersetDB />
</main>
-
(Optional) Remove
ui.svelte
and start the element hidden If you don’t need the UI, you can render the component in hidden state:<script> import PeersetDB from './peerset/peerset.svelte'; </script> <main> <PeersetDB style="display:none;" /> </main>
-
Build the project:
npm run build
-
Get the compiled files from the
dist/
folder. -
Use them in any other framework project (React, Vue, Angular, plain HTML, etc.).
That's the beauty of plain Svelte because we're exporting vanilla JS 😍Example folder after build:
In peerset.DB, by default, the Bittorrent (works out of the box) strategy is used.
<script type="module">
import {joinRoom} from 'trystero/torrent'
</script>
To use a different strategy, just use a deep import like this ():
import {joinRoom} from 'trystero' // Nostr (works out of the box)
// or
import {joinRoom} from 'trystero/ipfs' IPFS (works out of the box)
// or
import {joinRoom} from 'trystero/mqtt' // MQTT (relay urls needed)
// or
import {joinRoom} from 'trystero/supabase' // Supabases (needs config)
// or
import {joinRoom} from 'trystero/firebase' // Firebase (needs config)
Consider https://github.com/dmotz/trystero for more information.