惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
MyScale Blog
MyScale Blog
博客园_首页
G
Google Developers Blog
博客园 - 【当耐特】
美团技术团队
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
小众软件
小众软件
博客园 - 司徒正美
雷峰网
雷峰网
T
Tailwind CSS Blog
V
V2EX
博客园 - 三生石上(FineUI控件)
F
Fortinet All Blogs
罗磊的独立博客
量子位
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built an offline wiki that fits in a single 19 KB HTML ...
Alexey Sitnikov · 2026-06-15 · via DEV Community

Alexey Sitnikov

I kept hitting the same wall looking for an offline wiki. Kiwix is great, but it's an app plus multi-GB ZIM files. IPFS needs connectivity and setup. I just wanted something dead simple: a knowledge file you can open on any phone with no install, and hand to the next person over Bluetooth or a USB stick.

So I built Portable Knowledge Mesh. It's one reader.html (~19 KB). You open it — even straight from file:// — load a .mesh pack, and read/search offline. To share it, you just send the file; the other person opens it in any browser. The whole thing — reader plus a 21-article survival pack — is under 50 KB. It fits in a single chat message.

🌐 Portable Knowledge Mesh — an offline wiki in a single file

A Wikipedia that spreads via Bluetooth, USB, and AirDrop — no server, no install, no internet required.

License: MIT Content: CC BY-SA 4.0 Release Made by one dev

🇷🇺 Русский · 🇪🇸 Español · translations wanted — see #good-first-issue


What is this?

Portable Knowledge Mesh is a single HTML file that turns any phone or laptop into an offline wiki. It opens in a browser — even straight from a USB stick, an email attachment, or a Bluetooth share — and lets you read, search, and pass on curated knowledge without ever touching a server.

  • 🚀 Zero install — double-click reader.html, it works. No app store, no setup.
  • 📴 Fully offline — no internet, no backend, no API keys, no account.
  • 🔒 Tamper-proof — every knowledge pack is cryptographically signed (ECDSA P-256, WebCrypto). Forgeries are rejected automatically.
  • 🦠 Viral by design — send a .mesh file over…

Here are the parts that turned out interesting to build.

A single file that runs from file://

The constraint "must work when double-clicked off a USB stick" kills a lot of the usual toolbox:

  • No Service Worker — they require a secure context; file:// isn't one.
  • No IndexedDB — in a file:// (null) origin it's unreliable and non-portable across browsers.

So v0.1 keeps everything in memory + sessionStorage, and a .mesh is just a single JSON document (zero dependencies, trivially parseable). The fancy ZIP + CompressionStream container is a later optimization — for v0.1, plain JSON is what makes it bulletproof on file://.

Tamper-proof packs with WebCrypto (no libraries)

If knowledge spreads device-to-device with no server, "is this pack genuine?" matters. Each pack is signed: every article (block) is hashed with SHA-256, a Merkle root is computed over the sorted block hashes, and the publisher signs that root with ECDSA P-256 via the browser's built-in crypto.subtle. The reader re-derives everything and verifies — change one byte of a signed article and the badge turns red.

// recompute block hashes -> Merkle root -> verify the publisher's signature, all in-browser
async function verifyPack(mesh) {
  const m = mesh.manifest;
  const per = {};
  for (const [id, md] of Object.entries(mesh.content.blocks)) {
    per[id] = await sha256Hex(md);
  }
  const root = await sha256Hex(Object.keys(per).sort().map(id => per[id]).join(''));
  if (root !== m.merkle_root) return 'tampered';            // content was modified

  const key = await crypto.subtle.importKey(
    'jwk', m.publisher.pubkey_jwk,
    { name: 'ECDSA', namedCurve: 'P-256' }, true, ['verify']
  );
  const ok = await crypto.subtle.verify(
    { name: 'ECDSA', hash: 'SHA-256' },
    key, b64ToBytes(m.signature_b64),
    new TextEncoder().encode(m.merkle_root)
  );
  return ok ? 'verified' : 'tampered';   // no private key = can't re-sign a forged root
}

Two attack paths, both covered: edit a block and the recomputed hash won't match the manifest; edit the manifest to match and the signature over the new root fails (you can't re-sign without the private key).

The CRDT trap I had to avoid (for v0.2 editing)

v0.2 will let local communities adapt articles. My first instinct was a CRDT like Yjs or Automerge — until I remembered the quota death spiral: sequence/text CRDTs accumulate tombstones, history grows without bound, and safe garbage collection needs coordination among all nodes. In an offline mesh where devices may not meet for months, there's no server to compact — so the document just bloats until QuotaExceededError.

The fix is choosing a lighter CRDT, not abandoning CRDTs:

  • LWW-Map per block instead of a sequence CRDT — only the current value per field is kept, so no tombstone history.
  • Lamport clocks, never wall-clock. Offline devices have unreliable, forgeable clocks (dead CMOS battery → 1970; set the date to 2099 and you always "win"). Conflicts resolve by logical time, tie-broken by author key.
  • Trusted-snapshot compaction — a trusted editor publishes a signed snapshot that peers who trust them accept as a new baseline, dropping old ops. Compaction with no server.

Sneakernet first

WebRTC is tempting for sync, but without STUN/TURN it only connects inside one LAN — too fragile to be the critical path. So the primary transport is just moving the file: Bluetooth, AirDrop, USB, QR, email. WebRTC LAN-sync is a v0.3 bonus, never a dependency.

Where it is now

  • v0.1 — portable read-only reader (this release)
  • 🚧 v0.2 — editable overlay + local web of trust + Lamport sync over file exchange
  • 📡 v0.3 — installed PWA mode + WebRTC LAN-sync + trusted-snapshot compaction

It ships with Barefoot Skills — 21 practical offline articles (water, energy, repair, food, shelter), risk-stratified so safety-critical topics are signed and read-only. Code is MIT, content CC BY-SA, all sourced from open corpora (Appropedia, Wikibooks, Practical Action).

I'd love your feedback

  1. Is the single-file / "sneakernet" approach genuinely useful, or a gimmick?
  2. What knowledge packs would be worth curating first — first aid, repair, farming, a specific language?

And if you want to poke holes in the crypto or the v0.2 merge design, please do — that's exactly the kind of review I'm hoping for.

Repo: https://github.com/by-sitnikov/portable-knowledge-mesh