
GHOSTPAPER
Technical Whitepaper
Comprehensive technical documentation for Ghostchain Network - a production-grade video streaming platform with native Cardano blockchain integration.
Platform Highlights
Version 1.2.0 January 2026
- Executive Summary
- Platform Overview
- Technology Architecture
- Authentication & Identity
- Streaming Infrastructure
- Content Delivery Network
- Monetization Systems
- NFT Integration
- XP Reward System
- Advertisement System
- Community Features
- Security Architecture
- Widget Ecosystem
- Database Architecture
- Performance & Scalability
- Technical Specifications
- Glossary
1. Executive Summary
Ghostchain Network is a production-grade video streaming platform built on modern cloud-native infrastructure with native Cardano blockchain integration. Released in January 2026, the platform combines live streaming, Video-on-Demand (VOD) delivery, and creator monetization with blockchain-native payment rails and NFT-gated content access.
Core Value Propositions
For Viewers:
- Watch-to-Earn rewards through the XP system
- NFT-based exclusive content access
- Native Cardano wallet authentication
- Real-time interactive features
For Creators:
- Multiple revenue streams (tips, PPV, advertising)
- 100% of base tip amounts (platform fee added on top)
- NFT-gated content for premium experiences
- Comprehensive analytics dashboard
- Automatic stream archiving to VOD
For the Ecosystem:
- Cardano-first payment infrastructure
- Multi-token support (ADA, DJED, SNEK, HOSKY)
- On-chain transaction verification
- Transparent, immutable payment records
Platform Highlights
| Aspect | Description |
|---|---|
| Platform Version | 1.2.0 (Production) |
| Infrastructure | Enterprise-grade, globally distributed |
| Security | Comprehensive multi-layer protection |
| Blockchain | Native Cardano integration |
2. Platform Overview
2.1 Feature Summary
Live Streaming
- Professional RTMP ingest infrastructure
- HLS adaptive bitrate delivery (1080p, 720p, 480p, 360p)
- WebRTC ultra-low latency option
- Secure publish token authentication
- Automatic stream archiving
Video on Demand
- Direct-to-cloud upload (up to 2GB)
- Global CDN delivery
- Signed URL protection
- Automatic thumbnail generation
- View tracking with analytics
Monetization
- Pay-Per-View (PPV) with Cardano payments
- Creator tipping (multi-token support)
- Watch-to-Earn advertising
- NFT-gated premium content
- Creator payout system
Social Features
- Real-time live chat
- Threaded comments on VOD
- Follow system
- Content moderation tools
- Creator-assigned moderators
3. Technology Architecture
3.1 Core Technology Stack
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 15+ | React framework with App Router |
| UI Components | Shadcn/ui + Radix UI | Accessible component library |
| Styling | Tailwind CSS | Utility-first CSS |
| Language | TypeScript | Type-safe development |
| Database | PostgreSQL | Primary data store |
| ORM | Prisma | Type-safe database access |
| Caching | Redis | Rate limiting, session cache |
| Streaming | Ant Media Server | RTMP/HLS/WebRTC |
| CDN | BunnyCDN | Global content delivery |
| Storage | S3-Compatible | Object storage |
| Blockchain | Cardano (Blockfrost API) | Payment verification |
| Deployment | Vercel | Serverless hosting |
3.2 Application Structure
The platform follows a modular architecture with clear separation of concerns:
- App Router - Next.js pages and API routes
- Components - 145+ reusable React components
- Libraries - Core utilities and integrations
- Hooks - Custom React hooks for state management
- Contexts - React Context providers
- Widget App - Separate embedded widget application
3.3 API Architecture
The platform exposes a comprehensive REST API organized into functional domains:
| Domain | Key Functions |
|---|---|
| Authentication | Wallet + email/OAuth auth |
| User Management | Profiles, settings, follows |
| Video Management | CRUD, likes, comments |
| Live Streaming | Create, manage, status |
| Payments | PPV, tips, verification |
| Playback Gateway | Token auth, session management |
| Chat & Comments | Real-time messaging |
| Moderation | Content moderation |
| Advertisements | Ad serving and tracking |
4. Authentication & Identity
4.1 Dual-Rail Authentication
Ghostchain implements a hybrid authentication system supporting both blockchain-native and traditional methods:
Identity Types
| Type | Description | Blockchain Features |
|---|---|---|
| WALLET_ONLY | Pure Cardano wallet auth | Full access |
| SUPABASE_ONLY | Email/OAuth only | Limited (no payments) |
| LINKED | Email + wallet connected | Full access |
Cardano Wallet Authentication (CIP-30)
Supported Wallets: Nami, Eternl, Lace, Yoroi, Flint, GeroWallet, NuFi, Typhon
Authentication Flow:
- Nonce Generation - Cryptographically secure random nonce with short expiry
- Signature Request - Wallet signs message using CIP-30
signData()method - Cryptographic Verification - Server verifies Ed25519 signature with address binding
Security Features:
- Industry-standard cryptographic verification
- Address binding prevents impersonation attacks
- Single-use nonces with automatic cleanup
- Session fixation protection
Email/OAuth Authentication
- Email/password with verification
- Google OAuth integration
- GitHub OAuth integration
- Automatic token refresh
4.2 Session Management
Wallet Sessions:
- Secure session IDs with configurable expiry
- HttpOnly, Secure, SameSite cookies
- Database-backed session storage
JWT Tokens:
- HMAC-SHA256 signature algorithm
- Strong secret enforcement
- Short expiry for sensitive tokens
5. Streaming Infrastructure
5.1 Live Streaming Architecture
Broadcaster (OBS/vMix)
│
▼ RTMP
┌───────────────────────┐
│ Streaming Server │
│ ├─ Transcoding │
│ ├─ HLS Packaging │
│ └─ WebRTC Bridge │
└───────────────────────┘
│
▼ HLS/WebRTC
┌───────────────────────┐
│ Global CDN │
│ Edge Distribution │
└───────────────────────┘
│
▼ Signed URLs
┌───────────────────────┐
│ Viewers │
└───────────────────────┘
5.2 Stream Security
Security Model:
- Cryptographically random publish tokens
- Secure hashed storage (irreversible)
- Webhook validation before broadcast
- One-time token display with regeneration support
5.3 Adaptive Bitrate Transcoding
| Profile | Resolution | Bitrate |
|---|---|---|
| Source | 1080p | 4000 kbps |
| High | 720p | 2000 kbps |
| Medium | 480p | 1000 kbps |
| Low | 360p | 600 kbps |
HLS Specifications:
- Optimized segment duration
- MPEG-TS segment format
- Configurable live window
5.4 Stream Archiving
Automatic conversion of live streams to VOD:
| Status | Description |
|---|---|
none | Archive not enabled |
recording | Currently recording |
processing | MP4 being generated |
ready | Ready for publishing |
published | Video created |
Archive Retention by Tier
| Tier | Retention Policy |
|---|---|
| Free | 30 days (auto-delete unpublished) |
| Creator | Unlimited (counts against 100 GB storage) |
| Creator Pro | Unlimited (counts against 500 GB storage) |
| Creator Pro+ | Unlimited (counts against 2 TB storage) |
Note: Published archives are never auto-deleted regardless of tier.
Entitlement Migration: Users with live stream access automatically receive archive access.
6. Content Delivery Network
6.1 CDN Integration
Architecture:
- Pull zone configuration from object storage
- Global edge distribution (100+ POPs)
- Token authentication for protected content
- Separate zones for VOD and live streaming
Security:
- Cryptographically signed URLs
- Time-limited access tokens
- Anti-hotlinking protection
6.2 Playback Gateway
Three-layer security for content access:
| Layer | Purpose | Description |
|---|---|---|
| Playback Token | Request authentication | Validates user authorization |
| Database Session | Business rules | Enforces concurrency limits |
| CDN Signed URL | Content delivery | Secures actual media files |
Heartbeat System:
- Regular client-server communication
- Session extension on activity
- Watch time tracking for analytics
6.3 Concurrent Stream Limiting
Strategy: Newest Device Wins
When a user watches on multiple devices:
- Detect active sessions
- Terminate older sessions
- Allow newest to continue
- Notify terminated sessions gracefully
7. Monetization Systems
7.1 Cardano Payment Architecture
All payments use multi-output transactions with exactly two outputs:
| Output | Recipient | Purpose |
|---|---|---|
| Output 1 | Creator Wallet | Base price/tip amount |
| Output 2 | Platform Wallet | Platform fee |
Benefits:
- On-chain fee transparency
- Atomic transaction processing
- Immutable payment proof
- No off-chain processing required
7.2 Supported Tokens
| Token | Description |
|---|---|
| ADA | Native Cardano currency |
| DJED | Over-collateralized stablecoin |
| SNEK | Community token |
| HOSKY | Community token |
7.3 Pay-Per-View (PPV)
Fee Structure:
- Platform fee: 10% (added on top)
- Creator receives: 100% of base price
- User pays: base price + 10%
Example (5 ADA content):
Base price: 5 ADA → Creator
Platform fee: 0.5 ADA → Platform
Total paid: 5.5 ADA
Transaction Verification:
- Multiple block confirmations required
- On-chain verification via Blockfrost API
- Automatic entitlement creation on confirmation
7.4 Tipping System
Two-Step Flow:
- Payment info generation (no DB record until confirmed)
- Record creation after wallet submission
- On-chain verification and confirmation
Fee Structure:
- Base fee: 5% (added on top)
- Minimum fee: 1 ADA
- Creator receives: 100% of tip amount
Example (10 ADA tip):
Tip amount: 10 ADA → Creator
Platform fee: 1 ADA → Platform (minimum applied)
Total paid: 11 ADA
7.5 Creator Subscription Tiers
Creators can subscribe to paid tiers for increased resource limits and professional features.
Tier Comparison
| Tier | Monthly | Bandwidth | Storage | Live Hours |
|---|---|---|---|---|
| Free | $0 | 100 GB | 25 GB | 10 hrs |
| Creator | $39 | 500 GB | 100 GB | 30 hrs |
| Creator Pro | $99 | 3 TB | 500 GB | 120 hrs |
| Creator Pro+ | $299 | 12 TB | 2 TB | 400 hrs |
Overage Billing
Paid tier creators can opt-in to overage billing to exceed their limits:
| Resource | Overage Rate |
|---|---|
| Bandwidth | $0.02/GB |
| Storage | $0.04/GB-month |
| Live Hours | $1.00/hour |
Spend Cap: Creators can set a maximum monthly overage spend to prevent unexpected charges.
Usage Tracking
- Real-time usage dashboard
- Alerts at 50%, 80%, and 100% thresholds
- Daily usage aggregation from CDN logs
- Prorated billing for mid-cycle tier changes
8. NFT Integration
8.1 NFT-Gated Content
Creators can restrict content access to NFT holders:
Gating Types
| Type | Description | Duration |
|---|---|---|
| NFT Policy | Any NFT from specified policy ID(s) | 24-hour windows |
| NFT Ticket | Specific NFT with usage limits | Until limit reached |
Verification Flow
- User requests gated content
- System retrieves user's wallet address
- NFT ownership verified on-chain via Blockfrost
- Entitlement created with appropriate expiry
- Access granted or denied
8.2 Wallet Address Support
| Format | Priority | Use Case |
|---|---|---|
| Stake Address | Highest | Aggregates all payment addresses |
| Bech32 (Payment) | Medium | Single address |
| Hex (Legacy) | Lowest | Legacy format |
Stake addresses are preferred as they provide complete wallet coverage.
8.3 NFT Metadata Standards
Full CIP-25 compliance:
- IPFS protocol URLs
- Data URIs (inline SVG, base64)
- CBOR-encoded metadata
- Array-based chunked images
- Fallback to
filesarray
8.4 NFT Profile Pictures
Users can set owned NFTs as profile avatars:
- Real-time ownership verification
- Automatic cache invalidation
- Fallback to default avatar
9. XP Reward System
9.1 Watch-to-Earn Mechanics
The XP system rewards users for watching content, preparing for future $GHOST token distribution.
Base Rate: 1 XP per minute watched Daily Cap: 240 XP (4 hours of content)
Earning Sources
| Source | XP Rate | Cooldown |
|---|---|---|
| Watch Time | 1 XP/minute | 24h per content |
| Ad Completion | Variable | Per campaign |
| Bonus Events | Variable | None |
9.2 Diminishing Returns
To ensure fair distribution and prevent farming:
| Watch Count | Multiplier | Example (5-min video) |
|---|---|---|
| 1st (new) | 100% (1.0x) | 5.0 XP |
| 2nd (rewatch) | 50% (0.5x) | 2.5 XP |
| 3rd | 25% (0.25x) | 1.25 XP |
| 4th | 10% (0.1x) | 0.5 XP |
| 5th+ | 1% (0.01x) | 0.05 XP |
Key Feature: Users can rewatch indefinitely at 1% XP - never reaches zero.
9.3 Level Progression
Default Formula (Square Root):
Level = floor(sqrt(totalXP / 100))
| Level | XP Required |
|---|---|
| 1 | 100 XP |
| 5 | 2,500 XP |
| 10 | 10,000 XP |
| 20 | 40,000 XP |
| 30 | 90,000 XP |
9.4 Multiplier Tiers
Viewer Multipliers:
| Level | Multiplier |
|---|---|
| 0+ | 1.00x |
| 5+ | 1.05x |
| 10+ | 1.10x |
| 20+ | 1.15x |
| 30+ | 1.20x |
9.5 Anti-Abuse Protections
The platform implements comprehensive anti-abuse measures:
- Velocity Checks - Monitors for abnormal earning patterns
- Session Integrity - Validates continuous viewing
- Rate Limiting - Prevents automated abuse
- Server-Authoritative Calculations - All XP computed server-side
- Daily Cap Enforcement - Hard limits on daily earnings
9.6 Bootstrap Mode
Temporary phase for fair initial growth:
- All multipliers normalized to 1.00x
- Exit criteria: Sustained user engagement thresholds
- Prevents early adopter advantage
10. Advertisement System
10.1 Ad Types
| Type | XP Reward | Completion Requirement |
|---|---|---|
| WATCH_TO_EARN | Variable | 80% watch time |
| DISPLAY | None | N/A (CPM model) |
| SURVEY | Variable | Response submitted |
| POLL | Variable | Option selected |
10.2 Placement Types
| Placement | Use Case | Description |
|---|---|---|
| PRE_ROLL | Before content | Full-screen video ad |
| MID_ROLL | During content | Triggered at content midpoint |
| POST_ROLL | After content | Full-screen video ad |
| REWARDS_WIDGET | User-initiated | Sidebar opt-in ads |
| PLAYER_OVERLAY | During playback | Non-intrusive banner |
10.3 Creator Revenue Share
- Creators earn a percentage of XP from ads viewed on their content
- Transparent tracking and attribution
- Stored separately for analytics
10.4 Daily Limits
- Maximum daily XP from ads enforced
- Resets at midnight
- Server-side validation
10.5 Fraud Prevention
The platform implements multi-layer fraud detection:
- Behavioral Analysis - Detects abnormal interaction patterns
- Timing Validation - Identifies impossible user actions
- Session Verification - Ensures valid playback context
- Device Analysis - Monitors for suspicious device patterns
- Network Analysis - Identifies coordinated abuse
All suspicious activity is flagged and reviewed, with confidence-based scoring to minimize false positives.
10.6 Poll & Survey System
The platform supports comprehensive polling and survey functionality for audience engagement and market research.
Survey Types
| Type | Use Case | Creator |
|---|---|---|
| AD_CAMPAIGN | Brand-sponsored research | Advertisers |
| CREATOR_POLL | Audience engagement | Creators |
Question Types (8 Total)
| Type | Description |
|---|---|
| SINGLE_CHOICE | Radio button selection |
| MULTIPLE_CHOICE | Checkbox selection |
| RATING_SCALE | Numeric scale (configurable) |
| NPS | Net Promoter Score (0-10) |
| STAR_RATING | 1-5 star rating |
| TEXT_SHORT | Single line text |
| TEXT_LONG | Paragraph text |
| YES_NO | Boolean selection |
Features
- XP rewards for survey completion
- Duplicate response prevention
- Live results with real-time polling
- Question randomization option
- Fraud detection (fast response + pattern checks)
11. Community Features
11.1 Real-Time Chat
Features:
- Character limits for manageable messages
- Rate limiting to prevent spam
- Slow mode (configurable interval)
- Followers-only mode
- Subscribers-only mode
- Profanity filter
- Custom banned words
Message Flow:
- Authentication check
- Rate limiting
- Chat settings validation
- Ban/timeout check
- Message creation
- Automatic broadcast to subscribers
11.2 Comments System
Features:
- Threaded discussions
- Generous character limits
- Rate limiting
- Soft delete with audit trail
11.3 User Badges
| Badge | Criteria |
|---|---|
| Creator | Content owner |
| Admin | Platform administrator |
| Moderator | Platform or content moderator |
| Founder | Beta supporter (future) |
11.4 Moderation Tools
Actions:
- Message/comment deletion
- User timeout (temporary)
- User ban (permanent)
- All actions logged for accountability
Protections:
- Cannot ban platform admins
- Cannot ban content creators on their own content
- Audit trail for all moderation actions
12. Security Architecture
12.1 Security Overview
| Category | Status |
|---|---|
| Authentication | Production-ready |
| Authorization | Production-ready |
| Payment Security | Production-ready |
| Input Validation | Production-ready |
| Data Protection | Production-ready |
| Infrastructure | Production-ready |
12.2 Rate Limiting
Comprehensive rate limiting protects all API endpoints:
- Authentication endpoints - Strict limits to prevent brute force
- Sensitive operations - Additional restrictions for high-risk actions
- Payment endpoints - Balanced limits for legitimate transactions
- Public endpoints - Higher limits for general access
- Admin endpoints - Appropriate limits for administrative functions
All rate limits use sliding window algorithms for fair enforcement.
12.3 Input Validation
- Schema validation - Type-safe runtime validation on all inputs
- ORM parameterization - Automatic SQL injection prevention
- Whitelist validation - Strict validation for enums and options
- XSS prevention - Automatic output escaping
12.4 Role-Based Access Control
| Role | Level | Capabilities |
|---|---|---|
| USER | 0 | Watch, like, comment |
| CREATOR | 1 | Upload, earn, receive tips |
| MODERATOR | 2 | Moderate chat, manage users |
| ADMIN | 3 | Full platform access |
12.5 Data Protection
Encryption at Rest:
- AES-256-GCM for sensitive data
- Industry-standard password hashing
GDPR Compliance:
- Right to Access: Account settings
- Right to Rectification: Profile updates
- Right to Erasure: Grace period deletion
- Data Anonymization: Complete PII removal
12.6 Security Headers
The platform implements comprehensive security headers:
- Strict Transport Security (HSTS)
- Frame protection
- Content type enforcement
- XSS protection
- Content Security Policy
- Referrer control
13. Widget Ecosystem
13.1 Architecture
Widgets operate as a separate application embedded via sandboxed iframes:
┌─────────────────────────────────┐
│ Main Application │
│ ┌───────────────────────────┐ │
│ │ Widget Sidebar │ │
│ │ ┌─────────────────────┐ │ │
│ │ │ Sandboxed Widget │ │ │
│ │ └─────────────────────┘ │ │
│ └───────────────────────────┘ │
└─────────────────────────────────┘
▲ │
│ Secure │
│ Messaging │
└─────────────┘
13.2 Widget Types
| Widget | Purpose | Content Type |
|---|---|---|
| Bio | Creator profile & links | All |
| Tip | Cardano donations | All |
| Embed | Custom content (Twitter, YouTube) | All |
| Chat | Real-time messaging | Streams |
| Comments | Discussions | VOD |
| Rewards | Watch-to-earn ads | All |
| Interact | Polls & surveys | All |
13.3 Security Measures
- CORS validation with origin whitelisting
- Short-lived authentication tokens
- Iframe sandboxing
- Message type validation
- Secure cross-origin communication
13.4 SDK Capabilities
The Widget SDK provides:
- Ready state signaling
- Event communication
- Message listening
- Authentication token management
- Authenticated API requests
14. Database Architecture
14.1 Schema Overview
The platform uses a comprehensive relational database schema:
Core Model Groups
| Group | Purpose |
|---|---|
| Authentication | User accounts, sessions, settings |
| Content | Videos, streams, metadata |
| Social | Follows, likes, comments, watchlist |
| Payments | Transactions, entitlements, tips, payouts |
| Chat | Messages, settings, moderation |
| Ads | Campaigns, placements, tracking |
| XP | Configuration, balances, transactions |
14.2 Key Models
User Model:
- Authentication data
- Profile information
- Statistics and metrics
- Preferences and settings
Video Model:
- Content metadata
- Delivery configuration
- Gating settings
- Analytics data
Stream Model:
- Stream configuration
- Status tracking
- Security settings
- Widget configuration
14.3 Performance Optimization
- Strategic indexing on frequently queried fields
- Composite indexes for complex queries
- Query optimization for common access patterns
15. Performance & Scalability
15.1 Caching Strategy
Multi-Layer Caching:
| Cache Type | Purpose |
|---|---|
| Session Cache | Reduce authentication queries |
| Concurrent Checks | Optimize limit enforcement |
| User Profiles | Cache infrequently changing data |
| Stream Metadata | Fast access to live data |
| XP Tracking | Accurate reward calculations |
Performance Impact:
- Significant reduction in database queries
- Sub-10ms response times for cached data
- Graceful degradation when cache unavailable
15.2 Database Optimizations
- Connection pooling for efficient resource use
- Singleton client patterns
- Strategic indexing
- Query optimization
15.3 Client Optimizations
- Server-side rendering where beneficial
- Dynamic imports for code splitting
- Image optimization (WebP format)
- Infinite scroll with intersection observer
16. Technical Specifications
16.1 File Upload Limits
| Type | Maximum Size |
|---|---|
| Video Files | 2 GB |
| Thumbnails | 10 MB |
| Ad Creatives (Video) | 100 MB |
| Ad Creatives (Image) | 5 MB |
16.2 Supported Video Formats
| Extension | MIME Type |
|---|---|
| .mp4 | video/mp4 (recommended) |
| .mov | video/quicktime |
| .webm | video/webm |
| .avi | video/x-msvideo |
| .mkv | video/x-matroska |
16.3 Cooldown Systems
| System | Duration | Scope |
|---|---|---|
| Content XP (VOD) | 24h | Per video/user |
| Content XP (LIVE) | None | While broadcasting |
| View Tracking | 24h | Per video/user |
| Ad Rewards | 24h | Per campaign/user |
17. Glossary
| Term | Definition |
|---|---|
| ADA | Native cryptocurrency of the Cardano blockchain |
| Blockfrost | API service for Cardano blockchain queries |
| CIP-25 | Cardano Improvement Proposal for NFT metadata standard |
| CIP-30 | Cardano wallet connector standard |
| CDN | Content Delivery Network for global content distribution |
| Entitlement | Access grant for gated content |
| HLS | HTTP Live Streaming protocol |
| Heartbeat | Periodic client-server ping for session maintenance |
| Lovelace | Smallest unit of ADA (1 ADA = 1,000,000 lovelace) |
| NFT | Non-Fungible Token, unique digital asset |
| Policy ID | Unique identifier for a Cardano NFT collection |
| PPV | Pay-Per-View, one-time purchase model |
| RTMP | Real-Time Messaging Protocol for streaming |
| Stake Address | Cardano address aggregating all payment addresses |
| VOD | Video-on-Demand, pre-recorded content |
| XP | Experience Points, platform reward currency |
Document Information
Whitepaper Version: 1.2.0 Platform Version: Ghostchain Network v1.2.0 Release Date: January 2026 Status: Production
Ghostchain Network - Where Creators Thrive
Ghostchain Network - Where Creators Thrive
Version 1.2.0 | January 2026