Developers Katta · Devcon 8 · Day 1: censorship resistance

What survives when the host disappears

Rebuilding a community archive on Swarm, one threat at a time

Alok Nerurkar · Swarm

Hook

Where websites live today

your browser DNS (registrar)CDN edgeOrigin VPS, or web / static hosting each red box is one company that can take the page down

A name needs a registrar; the page needs an origin (a VPS you run, or a managed web/static host); most sites sit behind a CDN in front of that origin.

Hook

How each one gets censored

LayerLeverWhoUsers see
VPSterminate accounthost provider"account suspended"
CDNdrop origin at the edgeCDN operatorTLS error / blocked page
Web / static hosttake project downthe platform404, "not available"
DNSsuspend / seize domainregistrar or registryNXDOMAIN

"Service continuity is in the hands of the organisation and is only weakly incentivised by reputation."

Book of Swarm §1.2.2 (lack of service continuity guarantees, single attack target, corruption, censorship)

Hook

Anatomy of a "decentralised" dApp

Smart contract ✓ Frontend hostDomain / DNSRPC providerAPI / indexer each red box is one company that can switch it off

The contract can't be stopped. Everything users touch can.

Where Swarm comes from

The Book of Swarm

The Book of Swarm page on ethswarm.org
  • 2015: the storage of the "world computer" trinity: Ethereum, Whisper, Swarm
  • Vitalik coined the protocol tag bzz
  • Mainnet since June 2021 (Bee 1.0)
QR code for The Book of Swarm PDF
the book (free PDF)

Book of Swarm, Acknowledgments ("Conception and influences"), §1.3.5

Mental model

Swarm in one picture

your file4 KB chunksaddress =nearest split and hashedhash of the contentneighbourhood stores it paid by a postage batch no origin server · any node can fetch any chunk · the address checks the content

Book of Swarm §2.2 (chunks and storage), §3.3 (postage), §3.4 (redistribution)

Mental model

Chunks, addresses, neighbourhoods, postage

Book of Swarm §2.2.2 (CAC), §2.2.3 (SOC), §2.1.2-2.1.3 (overlay addressing, Kademlia), §3.3.1 (postage)

Mental model · data structures

Data and metadata are both chunks

StructureWhat it holds
File4 KB data chunks; intermediate chunks hold up to 128 child addresses; one root reference for the file
Manifestpaths → references + metadata (Content-Type, Filename, index doc); a chunk trie (Mantaray) — a website
Feed(owner, topic) → latest reference; a signed SOC per update, addressed by owner, topic and index
Feed manifestmetadata names a feed (owner and topic); /bzz resolves the latest version — the deck's own stable URL

Book of Swarm §4.1.1, §4.1.2, §4.3, §4.3.1

Content, structure, metadata and history are all chunks. A node only stores and serves chunks; the application lives in Swarm.

Mental model · this deck

This deck, all chunks

THIS DECK A RE-UPLOAD Feed manifest Latest feed update (a SOC) Deck manifest File chunk trees New deck manifest New feed update 4 KB chunks: every box above is made of them owner + topic katta-deck / → index.html, /img/…, /qr/… (Content-Type) feed manifest (katta-deck) stays → URL stays

Live demo · threat: host takedown

You're looking at Swarm

Live demo · if the web path is blocked

Blocked? Read it yourself

QR code for ethswarm.org/access
ethswarm.org/access
QR code for Freedom Browser
Freedom Browser

ethswarm.org/access · github.com/solardev-xyz/freedom-browser

Serverless backend · push-sync

Stored before the upload returns

Book of Swarm §2.3.2 (push syncing)

Serverless backend · built-in CDN

Relaying nodes cache what they forward

Book of Swarm §2.3.1 ("Opportunistic caching")

Serverless backend · auto-scaling

Goes viral → more caches → it scales itself

Honest note: a node's cache is bounded (default 1,000,000 chunks, about 4 GB) and evicts the oldest entries. The cache makes it fast; the postage batch paying the neighbourhood is what guarantees it's still there.

Book of Swarm §3.1.2 ("Caching and auto-scaling")

Serverless backend · summary

Swarm is a serverless backend

Updates · threat: needing a mutable server

A CMS needs a server, a database and an admin login. A feed needs a key.

Book of Swarm §4.3 (feeds: mutability in an immutable store)

Keep it alive · threat: the funder stops paying

Keep it alive

No permission needed: anyone can top up any batch before it expires.

Book of Swarm §3.3, §5.1, §5.2

Lightning round · 1/4

Operators can't know what they store

Book of Swarm §2.2.1 (requirement), §2.2.4 (encryption)

Lightning round · 2/4

Storers can't tell who asked

Book of Swarm §2.3.1, Fig 2.14

Lightning round · 3/4

Share with some, not all

Book of Swarm §4.2 · Bee API /grantee

Lightning round · 4/4

Messages without a server (PSS)

Book of Swarm §4.4 (Pss: direct push messaging with mailboxing) · Bee API /pss

What's possible · 1/3

Streaming over Swarm

QR code for the Swarm streaming paper
how it works
QR code for the Devcon 8 streaming talk
Devcon 8 talk

~2-7 s per 1.85 MB segment in-browser · ethswarm.org paper · Devcon 8 talk · Book of Swarm §4.3

What's possible · 2/3

Real-time messaging: GSOC

QR code for the GSOC docs
docs.ethswarm.org · GSOC

docs.ethswarm.org GSOC page

What's possible · 3/3

Pub/sub: coming soon

This afternoon

This afternoon: build

L1Publishentries + index + feed (checkpoints 1–3)
L2Unhostablenpm run deploy: the app itself on Swarm, 2+ paths
L3Keep alivebatch status, pin elsewhere, adopt another team's archive
L4Write without usstamp chunks in the browser with your team key, upload to any node

Archive something real: a song, a recipe, a place, a story from your region. Build in your own GitHub repo: GUIDE, checkpoint 0.

16:00 teardown, one line: 2+ read paths, 2+ feed updates, a rejected tamper, no non-Swarm host — npm run teardown checks all four.

QR code for the starter repo
starter repo

Take it with you

Links

QR code for this deck
this deck (on Swarm)
QR code for The Book of Swarm PDF
the book (free PDF)
QR code for ethswarm.org/access
run a client (access)
QR code for Freedom Browser
Freedom Browser
QR code for the starter repo
starter repo (afternoon)

Scan the first QR: this deck, right now, with my laptop node off.