Media CDN service
Blockchain Multimedia CDN(Content Delivery Network) Service with DePIN Reward system
About
The problem it solves Multimedia now accounts for a significant portion of data in network services. In particular, real-time streaming services, such as Super Bowl broadcasts, demand extremely high data throughput. This service is proposed to improve network efficiency and reduce user costs by utilizing network user nodes as CDN (Content Delivery Network) services. The main problems this service aims to solve are: - Enhancing network efficiency - Establishing a revenue model by utilizing idle resources Also, This model allows the service and UI to be implemented independently, making it a promising solution for efficiently structuring video platforms that are currently monopolized by a few major service providers. User Interaction and Data Flow 1. Content Creator Content creators are the backbone of the platform, bringing diverse and engaging content to the network. They can: Upload Creative Content Seamlessly upload videos or live streams to the platform using a user-friendly interface. Content is securely stored and distributed across decentralized nodes. Set Rewards for Distribution Define reward shares for CDN providers and set a price for users who want to access the content. Transparent reward mechanisms ensure fair compensation for each view. 2. CDN Provider CDN providers play a crucial role in maintaining efficient and fast content delivery. They can: Discover and Fetch Content Data Search for popular or trending content on the network to maximize their rewards. Use metadata to efficiently locate and cache content. Convert to Streaming-Optimized Format Transcode videos into HLS (HTTP Live Streaming) or other adaptive streaming formats for smooth playback. Efficient segment-based streaming reduces latency and bandwidth consumption. Earn Rewards for Distribution Receive a share of the payment made by users based on the creator's predefined reward settings. Rewards are distributed through a transparent and verifiable smart contract system. 3. Client (Viewer) Clients are end-users who access and enjoy the content. They have two options: Pay & Enjoy Content Instantly Make a quick and secure payment using cryptocurrency to unlock content. Payments are divided between the content creator and CDN provider based on the set rewards. Contribute Resources Instead of Paying If they prefer not to pay, clients can choose to share their idle bandwidth or storage resources. Contribution is rewarded proportionally, allowing them to access content without direct payment. The project architecture and development process Content Creator Layer Allows creators to upload videos and set reward shares for CDN providers. Uses IPFS (InterPlanetary File System) and EthStorage for decentralized content storage. Metadata and content information are stored in a SQLite database for quick access. CDN Provider Layer CDN providers cache, transcode, and distribute content efficiently. HLS (HTTP Live Streaming) is used to convert video files into segment-based streams for adaptive bitrate delivery. Rewards are distributed based on smart contracts deployed on the Sepolia testnet. Client Layer Users can pay to access content directly using cryptocurrency. Alternatively, they can contribute idle bandwidth or storage in exchange for access. Uses a web-based interface with React and FastAPI for seamless interaction. Blockchain and Smart Contract Layer Manages payments and reward distribution using Ethereum smart contracts. Ensures transparent and automatic payment splitting between content creators and CDN providers. Product Integrations Data Handling SQLite Serves as the primary database for storing metadata about video content, such as CID, creator information, and pricing. Manages access logs to facilitate reward distribution based on viewership. Redis Role: Acts as an in-memory cache for fast access to frequently requested data. Manages and indexes streaming server information for each CID. 2. Backend Python (FastAPI Framework) Role: Serves as the backend framework, handling API requests, data processing, and database management. Integrates with Web3.py for blockchain interactions and with FFmpeg for video transcoding. Key Features: RESTful API endpoints for uploading content, streaming, and payment processing. Uses Pydantic for data validation and SQLite for persistent storage. 3. Frontend Next.js Role: Provides the server-side rendering for the frontend and integrates with React for a dynamic user interface. Facilitates smooth navigation and enhanced performance for end-users. Key Features: Renders components for uploading content, making payments, and streaming videos. Manages state and data fetching efficiently. ethers.js Role: Facilitates blockchain interactions from the frontend, including payments and smart contract calls. Manages user authentication and payment confirmations through MetaMask. Key Uses: Sends payments to content creators and CDN providers based on viewing FFmpeg (Command Line Integration) Role: Transcodes video uploads into HLS format for efficient streaming. Segments videos and generates .m3u8 playlists for adaptive bitrate streaming. Key Uses: Converts uploaded videos into HLS with segment-based streaming. Ensures compatibility across different devices and browsers. EthStorage API Role: Used for storing and retrieving video files on a decentralized Ethereum-based storage system. Ensures tamper-proof content storage with smart contract-based access control. Key Functions: Upload content using ethfs-cli commands. Retrieve and verify content integrity using Key differentiators and uniqueness of the project Decentralized Content Delivery with DePIN Rewards Key Feature: Utilizes DePIN (Decentralized Physical Infrastructure Networks) to reward nodes that contribute to content delivery. Eliminates reliance on traditional centralized CDNs by allowing any user to participate as a CDN provider and earn rewards. Uniqueness: Combines decentralized storage (IPFS, EthStorage) and delivery with blockchain-based payments, ensuring both data availability and a fair compensation model for participants. Blockchain-Powered Incentive System Key Feature: Distributes rewards transparently based on viewing metrics recorded on-chain. Uses smart contracts to manage payments to content creators and CDN providers proportionally. Uniqueness: Most traditional CDNs lack a transparent incentive mechanism. This project not only provides a transparent reward system but also allows micropayments directly through blockchain transactions. Content Ownership and Monetization Control Key Feature: Content creators retain ownership of their content with complete control over pricing and distribution. Uses Ethereum-based CID (Content ID) system to secure ownership rights. Uniqueness: Differs from centralized platforms where content creators often lose control over pricing and revenue distribution. This model ensures that creators receive their fair share without intermediaries. Adaptive Streaming with HLS and hls.js Key Feature: Supports HTTP Live Streaming (HLS) with adaptive bitrate for smooth playback. Integrates hls.js for in-browser playback without requiring plugins. Cost-Efficient and Scalable Infrastructure Key Feature: Leverages user-operated nodes as CDNs to reduce infrastructure costs. Enables scalability by allowing any user to act as a CDN provider. Additional Features -