StreamChain is a revolutionary decentralized video platform that combines:
- IPFS for censorship-resistant storage
- WebTorrent for P2P streaming (70% bandwidth cost reduction)
- Blockchain for transparent monetization (90% creator revenue share)
- AI for client-side content moderation
- DAO for community governance
- Uncensored Publishing - Your content on IPFS, nobody can take it down
- 90% Revenue Share - Keep most of your earnings vs 55-70% on traditional platforms
- Instant Payouts - Crypto payments, no 30-day holds
- Full Ownership - You control your content and audience
- Real-time Analytics - Track views, earnings, and engagement
- Multiple Revenue Streams - Subscriptions, pay-per-view, tips, super chat
- Global Access - No geo-restrictions
- Fast Streaming - P2P technology for faster load times
- Privacy - No tracking, no data collection
- Support Creators Directly - 100% of your payment goes to creators
- Community Governance - Vote on platform decisions with tokens
- Sub-3s Video Start Time via WebTorrent P2P
- 95%+ NSFW Detection accuracy with TensorFlow.js
- Multi-Chain Support - Ethereum, Polygon, Base
- Decentralized Storage - IPFS + Arweave
- DAO Moderation - Community-driven content review
┌─────────────────────────────────────────────────────────────┐
│ Frontend (Next.js 14) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Upload │ │ Player │ │Discovery │ │Dashboard │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└───────────────────────┬─────────────────────────────────────┘
│
┌───────────────┼───────────────┐
│ │ │
┌───────▼──────┐ ┌──────▼──────┐ ┌─────▼──────┐
│ IPFS/Web3 │ │ WebTorrent │ │ Blockchain │
│ Storage │ │ P2P Stream │ │ Contracts │
└──────────────┘ └─────────────┘ └────────────┘
Pinata Hybrid CDN Ethereum
Web3.Storage + P2P Seeds Polygon/Base
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Web3: Wagmi, Viem, RainbowKit
- State: Zustand
- Animations: Framer Motion
- Smart Contracts: Solidity 0.8.24
- Libraries: OpenZeppelin
- Development: Hardhat
- Networks: Ethereum, Polygon, Base
- Indexing: The Graph Protocol
- Decentralized Storage: IPFS (Pinata, Web3.Storage)
- P2P Streaming: WebTorrent
- Video Processing: FFmpeg.wasm
- Player: Video.js
- Framework: TensorFlow.js
- NSFW Detection: NSFW.js
- NLP: Custom hate speech detection
- Execution: Client-side (privacy-preserving)
- Node.js 18+
- MetaMask or compatible Web3 wallet
- Pinata account (for IPFS)
- Alchemy/Infura account (for RPC)
- Clone the repository
git clone https://github.com/yourusername/streamchain.git
cd streamchain- Install dependencies
npm install- Configure environment
cp .env.example .envEdit .env with your credentials:
# Wallet Connect
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_project_id
# RPC Providers
NEXT_PUBLIC_ALCHEMY_ID=your_alchemy_key
NEXT_PUBLIC_INFURA_ID=your_infura_key
# IPFS Storage
NEXT_PUBLIC_PINATA_JWT=your_pinata_jwt
NEXT_PUBLIC_WEB3_STORAGE_TOKEN=your_web3_storage_token
# Contract Addresses (after deployment)
NEXT_PUBLIC_CREATOR_FACTORY_ADDRESS=0x...
NEXT_PUBLIC_DAO_MODERATOR_ADDRESS=0x...
NEXT_PUBLIC_STREAM_TOKEN_ADDRESS=0x...- Compile smart contracts
npm run compile- Deploy contracts (testnet recommended first)
npx hardhat run scripts/deploy.ts --network polygonMumbai- Start development server
npm run devVisit http://localhost:3000 🎉
streamchain/
├── app/ # Next.js 14 app directory
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Home page
│ ├── upload/ # Video upload
│ ├── watch/[cid]/ # Video player
│ ├── creator/[address]/ # Creator dashboard
│ └── providers/ # Web3 providers
├── components/ # React components
│ ├── layout/ # Header, Footer
│ ├── video/ # VideoCard, VideoGrid, VideoPlayer
│ └── moderation/ # Moderation UI
├── contracts/ # Solidity smart contracts
│ ├── CreatorContract.sol # Individual creator contract
│ ├── CreatorFactory.sol # Factory for creator contracts
│ ├── DAOModerator.sol # Community moderation
│ └── StreamToken.sol # Platform token
├── lib/ # Utility libraries
│ ├── ipfs.ts # IPFS upload/download
│ ├── webtorrent.ts # P2P streaming
│ ├── moderation.ts # AI content moderation
│ └── contracts.ts # Contract ABIs & addresses
├── hooks/ # Custom React hooks
├── types/ # TypeScript types
├── scripts/ # Deployment scripts
├── test/ # Contract tests
└── subgraph/ # The Graph subgraph
Upload File → AI Moderation → IPFS Upload → Blockchain RegistrationFetch Metadata → Load via WebTorrent → P2P Distribution → Video.js PlayerPurchase Subscription/PPV → Smart Contract Payment → 90% to Creator → 10% Platform Fee- Manages individual creator's content and subscriptions
- Handles payments (subscriptions, PPV, tips)
- 7-day withdrawal delay for dispute resolution
- Deploys new creator contracts
- Tracks all creators
- Small deployment fee to prevent spam
- Community-based content moderation
- Token-weighted voting
- Rewards for accurate moderation
- 24-hour voting window
- Platform governance token
- Used for DAO voting
- Staking for creator visibility boost
- 5% APY staking rewards
import { uploadToPinata, moderateContent } from '@/lib';
// 1. Moderate content
const modResult = await moderateContent(videoFile, title, description);
// 2. Upload to IPFS
const { cid } = await uploadToPinata(videoFile);
// 3. Register on blockchain
await creatorContract.uploadVideo(cid, price, requiresPayment);import { streamVideo } from '@/lib/webtorrent';
const { file } = await streamVideo(magnetURI, (file) => {
renderToVideo(file, videoElement);
});# Run contract tests
npx hardhat test
# Run with coverage
npx hardhat coverage
# Deploy to local network
npx hardhat node
npx hardhat run scripts/deploy.ts --network localhost# Deploy to testnet
npx hardhat run scripts/deploy.ts --network polygonMumbai
# Deploy to mainnet
npx hardhat run scripts/deploy.ts --network polygon# Build for production
npm run build
# Deploy to Vercel
vercel deploy
# Or use Docker
docker build -t streamchain .
docker run -p 3000:3000 streamchain- 100K videos uploaded
- 500K monthly active viewers
- $1M+ creator earnings
- 95%+ harmful content detection
- <3s video start time
- Smart contracts audited (recommended before mainnet)
- Client-side AI (no video data sent to servers)
- 7-day withdrawal delay for disputes
- Community moderation for edge cases
- IPFS content addressing (immutable)
Contributions welcome! Please read CONTRIBUTING.md first.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin for secure smart contract libraries
- IPFS/Pinata for decentralized storage
- WebTorrent for P2P streaming technology
- TensorFlow.js for client-side AI
- The Graph for blockchain indexing
- RainbowKit for Web3 wallet integration
- Website: https://streamchain.io (placeholder)
- Twitter: @StreamChainHQ
- Discord: https://discord.gg/streamchain
- Docs: https://docs.streamchain.io
- GitHub: https://github.com/streamchain
- Core platform MVP
- IPFS integration
- Basic smart contracts
- WebTorrent streaming
- DAO governance launch
- Mobile apps (iOS/Android)
- Advanced analytics
- Live streaming beta
- Multi-language support
- Enhanced AI moderation
- Creator tools suite
- Monetization expansion
- Cross-platform integration
- Enterprise features
- Global CDN nodes
- V2 protocol upgrade
Built with by the StreamChain community