Sui-native decentralized video streaming with cryptographic access control
OneTube is a production-ready NFT-gated video streaming platform that combines cutting-edge Sui blockchain technology with Seal cryptographic access control and Walrus distributed storage to deliver a seamless Web2-like experience with Web3 ownership.
- π Seal-Powered Access Control: First-of-its-kind integration of Seal SDK for cryptographic NFT ownership verification and session-based video decryption
- π Walrus Distributed Storage: Leverages 60+ Walrus Testnet publishers/aggregators for resilient, decentralized video storage with automatic failover
- π« Gasless NFT Purchases: Sponsored transactions eliminate user friction - users pay only for NFTs, not gas fees
- π° Automatic Revenue Splitting: Smart contract-enforced revenue distribution (70% Athlete / 25% ONE / 5% Platform) on every purchase
- π Dual Authentication: Support for both Sui Wallet and zkLogin (Google OAuth) for maximum accessibility
- π¬ Encrypted Video Streaming: Premium content encrypted on Walrus, decrypted only for verified NFT owners via Seal sessions
- Complete Integration: Full-stack implementation from smart contracts to frontend, demonstrating deep understanding of Sui ecosystem
- Production-Ready Architecture: Robust error handling, logging, session management, and scalable design patterns
- Innovative Technology Stack: Pioneering combination of Seal + Walrus + Kiosk + Sponsored Transactions
- Real-World Use Case: Solves actual problem for content creators and sports organizations
- Developer Experience: Comprehensive documentation, easy setup, and well-structured codebase
- Node.js 18+
- pnpm 10.x
- Sui CLI
- Enoki account (optional, for zkLogin)
- Google Cloud Console account (optional, for zkLogin)
# Install dependencies
pnpm install
# Configure environment variables
cp .env.example .env
# Edit .env and set required values:
# - RPC_URL: Sui network RPC endpoint
# - PACKAGE_ID: Your deployed contract package ID (auto-updated after deploy)
# - SEAL_PACKAGE_ID: Seal package ID
# - SEAL_IDENTITY_ID: Seal identity ID
# - WALRUS_API_URL: Primary Walrus publisher URL
# - WALRUS_AGGREGATOR_URL: Primary Walrus aggregator URL
# - SPONSOR_PRIVATE_KEY: Sponsor wallet private key for gasless transactions
# Deploy smart contracts
pnpm run deploy:devnet
# Seed NFTs to Kiosk
pnpm run seed:devnet
# Start frontend (http://localhost:3000)
pnpm run dev
# Start backend API (http://localhost:3001)
pnpm run dev:serverFor Google OAuth authentication:
-
Create Enoki Account
- Visit Enoki Dashboard
- Create account and get API key
- Set
VITE_ENOKI_API_KEYandVITE_ENOKI_NETWORKin.env
-
Configure Google OAuth
- Visit Google Cloud Console
- Create new project
- Configure OAuth consent screen (User type: External)
- Create OAuth 2.0 Client ID
- Add
http://localhost:3000to authorized redirect URIs - Set
CLIENT_ID_GOOGLEinapp/src/config.json
See docs/issues/028-zk-login-wallet/plan.md for detailed setup.
one-tube/
βββ contracts/ # Move smart contracts (NFT minting, Transfer Policy, Seal integration)
βββ app/ # React + Express (Frontend + Backend API)
β βββ src/
β β βββ lib/ # Frontend utilities (Sui client, API client, logger)
β β βββ server/ # Backend API (Seal, Walrus, Kiosk, Sponsor)
β β βββ shared/ # Shared types
β βββ dist/ # Production build
βββ scripts/ # Deployment & utility scripts
β βββ commands/ # Deploy, seed, encrypt-video
β βββ shared/ # Shared utilities
βββ docs/ # Project specifications & development guides
| Layer | Technology | Purpose |
|---|---|---|
| Blockchain | Sui devnet/testnet | High-performance blockchain infrastructure |
| Smart Contract | Sui Move | NFT minting, Transfer Policy, Seal integration |
| NFT Marketplace | Kiosk Standard | Decentralized NFT sales with Transfer Policy |
| Gas Sponsorship | Sponsored Transactions | Gasless user experience |
| Distributed Storage | Walrus Testnet | Decentralized video storage (60+ nodes) |
| Access Control | Seal SDK | Cryptographic NFT ownership verification & session management |
| Authentication | zkLogin (Enoki SDK) + Sui Wallet | Web2-like login + Web3 wallet support |
| Frontend | React + Vite + TypeScript | Modern, fast UI |
| Backend | Express + TypeScript | RESTful API with Seal/Walrus integration |
| Video Encryption | AES-256-GCM | End-to-end encrypted video content |
- Session-Based Access: Seal SessionKeys enable time-limited access to encrypted content
- NFT Ownership Verification: On-chain verification ensures only NFT owners can decrypt videos
- Frontend SessionKey Creation: Users create SessionKeys client-side for enhanced security
- Persistent Session Management: Server-side session storage with JSON file persistence
- Automatic Expiration: Configurable session duration (default: 5 minutes)
- 60+ Publisher Nodes: Automatic failover across Walrus Testnet publishers
- 60+ Aggregator Nodes: Resilient video retrieval with multiple aggregator endpoints
- Environment-Based Priority: Configurable primary publisher/aggregator via environment variables
- Robust Error Handling: Comprehensive error handling with retry logic
- Timeout Management: Optimized timeouts (5min upload, 10sec retrieval)
# Smart Contract
pnpm run move:test # Run Move contract tests
pnpm run deploy:devnet # Deploy contracts to Sui devnet
pnpm run seed:devnet # Seed NFTs to Kiosk
# Development
pnpm run dev # Start frontend dev server (port 3000)
pnpm run dev:server # Start backend API server (port 3001)
# Code Quality
pnpm run format # Format code with Biome
pnpm run biome:check # Lint code with Biome
pnpm run typecheck # TypeScript type checking
# Video Management
pnpm run encrypt:video # Encrypt video and upload to Walrus- Connect Wallet: Connect your Sui Wallet
- Purchase NFT: Buy Premium Ticket NFT from Kiosk (gasless via Sponsored Transaction)
- Watch Video: Access full video content as NFT owner (Seal session-based decryption)
- Google Login: Click "Login with Google" to authenticate
- zkLogin Address: Enoki SDK automatically generates zkLogin address
- Purchase NFT: Buy Premium Ticket NFT (gasless, sponsored transaction)
- Watch Video: Access full video content as NFT owner
Note: Sui Wallet and zkLogin can be used simultaneously.
- Revenue Split: Automatically enforced by smart contract
- Athlete: 70%
- ONE Championship: 25%
- Platform: 5%
- Pricing: 0.5 SUI per Premium Ticket NFT (testnet)
- Benefits: Full access to premium fight videos for NFT holders
- Complete Seal Integration: Full implementation of Seal SDK for cryptographic access control
- Walrus Distributed Storage: Production-ready integration with 60+ node failover
- Gasless Transactions: Sponsored transaction implementation for seamless UX
- Automatic Revenue Splitting: Smart contract-enforced revenue distribution
- Dual Authentication: Both Web3 (Sui Wallet) and Web2 (zkLogin) support
- Session Management: Persistent session storage with expiration handling
- Error Handling: Comprehensive error handling across all layers
- Type Safety: Full TypeScript coverage with shared types
- Testing: Unit tests, integration tests, and E2E tests
π Complete Technical Documentation
The DeepWiki documentation provides comprehensive technical details including:
- Complete system architecture and component design
- API endpoint reference
- Smart contract implementation details
- Integration guides (Seal, Walrus, Kiosk)
- Data flow diagrams
- Deployment procedures
- Technology stack details
Additional documentation is available in the docs/ directory:
- Project Specification - Complete technical specification
- Development Workflow - Development guidelines
- Seal Integration Guide - Seal implementation details
- Seal Key Management - Seal key management best practices
- Walrus Integration - Walrus implementation experience
- zkLogin Integration - zkLogin setup guide
- DeepWiki Strategy - How to leverage DeepWiki documentation for hackathon
- Production-Ready Code: Not a prototype - fully functional, tested, and documented
- Deep Sui Integration: Leverages Kiosk, Transfer Policy, Sponsored Transactions, Seal, and Walrus
- Innovative Architecture: First-of-its-kind Seal + Walrus combination for NFT-gated content
- Real-World Application: Solves actual problem for content creators and sports organizations
- Developer Experience: Clean codebase, comprehensive docs, easy setup
- Scalable Design: Built for production with error handling, logging, and session management
- Comprehensive Documentation: Full technical documentation available on DeepWiki
- Seal Access Control: Pioneering use of Seal SDK for NFT ownership-based cryptographic access
- Walrus Resilience: 60+ node failover ensures high availability
- Gasless UX: Sponsored transactions eliminate Web3 friction
- Smart Revenue Splits: On-chain automatic revenue distribution
- Dual Auth: Seamless Web2 and Web3 authentication options
This is a hackathon project, but contributions and feedback are welcome!
MIT License - see LICENSE file for details
