Decimen Optical Transfer: The Browser Turns Light Into a File Pipe

A deep dive into the fountain-coded QR system that moves files across an air gap with no network, no cable, and no native app.

8 min read • View on GitHub • More from bashalarmistalt

A wide editorial scene shows a laptop on one side emitting a dense stream of QR tiles into open air while a smartphone on the other side captures them. Several tiles are missing or blurred, but the transfer still continues, suggesting that the link is resilient even when individual frames drop.
Decimen treats the screen as a transport medium, not a slideshow of QR codes. The file survives partial loss because the stream is coded for redundancy.
Key Takeaways

The Screen Is the Sender

Decimen Optical Transfer makes a simple promise: a file can cross an air gap through light alone. A laptop emits animated QR frames, a phone watches the screen, and the receiver reconstructs the payload without Wi-Fi, Bluetooth, or a cable.

That sounds like a party trick until you notice the constraint it solves. A camera-to-screen link is one-way, so the receiver cannot ask for a resend when a frame is blurred, skipped, or clipped by refresh timing. Decimen is built around that fact, not around wishful looping.

A screen-to-camera link has no back-channel: the receiver can't ask for retransmission, and it will inevitably miss frames (blur, refresh straddling, autofocus). Looping the frames and hoping is miserable: miss one frame and you wait a full cycle for it to come around. Fountain codes fix this completely.

Evan Crawley, Author / Maintainer · Decimen Optical Transfer GitHub Readme

Why Sequential QR Transfer Fails

ApproachNeeds network?Needs native app?Handles dropped frames?What actually breaks
Sequential browser QR loopNoNoPoorlyOne missed frame can stall the loop until it cycles back.
Handshake-based QR tools like qrcpYes, after pairingUsually no on the phone, but it depends on the networkNot relevantThe QR only bootstraps a network connection, so true air-gapping is gone.
Native optical tools like txqr or cimbarNoOften yesBetterThey can be fast, but install friction and specialized deployment raise the bar.
Decimen Optical TransferNoNoYesDropped frames cost time, not correctness.

The difference is subtle only if you ignore the protocol. Sequential tools assume order matters. Decimen assumes only information matters, so any sufficiently large set of unique frames can reconstruct the original file.

sequential QR:
  chunk 1 -> chunk 2 -> chunk 3 -> chunk 4
  if chunk 2 is missed, the receiver waits

fountain-coded QR:
  frame A = mix(chunks 1, 4)
  frame B = mix(chunks 2, 3)
  frame C = mix(chunks 1, 2, 5)
  any enough unique frames -> decode

The Fountain Code Is the Real Product

Fountain coding changes the question from “Did you catch frame 12?” to “Have you collected enough unique information yet?” That is why the link can survive missed frames without a resend path.

LT codes are the important idea here. Instead of sending chunk 1, then chunk 2, then chunk 3, Decimen emits randomized combinations of the source blocks. The receiver keeps collecting unique packets until the original file becomes solvable.

That is the right mental model for a simplex channel. A screen can speak, but it cannot listen. Fountain coding removes the need for that conversation.

A close-up metaphorical scene shows QR tiles falling like water droplets into a basin shaped like a decoder. Some droplets carry partial block labels, some miss the basin entirely, and a finished file emerges only after enough coded drops have collected. The image explains how order-independent redundancy can reconstruct a file even when individual frames are lost.
The decoder does not need every droplet. It needs enough unique combinations to make the whole file reappear.

How a File Becomes a Stream of Frames

The pipeline is practical, not mystical. A file is packed, compressed when that helps, wrapped with protocol metadata, hashed for integrity, and then turned into QR frames that the camera can decode in any order.

The integrity check matters more than it sounds. Optical transfer is not immune to bad capture conditions, so Decimen uses SHA-256 to verify that the reconstructed payload matches the original instead of trusting the camera blindly.

// conceptual flow from shared/protocol.ts
const packed = packFile(file, { gzip: true });
const framed = packFrame(packed, {
  filename,
  sha256,
  fountainMeta,
});
const qr = encodeFrame(framed);

// receiver side
const packets = collectUniquePackets(videoFrames);
const file = decodeFountain(packets);
verifySha256(file, sha256);

That structure is what makes the system feel less like a demo and more like a transport layer. The file is not being displayed. It is being serialized into a stream that a camera can sample.

The Browser Is Doing Native-App Work

The receiver is where the engineering gets serious. Decimen uses Web Workers to keep image processing off the main thread, WebAssembly QR decoding to handle the heavy lifting, and frame-capture optimizations like requestVideoFrameCallback to stay synchronized with the camera feed.

The build is equally opinionated. Vite and a single-file packaging flow inline the assets into a standalone HTML artifact, so the tool can live on its own without a traditional install step. That makes the browser feel less like a shell and more like a deployment target.

SubsystemWhat it doesWhy it matters
Web WorkersMove decoding work off the UI threadThe interface stays responsive while video analysis runs.
WASM QR decodingRuns zxing-cpp in the browserSafari gets a real decoder even without BarcodeDetector support.
requestVideoFrameCallbackSynchronizes capture with video framesThe receiver wastes less effort on stale frames.
Standalone single-file buildBundles the app into one HTML fileThe tool can be carried, copied, and opened without a build chain.

Why This Beats the Usual Alternatives

ProjectCategoryBrowser-only?True optical transfer?Main trade-off
Decimen Optical TransferFountain-coded QR transferYesYesMore protocol sophistication, but much better resilience.
qrcpQR handshake for network transferMostlyNoIt uses QR to start a network session, not to move the file itself.
txqrNative optical transferNoYesRequires a native receiver app.
libcimbarHigh-density color barcode transferNoYesFast, but much more specialized to deploy and use.
Sequential browser QR toolsLooped QR chunk transferYesYes, but brittleEasy to understand, weak under frame loss.

This is the category shift Decimen points at. The browser is not being used as a toy wrapper around a transfer script. It is acting as a full optical transport surface, with enough performance work beneath it to matter in practice.

What Decimen Proves About the Web

Decimen is a small project with an unusually large claim. It shows that the web can host a real transport system: one that handles lossy capture, does heavy decoding, verifies integrity, and ships as a single portable artifact.

That is why the project lands harder than a typical QR demo. It is not just moving bytes. It is showing that the browser can stand in for parts of a native stack when the problem is narrow, hard, and very well chosen.