Introduction
Project Name: CDN-pi
Name of the organization or individual submitting the proposal:
Kanu Juliet
I worked as a Backend Developer on Loteraa, a decentralized IoT platform, where I built a scalable backend using Node.js (Express) and designed a PostgreSQL database to efficiently manage users, devices, and high-volume IoT data. I developed secure RESTful APIs, implemented authentication, and optimized queries for performance and reliability
Project Description
Describe your project:
CDN-pi is a content delivery network purpose-built for media streaming, built on top of Sia.Storage — the Sia Foundation’s hosted indexer. It enables independent creators and platforms to stream video over censorship-resistant, decentralized infrastructure without dependence on centralized CDN providers such as Cloudflare Stream, Bunny.net, or AWS CloudFront.
Using Sia.Storage as the indexer removes the need for operators to run a self-hosted Indexd node or manage an SC wallet. Apps connect via the Sia.Storage Application API, upload HLS video segments as discrete objects, and retrieve them using unauthenticated public download — the feature currently being finalized by the Sia Foundation. CDN-pi’s development timeline is aligned to begin once that feature ships, ensuring the retrieval layer is built correctly from day one.
What is the high-level architecture overview for the grant?
[Source Video]
|
v
[Transcoder — FFmpeg]
| Produces HLS segments (.ts files) and playlists (.m3u8)
| at three quality tiers: 360p / 720p / 1080p
v
[Sia.Storage — Application API]
| Each .ts segment and .m3u8 playlist uploaded as a
| discrete object. Returns an object ID per file,
| stored in the edge server's metadata database.
| Unauthenticated public download used for retrieval.
v
[Sia Network]
| Stores segments across 30+ hosts
| Reed-Solomon erasure coding (10-of-30 shards required)
| ChaCha20 encryption at rest
v
[Edge Server]
| Generates and serves .m3u8 playlists dynamically
| from metadata DB (no live Sia.Storage query per request)
| LRU in-memory cache → local disk cache → Sia.Storage fetch on miss
| Pre-fetches first 5 segments on stream start to hide retrieval latency
v
[HLS-Compatible Video Player]
Playback via HLS.js (browser), Safari (native),
or ExoPlayer (Android) with adaptive bitrate switching
Sia.Storage as the indexer
Sia.Storage is the Sia Foundation’s hosted indexer, accessible via its Application API without requiring a local Indexd node or SC wallet. Apps connect using a URL-signed application key, upload objects, and receive object IDs for future retrieval. No SiaCoins are required for the MVP.
HLS segment format
Each HLS segment (~6 seconds, 1–3 MB at 720p) maps to a single Sia.Storage object. Sia’s retrieval layer supports HTTP Range requests, enabling seek and scrub within a segment. HLS has the widest device compatibility: iOS Safari (native), Android via ExoPlayer, desktop via HLS.js.
Adaptive Bitrate (ABR) streaming
FFmpeg produces three quality tiers per video. The edge server generates a master .m3u8 referencing a variant playlist per tier. Players switch quality dynamically based on available bandwidth. Each tier’s segments are stored as separate objects and tracked independently in the metadata database.
Segment metadata database
A PostgreSQL database maps (video_id, quality_tier, segment_sequence) → sia_storage_object_id, allowing instant playlist generation without querying Sia.Storage per player request.
Edge caching and latency management
Sia’s erasure-coded retrieval introduces higher first-fetch latency than traditional CDNs. CDN-pi addresses this with:
- Pre-fetch: The edge server requests the first 5 segments from Sia.Storage on stream start, before the player requests them.
- Two-tier cache: Hot segments in LRU in-memory cache; warm segments (last 24h) on local disk.
- Player buffer: HLS.js configured to maintain a 20-second forward buffer before playback begins.
What security best practices are you following?
- All content stored on Sia is encrypted at rest using ChaCha20 via Sia.Storage — the edge server never holds unencrypted source files.
- Sia.Storage Application API keys are scoped per application and stored as environment variables, never hardcoded.
- The edge server exposes no public write endpoints; all upload operations are performed server-side only.
*Input validation is enforced on all accepted video formats before transcoding begins, preventing malformed files from reaching the pipeline.
How does it serve the Foundation’s mission of user-owned data?
Centralized video CDNs are among the most consequential choke points for content ownership on the internet. Platforms routinely remove or throttle content unilaterally, with no recourse for the creator. CDN-pi makes video ownership operational: once a creator’s segments are on the Sia network via Sia.Storage, no intermediary can revoke access. Any CDN-pi edge server can serve the stream using only the public object ID.
CDN-pi also serves as a concrete reference implementation proving that Sia.Storage can power latency-sensitive, real-time applications — not just archival storage — expanding the ecosystem’s perceived scope for future developers. All code will be released under the MIT License (OSI-compliant) and documented for other developers to build on.
Compliance & Eligibility
Are you a resident of any jurisdiction on the FATF/OFAC restricted list?
No
Will your payment bank account be located in any jurisdiction on that list?
No
Budget
Amount of money requested and justification with a reasonable breakdown of expenses:
Total requested: $9,000 USD
| Item | Cost (USD) |
|---|---|
| Developer fees | $8,500 |
| Infrastructure (2 edge server VMs) | $500 |
| Total | $9,000 |
Goals
- Build an open-source, Sia.Storage-backed HLS video upload and segment management pipeline
- Build a self-hostable edge server with two-tier caching and adaptive bitrate playlist serving
- Demonstrate end-to-end media streaming on Sia infrastructure, from upload to browser playback
- Publish operator documentation, and a full upload-to-stream walkthrough to lower the barrier for future Sia developers building media applications
Milestones
| Milestone | Description | Deliverable | Estimated Completion |
|---|---|---|---|
| 1 | Sia.Storage integration + upload pipeline | Library that accepts source video, transcodes to HLS via FFmpeg, and uploads all segments and playlists to Sia.Storage via the Application API. Segment–object-ID mapping stored in PostgreSQL. MIT-licensed public repository. Development begins once unauthenticated download is live in Sia.Storage. | Month 1 |
| 2 | Edge server — playlist serving, cache layer, and adaptive bitrate support | HTTP server serving .m3u8 playlists from metadata DB; .ts segments served from LRU in-memory cache, local disk cache, or Sia.Storage unauthenticated fetch on miss. Pre-fetch pipeline warming first 5 segments on stream start. Master playlist with 3 ABR tiers (360p / 720p / 1080p). Browser demo via HLS.js. Deployable via Docker. |
Month 2 |
| 3 | Documentation, benchmarks, and public release | End-to-end latency benchmarks (cold vs. warm retrieval). Operator setup guide, API reference, and walkthrough video of a full upload-to-stream flow on Sia.Storage. | Month 3 |
Target Users
-
Independent content creators — podcasters, filmmakers, and journalists who want full ownership of their video with no platform able to remove or restrict it.
-
Decentralized platforms and dApps — engineering teams building on Web3 protocols that need a trustless, non-custodial video delivery layer with no vendor lock-in and no fiat-priced SLAs.
-
CDN operators and self-hosters — systems engineers who want to run their own Sia-backed edge node, deployable via Docker with configurable cache size and pre-fetch depth.
What Are Your Plans For This Project Following The Completion Of This Grant?
1. Multi-operator edge network
The next phase introduces a federated model where any individual or organization can run a CDN-pi edge node registered in a shared directory. Requests are routed to the nearest available node and operators are compensated proportional to bandwidth served, creating a self-sustaining incentive layer.
2. Live streaming support
A future phase extends CDN-pi to low-latency live streaming using Low-Latency HLS (LL-HLS). Live segments from a broadcaster are uploaded to Sia.Storage in near real-time (2–4 second segment duration), targeting end-to-end stream delay under 10 seconds.
3. Creator-facing web platform
A non-technical web dashboard where creators connect to Sia.Storage, upload a video source, and receive a shareable embed link — fully decentralized, with no server setup required from the creator.
Potential Risks That Could Affect the Outcome
| Risk | Mitigation |
|---|---|
| Unauthenticated download feature delayed — If Sia.Storage’s public download feature ships later than expected, the edge server retrieval layer cannot be built as designed. | Milestone 1 (upload pipeline and metadata layer) does not depend on unauthenticated downloads and can proceed immediately. The retrieval-dependent edge server (Milestone 2) begins only after the feature ships. |
| Sia.Storage API changes — Sia.Storage is in active development and may introduce breaking changes. | Pin to a specific API version at project start. Monitor the Sia Foundation changelog and dev portal, with buffer time allocated in each milestone. |
| Sia host retrieval latency — Cold segment fetches from distributed hosts may exceed acceptable thresholds for viewer experience. | Pre-fetch pipeline and two-tier cache are specifically designed to absorb this. Latency benchmarks in Milestone 3 will quantify worst-case cold retrieval and inform further tuning. |
| FFmpeg transcoding edge cases — ABR pipelines can behave unexpectedly with certain codecs or container formats. | Scope Milestone 1 to a well-defined set of input formats (H.264/AAC in MP4 and MKV), explicitly documented in the repository. |
Development Information
Will all of your project’s code be open-source?
Yes
Leave a link where your code will be accessible for review
github.com/Kanujuliet/CDNs-pi
GitHub - Kanujuliet/CDNs-pi
Do you agree to submit monthly progress reports?
Yes
Contact
Email: [email protected]