Decimen Optical Transfer: Sending Files Through Light with Fountain-Coded QR Codes
Explore Decimen Optical Transfer, an open-source tool that streams files between devices using animated QR codes and fountain coding, achieving up to 130 KB/s with no network connection.
In a world where file transfer usually means cloud uploads, Bluetooth pairing, or USB cables, there's something almost magical about sending data through light. Decimen Optical Transfer (decimen.app) does exactly that: it turns your screen into a transmitter and your camera into a receiver, streaming files as an endless sequence of animated QR codes. No network, no pairing, no app installation—just two devices facing each other.
Why Optical Transfer?
Traditional file transfer methods rely on a network path between devices. But what if you're in a secure facility, a remote location, or simply want to avoid the hassle of setting up a connection? Optical transfer uses the most universal interface available: the screen and the camera. Every smartphone has them, and they work across platforms without any drivers or permissions beyond camera access.
The key insight is that a screen-to-camera link has no back-channel. The sender can't know if a frame was received correctly. This is where fountain coding shines.
The Magic of Fountain Codes
Fountain codes, specifically Luby Transform (LT) codes, are a class of erasure codes that generate an infinite stream of encoded symbols from a source file. The receiver only needs to collect a certain number of distinct symbols—about 1.15 times the original file size—to reconstruct the entire file, regardless of which symbols were lost.
In the context of optical transfer, this means the sender can broadcast frames continuously, and the receiver can drop frames (due to motion blur, glare, or camera misalignment) without any impact on correctness. Dropped frames cost time, never correctness. This is a massive improvement over sequential chunking, where a single lost frame would require a retransmission mechanism—impossible without a back-channel.
How Decimen Works
The project is built with TypeScript and uses node-qrcode for encoding and zxing-wasm for decoding. The architecture is split into send/ and receive/ directories, with a shared module for common utilities.
When you open the app on two devices, one goes to the /send/ page and the other to /receive/. The sender selects a file (up to 64 MB) or pastes a text snippet. The file is then compressed with gzip if it helps, and split into chunks. Each chunk is encoded into a QR code, and the stream of QR codes is animated on the screen.
The receiver's camera continuously scans the screen, decoding each QR code as it appears. The decoded chunks are stored, and once enough distinct chunks are collected, the file is reassembled. A SHA-256 hash verifies the integrity before the file is offered for download.
Performance and Real-World Results
The project reports a goodput of 130.5 KB/s in a real-world test (see the screenshot in the repo). This is impressive for a visual channel. The original experiment that this was extracted from reached 128 KB/s phone-to-phone. The protocol is designed to be efficient, and the use of fountain codes ensures that even with a high frame loss rate, the transfer completes as soon as enough frames are received.
Getting Started
To run it yourself, clone the repository and install dependencies:
npm install
npm run dev # https dev server with HMR
Then open https://localhost:5173/send/ on the sending device and the Network URL on the receiving phone (accept the self-signed certificate once). For production, use npm run build and serve the dist/ folder.
There's also a demo mode (npm run demo) that only allows sending bundled payloads, useful for testing without a real file.
Platform Quirks and Offline Support
The app is a PWA, so it works offline after the first visit and can be installed on iOS and Android home screens. The v0.3.0 release added Android capability probing, inline media playback, and share dialogs. The project also includes a standalone build that produces two self-contained pages, which can be hosted anywhere or even opened directly from a file system.
Privacy Considerations
It's important to note that optical transfer is not encrypted. Whatever is on the sending screen is readable by any camera pointed at it. The property you get is no network, not confidentiality. If you need privacy, you should encrypt the file before sending.
Similar Projects
The concept of optical data transfer has been explored by others. The README mentions:
mohankumarelec/airgapped-qr-code-transfer: browser-based QR file transfer with compression and sequential chunking.divan/txqr(2018): animated QR plus fountain codes in Go, with excellent write-ups on why fountain coding beats sequential looping.sz3/libcimbar: goes past QR entirely with a custom high-density color code purpose-built for this channel.
These projects show that the idea is not unique, but Decimen's implementation is polished, well-documented, and open source under the MIT license.
Conclusion
Decimen Optical Transfer is a fascinating example of using everyday hardware for unconventional purposes. It's not going to replace Wi-Fi for large transfers, but for quick, secure-in-the-sense-of-air-gapped transfers, it's a neat tool. The use of fountain codes is a clever solution to the no-back-channel problem, and the project is a great learning resource for anyone interested in optical communication or erasure coding.
Whether you're in a high-security environment or just want to impress your friends by beaming a file through the air, Decimen is worth a try. And since it's open source, you can dive into the code and see exactly how it works.