Reddit - r/programming

I built a peer-to-peer blockchain that runs 100% inside browser tabs - no backend, no database, no server

Hey r/programming, weekend-project-turned-obsession here. I wanted to see how far you could push "serverless" - so I made a cryptocurrency where the entire network is just open browser tabs.

Stack

  • WebRTC data channels for peer mesh (with deterministic mutual-dial resolution so two nodes never keep duplicate connections)
  • MQTT-over-WebSocket as a zero-config gossip fallback (every node subscribes to the same public broker topics)
  • IndexedDB for chain storage, snapshots every 1,000 blocks
  • A Web Worker miner hard-capped at 70k H/s regardless of hardware
  • secp256k1 signatures, v2 scheme binds chain-id to prevent replay across networks

Sybil resistance without central authority

The interesting problem was sybil resistance without a central authority. Solution: a ~65k-hash PoW challenge after every handshake. Flooding the network with fake peers costs real CPU per connection.

Another fun constraint: one miner per browser (Web Locks API) and a consensus-enforced cooldown so the same address can't mine two consecutive blocks.

It's an experiment, MIT-licensed, no token sale, no investors. I'd love to hear how you'd break it or what architectural choices you'd question. Repo: README has the full threat model if you want to dig in.

Comments

No comments yet. Start the discussion.