Skip to content
ayush6288Public

About

Self-propagating, censorship-resistant P2P publishing in one self-contained HTML file. secp256k1 Schnorr, Hashcash PoW, WebRTC, PNG stego, HTML Quines.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

🧬 SPORE

Self-Propagating Overlay for Resilient Expression

A single-file, local-first P2P publishing client.

Download SPORE — index.html

License: MIT Build: single-file HTML Crypto: secp256k1 Schnorr + Hashcash Transport: WebRTC + RGB LSB stego


Overview

SPORE is a local-first, peer-to-peer publishing protocol and client that compiles into one self-contained HTML file. Authors generate keys and sign posts locally; readers verify signatures and proof of work locally. There is no account server, required origin, CDN, or database.

The application makes zero network requests at boot and works from file://. Live peer discovery is optional and starts only when you press join. SPORE then uses BitTorrent WebSocket trackers and Nostr relays for signaling, and WebRTC DataChannels for peer traffic. If public signaling is unavailable, the Manual Offline SDP Copy-Paste Bridge can connect two peers through a compressed spore-peer://… invite.

Live traffic is room-scoped. A blank join subscribes to your own creator room plus the reel rooms of media already in your feed; the shared global firehose is joined only when you type global. Following a creator does not subscribe you to that creator's Reels.

Content can move through four independent paths:

  • Live swarm — verified packets and chunked video over WebRTC.
  • PNG carriers — signed packets embedded in a lossless RGB LSB image.
  • Quine snapshots — one HTML file containing the app plus up to 200 verified packets.
  • Inline video — clips up to 1.5 MB embedded directly in the signed packet's media manifest.

SPORE is not encrypted messaging, an anonymity network, or a guarantee of availability. Posts are public and signed. Dandelion++-style routing is source obfuscation, not anonymity. WebRTC peers may learn your IP address. The Threat Model and Privacy boundaries make these limits explicit.

At a Glance

Item Detail
Current release v0.3.0
Artifact index.html — one standalone document
Size / SHA-256 319,708 bytes / 4dabdaa4754373ea0748caf99ed0c9738ab9cff53efe94d5fa9b71faf284d2c2
Identity Ephemeral secp256k1/BIP340 keypair, encrypted backup available
Integrity Schnorr signatures, SHA-256 packet IDs, Hashcash proof of work
Discovery BitTorrent WebSocket trackers + Nostr relays
Rooms Deterministic creator and Reel swarms; global is opt-in
Transport WebRTC DataChannels (DTLS-encrypted by the browser)
Storage IndexedDB → localStorage → in-memory fallback
Media 64 KiB chunks, SHA-256 verified, 4–6 chunk request windows
License MIT

Choose a Guide

If you want to… Read
Read, filter, import carriers, or play video Reader Guide
Back up an identity, publish, create receipts, or export carriers Creator Guide
Join peers, follow creators without subscribing to their Reels, or seed video P2P Swarm Guide

Quick Start

  1. Download index.html, or build it from source.
  2. Open it in a current Chromium-based browser, Firefox, or Safari. Rename it to spore.html if you prefer; the filename is not significant.
  3. Read immediately. SPORE boots offline with its local store and any embedded Quine seed. Nothing is requested from the network.
  4. Go live when needed. Leave the channel blank and press join to follow your own creator room and the reels already in your feed, or paste a creator:… handle to follow an author. See the P2P Swarm Guide. Join is optional.

If you plan to publish, open key vault and create an encrypted backup first. The identity is generated in memory for each page load and is lost on reload unless you restore a backup.


Reader guide

You do not need an account, phone number, email address, or app-store install to read or share SPORE.

1. Open and read

Open the downloaded HTML file. The feed appears from local storage and any embedded snapshot. Packets carry their author's public key and proof of work, and are verified before display. A SEED tag marks packets hydrated from an embedded Quine seed.

The automated end-to-end suite runs in Chromium. Other current browsers are expected to work but are not covered by automated E2E testing.

2. Filter and curate the feed

Use the three feed filters:

Filter Shows
All Verified Every verified packet admitted by local policy
2-Hop Trusted Only Authors followed or vouched within two trust hops
High PoW Only Packets with at least 16 declared proof-of-work bits

Unknown authors need a 16-bit work floor to enter the live feed. To curate, follow or vouch for an author, or mute them with the pubkey control. Mutes are absorbing, and mutes published by direct peers are honored by default. Trust is local: it is not a global score or consensus.

3. Import a PNG carrier

When someone shares a SPORE Carrier Image (.png):

  1. Save the image as a file or document. In WhatsApp or Telegram, send/download it as a Document/File so the platform does not recompress it.
  2. Open your local SPORE copy.
  3. Press Import Stego PNG and select the image.
  4. SPORE checks the frame length and CRC32, decompresses the bundle, and verifies each packet's ID, proof of work, and Schnorr signature before merging valid packets.
  5. Every verified media packet registers its manifest and joins the deterministic Reel room derived from the author's public key and the complete media hash. Text packets inform future joins but do not trigger an implicit global subscription.
  6. The post appears in the feed.

A carrier is not encryption. Anyone can decode it, and lossy re-encoding destroys the payload.

4. Open a Quine snapshot

A Quine is a single HTML file that contains the application plus a selected set of verified packets, up to 200. Open it directly—no server or network is required. SPORE verifies every embedded packet and drops invalid entries before hydrating the feed. Media manifests in the snapshot register locally; a later blank join includes their Reel rooms.

Quines are public artifacts. They do not contain your private key, but they do contain the public posts selected by their creator.

5. Play a video

Video posts show a chunk counter while media is retrieved. The player appears only after every chunk and the assembled file pass SHA-256 verification.

  • Clips up to 1.5 MB are embedded inline and play with zero peers online, including from a Quine or PNG carrier.
  • Larger clips need at least one connected peer that has the chunks. Keep the original poster's tab open if you need to seed.

See Seed and fetch video for swarm details.

6. Clear local state

The Storage panel has Clear local feed & cached chunks. After confirmation it removes:

  • IndexedDB stores spore_db_v1 and spore_video_v1
  • SPORE's localStorage keys
  • in-memory packets and cached video blobs
  • pending video selections and assembled blob URLs

Your current identity and telemetry stay. Embedded Quine seed data is not modified; it is repopulated from the artifact the next time it is opened. Use this when you want a genuinely fresh local store without changing browsers or profiles.


Creator guide

SPORE gives you a local cryptographic identity. It does not hide your network location by itself, and it does not make public posts confidential.

1. Back up your identity

  • Each page load generates a fresh secp256k1/BIP340 keypair in memory. The Identity panel labels it ephemeral; it is not saved automatically across reloads.
  • The public fingerprint appears as spore:0x…; the full public key can be copied from the Identity panel.
  • The Identity panel also shows a copyable creator:<16 hex> handle. Paste it into the channel field to follow that author's text and trust packets without subscribing to their Reels.
  • To keep an identity, open key vault, enter a strong, unique passphrase, press encrypt key, and copy the encrypted backup JSON.
  • To restore, press restore…, paste the backup JSON and passphrase, then press decrypt & adopt key.
  • Backup encryption is PBKDF2-HMAC-SHA256 (210,000 rounds) → XChaCha20-Poly1305. The passphrase never leaves the tab.
  • rotate replaces the current identity. The old identity is recoverable only from a backup.
  • The packet store persists through IndexedDB/localStorage, but the identity does not. Restore your backup after a reload if you need to keep publishing as the same author.

2. Publish a post

  1. In the Transmit composer, choose Standard Post.
  2. Write the content.
  3. Choose proof of work from 8 to 20 bits. The default is 16 bits (about 65,536 hashes on average); higher values take longer.
  4. Keep Dandelion++ Stem Routing checked for source obfuscation, or uncheck it to broadcast directly.
  5. Press mine & seal post. SPORE mines the nonce, signs the packet, verifies it locally, stores it, and routes it to peers if the mesh is joined.
  6. Mining can be cancelled without freezing the tab.

If you are offline, the packet is still stored locally. Export a Quine or PNG carrier to move it to another device.

3. Share a video Reel

  1. In the composer, press Import Reel Video and choose a browser-playable video.
  2. SPORE slices it into 64 KiB chunks, hashes every chunk and the complete file with SHA-256, and caches the chunks in IndexedDB (spore_video_chunks) with an in-memory fallback.
  3. Write an optional caption and press mine & seal post. The signed packet carries the media manifest. Publishing joins both your creator room and the deterministic Reel room derived from your public key plus the full-file SHA-256, then announces chunks only inside that Reel room.
  4. Keep the tab open while peers fetch. A peer retrieves chunks in 4–6 chunk windows and verifies each one before assembly.
  5. Clips up to 1.5 MB embed inline, so a Quine or PNG carrier can play them offline with no peers. Larger clips require a seeding peer.

The manifest's media_id is the SHA-256 of the full file and is bound to the signed packet through media_cid. A relay can serve bytes, but it cannot substitute them without failing the chunk or final-file hash check.

4. Create a Hydra censorship receipt

Use a receipt to commit to an external post before it is removed or geo-blocked.

  1. Switch the composer to Hydra Censorship Receipt.
  2. Paste an Instagram, YouTube, or X/Twitter post URL. Other platforms are rejected by the current validator.
  3. Paste the original text or choose the original media file (up to 64 MiB). SPORE computes the SHA-256 digest. An optional note is limited to 280 characters.
  4. Press mine & seal receipt.

The signed receipt commits to the canonical URL, platform post ID, source SHA-256, source kind (media or text), and commit timestamp. It proves the author held that exact material at commit time. It does not detect a later takedown, timestamp the takedown, or query the platform. The proof is prior possession, not a platform-certified deletion record.

5. Export a PNG carrier

  1. On any feed card, press Pack into Stego PNG.
  2. SPORE renders a branded 1080×1080 lossless PNG—growing up to 4096×4096 if needed—and writes the framed packet bundle into the RGB least-significant bits.
  3. Share the .png as a file. The recipient imports it with Import Stego PNG.
  4. The carrier is not encryption, and the current UI exports a generated SPORE card rather than allowing an arbitrary cover image. Platform recompression can destroy the payload.

At 1080×1080, raw RGB LSB capacity is about 427 KiB; the encoder grows the canvas automatically until the compressed frame fits.

6. Export a self-replicating Quine

  1. Press Export Self-Replicating Quine (.html) in the top bar.
  2. The browser downloads spore-snapshot-<timestamp>.html.
  3. The document contains the application plus up to 200 verified packets, selected by trust, declared work, and recency. It is not necessarily the entire local store.
  4. Send it over messaging, email, AirDrop, Nearby Share, Bluetooth, USB, or any file-sharing channel. It opens and hydrates the verified feed with no server.

7. Use the command console and tour

The input above the workspace is a keyboard-first shortcut layer over the existing controls. Every original button and diagnostic remains available.

Command Action
/help Show the short command list
/join [topics] · /leave Start or stop live signaling
/post <text> · /seal Load a draft or mine and seal it
/video · /import Choose a Reel video or a stego PNG carrier
/export Export a self-replicating Quine
/filter all|2hop|pow Switch the feed filter
/receipt <url> Load a Hydra receipt draft
/vault · /bridge Open the key vault or manual SDP bridge
/status · /diagnostics · /trace · /clear Inspect state, hide/show the protocol trace, or clear it
/guide Open the nine-step interactive tour

Use the up/down arrow keys to recall prior commands. hide diagnostics collapses the right-hand protocol panels with CSS and keeps their nodes intact. Press guide for the interactive tour, which covers identity, discovery, publishing, video, the feed, offline carriers, the command console, and the prototype caveats.


P2P Swarm Guide

The live swarm is SPORE's optional real-time layer. It is not required to read, publish, import carriers, or open Quines.

How the live layer works

When you press join, SPORE:

  1. Resolves the channel field into a set of rooms. A blank field means your own creator room plus one reel room for every media packet already in your local feed.
  2. Announces presence over both BitTorrent WebSocket trackers and Nostr relays, room by room.
  3. Opens DTLS-encrypted WebRTC DataChannels to discovered peers and tags each connection with the room where it was found.
  4. Reconciles packets per room with a bounded inventory/request/response sync on join and every 45 seconds.
  5. Routes newly published packets through the Dandelion++-style stem/fluff path inside the same room, unless direct fluff is selected.

Nothing is joined implicitly: spore-global-v1 is opt-in, and a creator room never carries that creator's Reels.

1. Join a room

The channel field accepts these forms, separated by commas, spaces, or newlines:

Input Effect
(blank) Your own creator room plus the Reel room of every post or receipt already in your feed
global or spore-global-v1 The shared global room (all packets and inventories)
creator:<16 hex> That author's creator room (text and trust packets only)
spore:0x<64 hex> or a bare 64-hex pubkey The creator room derived from that public key
spore-creator-<16 hex> A literal creator room id
poetry, berlin Normalized topic rooms spore-topic-poetry and spore-topic-berlin
  1. Leave the field blank and press join for the isolation-preserving default.
  2. To follow an author, copy their creator:… handle and paste it into the field. You receive their text and trust packets, but not their Reels.
  3. Type global only when you deliberately want the shared firehose. Topic rooms are an explicit, separate scope.
  4. Importing a Stego PNG registers each verified media manifest and joins its exact Reel room automatically, even while signaling is offline. The signed packet is the authorization; unknown MEDIA_HAVE advertisements are ignored rather than triggering an automatic download.
  5. Press leave to stop signaling. Direct manual-bridge peers remain connected.

2. Creator and Reel rooms

SPORE derives room names deterministically from signed data:

creator room = spore-creator-${first 16 hex of author pubkey}
reel room    = spore-reel-${first 24 hex of sha256(`${author pubkey}:${media_id}`)}
packet room  = reel room if the packet has a media manifest, else creator room
  • A creator room advertises and serves only that author's non-media packets. A Reel packet lives in its own Reel room, never in the creator room. Following a creator therefore cannot leak their Reels.
  • A Reel room contains only the packet whose media_id derives that room. MEDIA_HAVE and MEDIA_REQ stay inside it, and gossip inventory is filtered to matching packets.
  • A peer can compute a Reel room only from the author's pubkey and the full media hash. A Stego PNG or Quine carries both inside a signed packet, so an import can find the swarm without a directory.
  • Global, topic, and manual/direct scopes keep their broader all-packet behavior. The manual bridge is an explicit, unscoped pairing and remains reachable from any room.
  • Room names are routing hints, not access control. They keep ordinary traffic separate; they do not encrypt payloads or hide metadata from relays and peers.

3. Understand packet propagation

  • A locally authored packet enters the stem at hop_count: 0 and is forwarded 1-to-1 to one randomly selected peer in the same room.
  • The packet fluffs with 30% probability per hop, when no stem peer remains, or at the 3-hop limit. Fluff packets are broadcast to room members except the sender.
  • Duplicate packet IDs are dropped, a stem node never forwards back to the peer it received from, and ingress rejects a packet delivered through a room it does not belong to.
  • Publishing a Reel joins its Reel room and the author's creator room before routing; the media packet itself travels only through the Reel room.
  • Uncheck Dandelion++ Stem Routing when latency matters more than source obfuscation.

This reduces trivial source identification. It does not provide anonymity against a global observer or hide your IP from direct peers.

4. Seed and fetch video

  1. The poster imports and publishes a Reel. SPORE stores every verified chunk, joins the deterministic Reel room, and announces available indices with MEDIA_HAVE inside that room only.
  2. A peer requests missing chunks in bounded MEDIA_REQ windows of 4–6 chunks, scoped to the same Reel room.
  3. The seeder answers with MEDIA_CHUNK; the receiver checks length and SHA-256 before storing.
  4. When all chunks are present, SPORE assembles the file and verifies the final SHA-256 against media_id before attaching a player.
  5. A peer that completes a download can seed it onward while its tab remains open.

A manifest is learned from a signed packet you published or imported, never from MEDIA_HAVE. An advertisement for an unknown media_id is ignored silently, so peers cannot push arbitrary media into your store.

If a large video stalls at n / total chunks, no connected peer in that Reel room currently has the remaining chunks. Ask the original poster to keep their tab open and joined, or use the offline carriers for small clips.

5. Use the manual bridge

Use the manual bridge when trackers and relays are blocked, or when two peers cannot discover each other.

  1. Press Open WebRTC peer bridge.
  2. On one side, press create invite, then copy code and send the spore-peer://… code over any out-of-band channel.
  3. On the other side, paste the invite, press accept invite, and return the generated answer code.
  4. On the inviter, paste the answer and press apply answer.
  5. Keep the dialog open until the direct channel reports connected.

The bridge needs a reachable direct network path. SPORE ships no TURN service, so symmetric NAT or restrictive firewalls can still prevent a connection. Treat invite codes as sensitive: they contain connection metadata and may expose network candidates. Share them only with the intended peer.

6. Troubleshoot

Symptom Likely cause What to try
No peers after join Relays/trackers blocked, empty topic, or slow discovery Wait, try global alone, check /status, or use the manual bridge
Packets do not appear Room scope, sync interval, or active filter Blank join follows your own creator room; paste creator:<handle> to follow an author, or global for everything. Wait up to 45 seconds and check /status
Only some packets arrive Peer has a partial store or left mid-sync Rejoin, wait for the next sync round, or import a carrier/Quine
Following a creator shows no Reels Reels live only in their own deterministic room Import the carrier or let the blank join include feed Reels; creator rooms never carry media
Unexpected global traffic global was typed explicitly Press leave, then rejoin blank or with a creator: handle
Video stuck at n / total No connected seeder has the remaining chunks in that Reel room Keep the source tab open and joined; small clips can be inline
High PoW filter is empty No local packet meets 16 declared bits Switch to All Verified or 2-Hop Trusted Only
A known author is hidden Mute or trust-filter state Check the mute list and select All Verified
PNG import rejected Recompressed image or corrupted file Resend as a document, not a photo; re-export the carrier
Direct bridge cannot connect Symmetric NAT or firewall, no TURN Try another network or VPN; fall back to offline carriers

7. Privacy boundaries

  • Public relays and trackers see connection metadata, room names, and IP addresses.
  • Direct WebRTC peers may learn your IP through ICE.
  • SPORE adds no application-layer payload encryption; WebRTC DataChannels provide transport encryption only.
  • Dandelion++-style routing is source obfuscation, not anonymity.
  • Room scoping limits which packets and media a peer exchanges by default. It is not access control: a determined peer can join a public room or import a carrier.
  • Manual bridge codes contain SDP and network candidates. Share them only through a trusted channel.
  • Use a VPN/Tor, the manual bridge, or offline transfer when network-level anonymity matters. Availability is never guaranteed.

Threat Model

SPORE assumes a hostile network, unreliable hosting, and platforms that may remove content without notice. It protects authorship integrity, local availability of already-distributed copies, and source obfuscation. It does not provide content confidentiality, strong anonymity against a global observer, or immunity to platform moderation.

Threat Why centralized systems fail SPORE counter Residual risk
DNS / SNI blocking and HTTP 451 Resolvers and middleboxes can block a domain or drop traffic in milliseconds. The application, cryptography, feed, stego decoder, and Quine hydration work with no network. There is no required origin. Live discovery uses BitTorrent WebSocket trackers, Nostr relays, and a manual SDP bridge. A total egress block prevents live discovery. Mirrors can still be blocked. There is no domain fronting or built-in covert channel; offline carriers still work.
App-store and platform takedowns Stores can remove apps on legal request; platforms can delete posts or accounts. SPORE is not an app-store listing. It is a single HTML document that can be mirrored, emailed, carried on USB, or sent through a messenger. Quines and PNG carriers embed verified packets; Hydra receipts commit before removal. File sharing can be blocked, browsers and operating systems can restrict local files, and a particular mirror can disappear. There is no automatic update channel unless you distribute a new file.
Video removal and CDN expiry Reels disappear when the host deletes them, rotates a CDN URL, or blocks a region. Video is sliced into SHA-256-addressed 64 KiB chunks, seeded by peers, and bound to the signed packet through media_cid. Clips up to 1.5 MB embed inline in Quines and PNG carriers. Large clips need a connected or previously seeded peer. Hashes prevent byte substitution, not withholding. A blackout with no carrier leaves only already-cached chunks.
Signaling choke points Blocking one API endpoint or tracker kills a standard WebRTC app. Two independent Trystero strategies run simultaneously: BitTorrent WebSocket trackers and Nostr relays, each with multiple endpoints. The manual SDP bridge (spore-peer://…) needs no tracker or STUN server. All public relays and trackers can be blocked. The bridge still needs a reachable path and cannot traverse every NAT. Signaling metadata and direct-peer IPs remain visible.
Accidental broad subscription A default global room or implicit media manifests turn a follow into a firehose and let peers push unrelated Reels into local storage. Joining is explicit and room-scoped. Blank join follows the local creator room plus feed Reels; global is opt-in. Creator rooms exclude media packets, Reel rooms admit only a matching media_id, MEDIA_HAVE never carries a manifest, and unknown media ids are ignored. Room names are public and a peer can deliberately subscribe to any room. Scoping reduces accidental collection, not targeted collection.
First-seeder IP harvesting An observer monitoring a DHT or relay can log the first address that announces a controversial packet. Locally authored packets enter a Dandelion++-style stem at hop_count: 0 and go 1-to-1 to one randomly selected peer over a DTLS-encrypted DataChannel. hop_count advances toward the 3-hop limit; each hop fluffs with 30% probability, when no stem peers remain, or at hop 3. Duplicate IDs are dropped, and stem/fluff selection is confined to the packet's room. DTLS protects transit, not source anonymity. A direct WebRTC peer can learn your IP through ICE; a global observer can correlate traffic. Use a VPN/Tor, the manual bridge, or offline transfer when that matters.
Sybil and spam floods Open P2P networks without central moderators can be flooded with cheap identities. Every ingress checks schema, packet ID, and Schnorr signature, and confirms the digest meets its declared PoW. Unknown authors need a 16-bit Hashcash floor to appear in the live feed. The 2-hop Web-of-Trust ranks known authors above strangers; mutes are absorbing; storage is bounded and deterministically evicted. SHA-256 PoW is commodity work, not memory-hard. A funded adversary can buy cycles. Trust is local and subjective, not global consensus. Verified packets in an embedded Quine seed are shown with a SEED tag even below the unknown-author floor.
Total internet blackouts Regional shutdowns sever WebSockets, STUN, and live signaling. The HTML Quine and PNG carriers work entirely offline. The DOM embeds an LZ-compressed packet set inside <script id="spore-quine-state">, and storage cascades IndexedDB → localStorage → memory. There is no live sync during a blackout; transfer is physical. Device seizure and carrier recompression remain risks.

What SPORE does not protect

  • Confidentiality. Packets are public. Anyone with the file, carrier, or Quine can read them.
  • Strong anonymity. Dandelion++-style routing reduces trivial source identification; it does not hide IP addresses from direct peers or a global observer.
  • Availability. A mirror, relay, or platform can still block or delete a copy.
  • Global moderation or consensus. The Web-of-Trust is a local policy choice, not a global reputation system.
  • Key persistence. The identity is ephemeral unless you create and restore an encrypted backup.
  • External audit. This is a working prototype; the cryptography and protocol have not been independently audited.

Protocol and Security Design

secp256k1 Schnorr — authorship and integrity

  • Identities are generated locally. Public keys are 32-byte x-only BIP340 keys, compatible with Nostr/NIP-01 conventions.
  • A packet ID is SHA-256 over a canonical [0, pubkey, created_at, kind, content, media_cid, reply_to, pow_nonce, pow_bits] tuple. The Schnorr signature covers the raw 32-byte ID.
  • Verification needs only the packet and the public key—no CA, DNS, account server, or trusted host.
  • hop_count and dandelion_phase are transport metadata excluded from the signed ID, so relays can update routing state without invalidating authorship.
  • Keys can be backed up with PBKDF2-HMAC-SHA256 (210,000 rounds) and XChaCha20-Poly1305; the passphrase never leaves the tab.

Counters: forged posts, tampered receipts, impersonation, and server-side content substitution.

Hashcash-style PoW — Sybil and spam friction

  • Each packet ID must have at least its declared number of leading zero bits in its SHA-256 digest, checked against the actual digest.
  • Default post work is 16 bits (about 65,536 hashes on average); trust packets use 12 bits; the UI exposes 8–20 bits.
  • Mining is sliced into short macrotasks with progress and cancellation, so a high-bit packet does not freeze the tab.
  • Verification happens at the network boundary and again at storage ingress.
  • Unknown authors need 16 bits to appear in the live feed. This is a local feed policy, not a global consensus rule.

Counters: bulk key generation and low-effort spam. This is deliberate friction, not a consensus mechanism.

2-Hop Web-of-Trust — local Sybil filtering

  • Trust commands are ordinary signed kind: 'trust' packets: follow:<pubkey>, vouch:<pubkey>, or mute:<pubkey>.
  • Scores: self 1.0, direct follow/vouch 0.8, second-hop vouch 0.4, unknown 0.1, muted 0.0.
  • Only an explicit vouch from a direct peer creates a second-hop relationship; follow chains cannot launder trust indefinitely.
  • Unknown authors are admitted at or above the 16-bit PoW floor. Mutes are absorbing, and mutes published by direct peers are honored by default.
  • The feed is ordered deterministically by trust, then recency, then ID; the store uses the same score for deterministic eviction.
  • Verified packets embedded in a Quine seed are displayed with a SEED tag, even when they are below the local unknown-author floor.

Counters: Sybil floods, reputation laundering, and unwanted authors. Trust remains a local policy choice, not a global reputation system.

Dandelion++-style routing — source obfuscation

  • A locally authored packet enters the stem phase at hop_count: 0 and is forwarded 1-to-1 to exactly one randomly selected peer over a DTLS-encrypted DataChannel.
  • hop_count runs from 0 to 3, the maximum stem depth. At each hop the packet fluffs with 30% probability, when no stem peers remain, or at the 3-hop limit. Fluff packets are broadcast to all peers except the sender.
  • Duplicate packet IDs are dropped, and a stem node never forwards back to the peer it received from.
  • The UI can bypass stem routing with direct fluff when latency matters more than source obfuscation.
  • Transport encryption only: WebRTC DataChannels are DTLS-encrypted by the browser, but SPORE adds no custom application-layer payload encryption.

Counters: trivial source identification and targeted blocking of the first publisher. This is source obfuscation, not strong anonymity.

RGB LSB stego PNG — takedown-resistant carriers

  • A packet bundle is serialized as UTF-8 JSON, LZ-compressed, and framed as:

    "SPOR" | uint32 payload length | uint32 CRC32 | compressed payload
    
  • The frame is written only into the red, green, and blue least-significant bits. No payload bits are stored in alpha; the exporter forces opaque alpha so canvas premultiplication cannot disturb the payload.

  • The default carrier is 1080×1080 (roughly 427 KiB of raw RGB LSB capacity) and grows automatically up to 4096×4096 if needed.

  • Export is a lossless PNG. Import validates magic, length, CRC32, decompression, bundle shape, and every packet's signature/PoW before merging.

  • A corrupt carrier is rejected with a CRC error; a valid carrier with a tampered packet keeps only the packets that verify.

Counters: URL takedowns and image-based redistribution. The image is the carrier, but it is not encryption—anyone can decode it, and lossy re-encoding destroys the payload.

P2P video swarm — content-addressed media

  • A video is sliced into fixed-size 64 KiB chunks. Each chunk gets a SHA-256 hash, and the complete binary gets a SHA-256 media_id.
  • The manifest records the file name, MIME type, byte length, chunk size, chunk count, per-chunk hashes, an optional source URL, and—for clips up to 1.5 MB—the complete inline base64 payload.
  • Chunks are cached in IndexedDB object store spore_video_chunks, keyed ${media_id}:${chunk_index}, with an always-on in-memory fallback for file:// and locked-down origins.
  • Peers announce availability with MEDIA_HAVE, request bounded windows with MEDIA_REQ (4–6 chunks), and answer with MEDIA_CHUNK. Every response is length-checked and hash-verified before storage; the assembled blob is verified again against media_id before a player receives it.
  • Media exchange is scoped to the Reel room. MEDIA_HAVE carries only the media id and available chunk indices; it never distributes a manifest or inline bytes. Unknown media ids are ignored silently, so a peer cannot advertise arbitrary content into your store.
  • Publishing a Reel joins both deriveCreatorRoom(author) and deriveReelRoom(author, media_id). Importing a verified Stego packet registers its manifest and joins the exact Reel room, which is how an offline carrier bootstraps live assembly.
  • The manifest rides inside the packet, but its media_id is bound to the signed media_cid. The packet ID and signature still cover the original canonical fields; media integrity is enforced by the chunk and full-file hash gates.
  • Inline clips make a feed item self-contained: a Quine or stego PNG can carry the whole video, and playback works offline with zero peers. Larger clips are availability-dependent and need a seeding peer.

Counters: file-host takedowns, CDN removal, and byte substitution. A peer can withhold chunks, but it cannot make altered bytes verify.

HTML Quine — self-replicating snapshots

  • Export clones the running application, strips transient session state (including key displays, passphrases, and backup JSON), and injects a compressed packet set into <script id="spore-quine-state" type="application/json">.
  • The payload is lz-string Base64, whose alphabet cannot contain </script, and packets are sorted canonically by ID so identical packet sets encode deterministically.
  • Export selects up to 200 verified packets, ordered by trust, declared work, recency, and ID. It is a selected snapshot, not necessarily the whole store.
  • On boot, storage reads the seed, decompresses it, verifies every packet, and drops invalid entries. Valid packets hydrate the feed with no network access.
  • Persistence cascades IndexedDB → localStorage → in-memory state, while the embedded Quine seed is merged and verified at boot. file:// and locked-down WebViews therefore remain usable.
  • The store is a content-addressed packet set with CRDT-style merge semantics and deterministic eviction. The Quine embeds a packet set, not a private key or a full CRDT state dump.

Counters: hosting takedowns, DNS blocking, and link rot. A Quine is a complete, portable copy of the app plus its selected public packet set.

Creator and Reel room isolation

  • deriveCreatorRoom(pubkey) returns spore-creator-${pubkey.slice(0, 16)}. It carries only that author's non-media packets.
  • deriveReelRoom(pubkey, mediaId) returns spore-reel-${sha256(${pubkey}:${mediaId}).slice(0, 24)}. It carries exactly the media packet whose complete file hash is mediaId.
  • derivePacketRoom(packet) selects the Reel room when media_manifest exists, otherwise the creator room. A packet therefore has one canonical derived room.
  • packetMatchesRoom enforces the split during inventory, sync, serving, and ingress. Creator rooms exclude media packets; Reel rooms admit only the matching media packet. Global, topic, and direct scopes retain broad visibility.
  • resolveJoinRooms leaves nothing implicit: blank input returns the local creator room plus rooms for feed posts and receipts; explicit input is parsed exactly as typed. global and spore-global-v1 are recognized only when supplied.
  • Swarm.joinRooms adds bindings without dropping existing ones, so a Stego import or Reel publication can extend the live set. MEDIA_HAVE, MEDIA_REQ, and gossip are scoped to the room that carried them.
  • Dandelion routing selects stem peers and fluff broadcasts within the packet's room. A manual bridge remains an explicit unscoped route.

Counters: unsolicited creator/Reel harvesting, accidental firehose subscription, and manifest injection. Isolation is traffic scoping, not encryption or access control.

Bounded anti-entropy sync

  • On joining a room and every 45 seconds, peers exchange a bounded inventory of packet IDs filtered to that room.
  • The receiver requests only missing IDs; the responder sends those packets, and every packet is verified again before storage and room admission.
  • Sync sessions have TTLs and concurrency caps; invalid, duplicate, or oversized messages are dropped.

Counters: partition repair and partial-store convergence without flooding the full set.


Build, Verify, and Distribute

Requires a current Node.js LTS release.

Build

npm ci
npm run verify          # typecheck + unit/integration tests + production build

npm run build alone produces the shippable artifact:

dist/index.html

The Vite + vite-plugin-singlefile pipeline inlines the JavaScript and CSS. dist/ contains no separate assets, and the built page makes zero network requests at boot.

Verified release

Current release: v0.3.0.

size:     319,708 bytes (~320 KB raw)
sha256:   4dabdaa4754373ea0748caf99ed0c9738ab9cff53efe94d5fa9b71faf284d2c2
tests:    124 passed across 8 files
typecheck: clean

The size and hash change whenever the source changes; re-run the audit for your own build.

Single-file audit

# Must print exactly one match, the embedded Quine seed slot.
grep -c 'id="spore-quine-state"' dist/index.html

# Must print nothing: no external scripts, stylesheets, images, or iframes.
grep -nE '<script[^>]+src=|<link[^>]+rel="stylesheet"|<img[^>]+src=|<iframe' dist/index.html || true

# The artifact should be the only file in dist/.
find dist -maxdepth 1 -type f

# Record the exact bytes you are distributing.
wc -c dist/index.html
shasum -a 256 dist/index.html

The source template (index.html) contains <script id="spore-quine-state" type="application/json"></script> before the module entry. Exported Quines replace its contents with a compressed packet set; the built application reads that element at boot. Keeping the slot in the template makes Quine hydration deterministic on file://.

Distribute

  1. Build and audit the artifact:
    npm run verify
    shasum -a 256 dist/index.html
  2. Copy dist/index.html anywhere. Rename it to spore.html if that helps recipients; the filename is not significant.
  3. Open it directly with file://, or serve it from any static host. No server-side runtime, rewrite rules, or MIME map is required.
  4. Share it over messaging, email, USB, a LAN share, IPFS, or any web host. Recipients need only a browser.
  5. For offline propagation, use Pack into Stego PNG on a feed item or Export Self-Replicating Quine (.html) to produce carriers that already contain verified packets.
  6. Live mesh is optional. Joining uses BitTorrent WebSocket trackers, Nostr relays, and the manual SDP bridge if those are blocked.

Operational notes

  • The build is a single file, but it is still executable HTML. Host it with Content-Type: text/html and avoid intermediaries that rewrite or minify the document.
  • Some browsers restrict IndexedDB or localStorage on file://; SPORE falls back to memory and the embedded seed rather than failing.
  • The identity is in-memory and ephemeral. Back it up from key vault before relying on it, and restore after reload. rotate discards the old identity unless it was backed up.
  • The creator:<16 hex> handle is derived from the public key prefix. It is a routing convenience, not a secret or a separate account.
  • Clear local feed & cached chunks removes spore_db_v1, spore_video_v1, SPORE's localStorage keys, in-memory packets, and cached media. The current identity and telemetry are kept, and embedded Quine seed data is not modified.
  • Live signaling and WebRTC expose metadata and possibly IP addresses. There is no TURN service, so symmetric NAT may block direct connections.
  • Verify packets, not screenshots. A carrier or Quine is only as trustworthy as the signatures inside it.
  • This is a prototype, not an independently audited security product.

License

MIT. See LICENSE.

About

Self-propagating, censorship-resistant P2P publishing in one self-contained HTML file. secp256k1 Schnorr, Hashcash PoW, WebRTC, PNG stego, HTML Quines.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages