Decentralize your own media post and earn from them, with Walrus & X402!
Mediearn is a decentralized content monetization platform that enables creators to publish articles and earn revenue through micropayments. The platform leverages blockchain technology and decentralized storage to create a censorship-resistant, creator-owned content ecosystem. Core Functionality: Content Publishing: Users can upload articles (TXT, MD, PDF, DOC, DOCX) through a web interface Decentralized Storage: All content is stored on Walrus Network, a decentralized storage solution Micropayment Access: Readers must pay small amounts (0.01 USDC) to access premium articles Multi-Chain Support: Supports Ethereum, Base, Base Sepolia, and Flow Testnet networks Real-time Payment Processing: Uses x402 protocol for seamless micropayment verification Key Features: Payment-Gated Content: Every article requires payment for access Wallet Integration: Seamless MetaMask/Web3 wallet connection Cross-Chain Compatibility: Users can pay from different blockchain networks Content Preview: Free previews with payment required for full access Server Health Monitoring: Real-time connection status display
Technology Stack Frontend: Next.js 14 with App Router for the React framework TypeScript for type safety and better development experience Tailwind CSS with shadcn/ui components for modern, responsive UI Wagmi for Ethereum wallet integration and chain management Viem for low-level Ethereum interactions Backend: Node.js with Express.js for the API server TypeScript for type-safe server-side code File system storage for metadata and payment tracking Walrus Network SDK for decentralized content storage Blockchain & Payments: x402 Protocol for micropayment verification and processing USDC as the payment currency Multi-chain support (Ethereum, Base, Base Sepolia, Flow Testnet) Architecture & Integration Content Flow: Upload Process: User uploads file through React form File is processed and uploaded to Walrus Network Metadata stored locally with Walrus blob ID reference Payment details configured (0.01 USDC per access) Content Access: Reader connects wallet and selects article x402 middleware intercepts request and requires payment Payment processed through user's wallet Content fetched from Walrus Network upon successful payment Access recorded in local payment tracking system Key Technical Decisions: Decentralized Storage Integration: Used Walrus Network for content storage instead of traditional cloud storage Implemented blob-based storage with content certification Local metadata storage with Walrus blob ID references for efficient retrieval Payment System: Implemented x402 protocol for seamless micropayment processing Payment verification middleware that intercepts content requests Multi-chain payment support with automatic network detection Real-time payment status tracking and access control Wallet Integration: Custom ConnectButton component with multi-network support Dynamic network switching with visual indicators Chain ID validation and proper error handling Responsive wallet state management Notable Technical Challenges: Cross-Chain Payment Processing: Implemented dynamic chain detection and switching Handled different chain ID formats (hex vs decimal) Created unified payment interface across multiple networks Content Access Control: Built middleware that intercepts HTTP requests for payment verification Implemented secure payment verification without exposing sensitive data Created robust error handling for failed payments Decentralized Storage Integration: Integrated Walrus Network SDK for content upload and retrieval Implemented blob certification and storage epoch management Created fallback mechanisms for storage failures Real-time State Management: Server health monitoring with automatic reconnection Payment status tracking across multiple user sessions Dynamic content loading with payment verification Partner Technologies Benefits Walrus Network: Provided decentralized, censorship-resistant storage Eliminated single points of failure for content storage Enabled content certification and verification x402 Protocol: Simplified micropayment implementation Provided standardized payment verification Enabled seamless user experience without complex payment flows Base Network: Lower transaction costs compared to Ethereum mainnet Faster transaction confirmation times Better user experience for micropayments This project demonstrates a sophisticated integration of modern web technologies with blockchain infrastructure, creating a truly decentralized content monetization platform that puts creators in control of their content and revenue streams.