BLUEPRINT
Technical Blueprint
Comprehensive technical documentation for Circuit - a production-grade video streaming platform with native blockchain integration.
Platform Highlights
Version 2.0.0 March 2026
- Executive Summary
- Platform Overview
- Technology Architecture
- Authentication & Identity
- Streaming Infrastructure
- Content Delivery Network
- Monetization Systems
- Token Gating
- XP Reward System
- Advertisement System
- Community Features
- Security Architecture
- Widget Ecosystem
- Database Architecture
- Performance & Scalability
- Technical Specifications
- Glossary
1. Executive Summary
Circuit is a production-grade video streaming platform built on modern cloud-native infrastructure with native Base (Coinbase L2) blockchain integration. Released in early 2026, the platform combines live streaming, Video-on-Demand (VOD) delivery, and creator monetization with blockchain-native payment rails and token-gated content access.
Core Value Propositions
For Viewers:
- Watch-to-Earn rewards through the XP system
- Token-gated exclusive content access
- Native wallet authentication (browser wallets or social login)
- Real-time interactive features
For Creators:
- Multiple revenue streams (tips, PPV, advertising, ticket sales)
- 100% of base tip amounts (platform fee added on top)
- Token-gated content for premium experiences
- Comprehensive analytics dashboard
- Automatic stream archiving to VOD
- Subscription tiers with usage-based billing
For the Ecosystem:
- Base-first payment infrastructure
- Multi-token support (USDC, ETH)
- On-chain transaction verification
- Transparent, immutable payment records
Platform Highlights
| Aspect | Description |
|---|---|
| Platform Version | 2.0.0 (Production) |
| Infrastructure | Enterprise-grade, globally distributed |
| Security | Comprehensive multi-layer protection |
| Blockchain | Native Base (L2) integration |
2. Platform Overview
2.1 Feature Summary
Live Streaming
- Professional RTMP ingest infrastructure
- HLS delivery via global CDN
- Secure publish token authentication
- Multi-camera broadcasting with Director controls
- Automatic stream archiving
- Single-cam adaptive bitrate support; multicam ABR is capacity-gated by AMS CPU
- Roadmap: WebRTC ultra-low latency and broader multicam ABR after infrastructure upgrade
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 Base USDC payments
- Creator tipping (USDC and ETH support)
- Watch-to-Earn advertising
- Token-gated premium content
- Event ticketing with on-chain NFT minting
- Creator subscription tiers with Stripe billing
- 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 14+ | 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 ingest, HLS delivery |
| CDN | BunnyCDN | Global content delivery |
| Storage | S3-Compatible | Object storage |
| Blockchain | Base L2 (Ethereum) | Payment verification |
| Billing | Stripe | Creator subscriptions |
| 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 - 174+ 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 auth, social login |
| 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 |
| Ticketing | Event creation, ticket sales, redemption |
| Multi-Camera | Angle management, Director controls |
| Billing | Stripe subscriptions, usage |
4. Authentication & Identity
4.1 Wallet-First Architecture
Circuit implements a wallet-first authentication system where every user has an EVM wallet. This approach provides:
- Simplicity: Single identity model - all users have wallets
- Web3-Native: True wallet ownership for all users on Base
- Web2 UX: Social login provides familiar onboarding experience
- Security: Industry-standard cryptographic verification via SIWE (Sign-In with Ethereum)
How Users Connect
Circuit supports two authentication rails — both produce a fully-functional EVM wallet on Base:
| Method | Description |
|---|---|
| Browser Extension (SIWE) | Direct connection via MetaMask, Coinbase Wallet, or WalletConnect — signature-based auth via Sign-In with Ethereum (EIP-4361) |
| Coinbase Smart Wallet (SIWE) | Passkey-based wallet, signed in with Ethereum — no extension required |
| CDP Embedded Wallet (Social Login) | Google OAuth or Email OTP via Coinbase Developer Platform — wallet provisioned automatically; email captured for Stripe billing compliance |
All wallets are fully functional EVM wallets capable of:
- Sending and receiving ETH and ERC-20 tokens (USDC)
- Signing transactions for tips, PPV purchases, and token operations
- Holding tokens for gated content access
- Full EIP-1193 compatibility
4.2 Smart Wallet & Social Login
Circuit removes blockchain friction for mainstream users through two onboarding paths beyond traditional browser extensions.
Coinbase Smart Wallet
Smart Wallet enables users to create a passkey-based EVM wallet instantly — no extension, no seed phrase. Authentication still uses SIWE (Sign-In with Ethereum), so the underlying security model matches MetaMask and WalletConnect.
For Users:
- Zero friction onboarding — no wallet extension installation required
- Passkey-based wallet creation (biometric or device PIN)
- Gasless transactions via paymaster sponsorship (where supported)
- Built-in fiat on-ramp for purchasing USDC directly
For the Platform:
- Dramatically lower barrier to entry for mainstream audiences
- Full feature parity with browser extension wallet users
CDP Embedded Wallet (Social Login)
For users who want to sign in with Google or email — the lowest possible friction — Circuit integrates Coinbase Developer Platform's embedded wallet service. CDP provisions an EVM wallet automatically and authenticates via access-token validation rather than SIWE signing.
For Users:
- Sign in with Google OAuth or Email OTP — no wallet UI required
- EVM wallet provisioned automatically on Base
- Email captured by default (used for Stripe billing compliance)
For the Platform:
- Familiar Web2 sign-in flow for non-crypto-native users
- All payments and on-chain features remain available — wallet is real, just embedded
Authentication Flow
``` User clicks "Connect / Sign In" │ ▼ ┌─────────────────────────────────┐ │ Auth modal opens │ │ • Browser wallet (SIWE) │ │ • Smart Wallet (SIWE) │ │ • Google / Email (CDP) │ └─────────────────────────────────┘ │ ├──── SIWE path ─────────────┐ │ ▼ │ ┌────────────────────────┐ │ │ User signs SIWE │ │ │ message via wallet │ │ │ Server verifies ECDSA │ │ └────────────────────────┘ │ │ └──── CDP path ──────┐ │ ▼ │ ┌──────────────────┐ │ │ Google/Email → │ │ │ CDP issues access│ │ │ token; server │ │ │ validates via │ │ │ CDP SDK │ │ └──────────────────┘ │ │ │ ▼ ▼ ┌─────────────────────────────────┐ │ Session created with: │ │ - evmAddress │ │ - walletSource (INJECTED / │ │ SMART_WALLET / CDP_EMBEDDED)│ │ - session cookie │ └─────────────────────────────────┘ ```
Feature Parity
All wallet types have complete feature parity:
| Feature | Browser Wallet (SIWE) | Smart Wallet (SIWE) | CDP Embedded (Social) |
|---|---|---|---|
| Watch Content | Yes | Yes | Yes |
| Earn XP | Yes | Yes | Yes |
| PPV Purchases | Yes | Yes | Yes |
| Send Tips | Yes | Yes | Yes |
| Token Gating | Yes | Yes | Yes |
| Token Balance Gate | Yes | Yes | Yes |
| Creator Subscriptions | Yes | Yes | Yes |
| Stripe Billing | Yes (add email in Settings) | Yes (add email in Settings) | Yes (email captured at sign-up) |
Email & Stripe Billing
Users who want Stripe subscriptions can add an email address in Settings. This email is stored and used for:
- Stripe subscription billing (required for compliance)
- Usage alerts and notifications
- Account recovery communications
4.3 EVM Wallet Authentication (SIWE)
For users who prefer browser extension wallets, Circuit supports any EIP-1193 compliant EVM wallet.
Officially Supported Wallets
| Wallet | Description |
|---|---|
| MetaMask | Most popular EVM browser extension wallet |
| Coinbase Wallet | Coinbase's self-custody wallet with smart wallet support |
| WalletConnect | Protocol supporting 300+ mobile and desktop wallets |
Authentication Flow (SIWE)
``` User selects wallet from connection modal │ ▼ ┌─────────────────────────────────┐ │ 1. SIWE Message Generation │ │ Server creates nonce and │ │ SIWE-formatted message with │ │ domain, URI, and chain ID │ └─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ 2. Signature Request │ │ Wallet prompts user to sign │ │ SIWE message via │ │ personal_sign │ └─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ 3. Signature Verification │ │ Server verifies ECDSA │ │ signature and recovers │ │ signer address │ └─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ 4. Session Creation │ │ 7-day session created │ │ HttpOnly cookie set │ └─────────────────────────────────┘ ```
Security Features
| Feature | Description |
|---|---|
| SIWE Standard | EIP-4361 compliant authentication messages |
| Single-Use Nonces | Automatically deleted after verification |
| 10-Minute Expiration | Short window prevents replay attacks |
| Address Recovery | Signature verification recovers signer address |
| Multi-Session Support | Up to 5 concurrent sessions per user with sliding-window renewal — sign-ins on a new device do not kill existing sessions |
4.4 Session Management
Session Characteristics:
- Duration: 7 days with sliding-window renewal on activity
- Concurrent Sessions: Up to 5 active sessions per user (across devices)
- Storage: Database-backed
- Cookie Type: HttpOnly, Secure, SameSite=Lax
- Identifier: UUID session ID
- Cross-Tab Sync: BroadcastChannel keeps all browser tabs in agreement on auth state
4.5 User Roles & Permissions
Role Hierarchy
| Role | Level | Capabilities |
|---|---|---|
| USER | 0 | Watch, like, comment, earn XP |
| CREATOR | 1 | Upload content, earn tips, receive payments |
| MODERATOR | 2 | Moderate chat, manage users, delete content |
| ADMIN | 3 | Full platform access, user management |
5. Streaming Infrastructure
5.1 Live Streaming Architecture
``` Broadcaster (OBS / vMix) │ ├─ RTMP (TCP 1935) — single-camera streams ├─ SRT (UDP 4200) — multi-camera streams ▼ ┌───────────────────────┐ │ Streaming Server │ │ ├─ HLS Packaging │ │ └─ Token Validation │ └───────────────────────┘ │ ▼ HLS ┌───────────────────────┐ │ Global CDN │ │ Edge Distribution │ └───────────────────────┘ │ ▼ Signed URLs ┌───────────────────────┐ │ Viewers │ └───────────────────────┘ ```
Ingest Protocols: Single-camera streams use RTMP over TCP 1935. Multi-camera streams use SRT over UDP 4200 — SRT's lower latency and better packet recovery make it well-suited to synchronized angle delivery from professional encoders like vMix.
Current Delivery: HLS via BunnyCDN. Single-cam streams can use AMS ABR where enabled. Multicam is production-ready as SRT-to-HLS passthrough; multicam server-side ABR is capacity-gated because each camera adds another AMS transcode job.
Roadmap: Broader multicam adaptive bitrate delivery after dedicated AMS CPU capacity is available. WebRTC ultra-low latency delivery is also planned.
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 Streaming Specifications
Current Delivery:
- HLS at broadcaster output quality for passthrough streams
- Single-cam ABR support where per-broadcast AMS encoder settings are enabled
- Multicam ABR is capacity-gated on the current small AMS droplet
- Recommended broadcast settings: 1080p at 4000-6000 kbps
- MPEG-TS segment format via HLS
ABR Profiles / Capacity Note:
| Profile | Resolution | Bitrate |
|---|---|---|
| Source | 1080p | 4000 kbps |
| Proxy | 360p | ~800 kbps video + 96 kbps audio |
The current production ladder intentionally favors a single low proxy rung plus source passthrough. That is viable for single-cam. For multicam, the same ladder means one transcode per camera, so it should stay disabled or feature-gated until AMS has dedicated CPU headroom.
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.
5.5 Multi-Camera Broadcasting
Circuit supports multi-camera live streams, allowing creators to broadcast multiple camera angles simultaneously with real-time switching.
| Aspect | Detail |
|---|---|
| Max Cameras | Device-dependent (typically 4-8) |
| Switching Latency | Sub-200ms (CSS visibility swap) |
| Sync Method | PDT (Program Date-Time) via HLS tags |
| Sync Accuracy | ±500ms across angles |
| Audio Mode | Follow active camera or primary-only |
| Billing | 1 stream = 1 live hour (angles deduplicated) |
| ABR Status | Player and URL layer are ABR-ready; multicam server-side ABR requires dedicated AMS CPU capacity |
How It Works
``` Creator configures cameras in Creator Studio │ ▼ ┌─────────────────────────────────┐ │ Each angle → separate SRT │ │ stream to Ant Media Server │ │ (UDP 4200, low-latency ingest) │ └─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ HLS packaging per angle │ │ CDN delivery via BunnyCDN │ └─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ Viewer player preloads all │ │ angles as hidden <video> │ │ elements with HLS.js │ └─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ Camera switch = CSS visibility │ │ swap (no rebuffering) │ └─────────────────────────────────┘ ```
Viewer Experience
- Single Camera Mode: Watch one angle at a time with numbered camera buttons
- Grid Mode: View all cameras simultaneously in a mosaic layout
- Camera Switching: Click any camera button to switch instantly
- Grid Exit: Clicking a camera in grid mode switches to single view
Director Widget
Creators and assigned directors can control the broadcast in real-time via the Director widget:
- ATEM-style camera switching interface
- Grid/mosaic toggle for multi-view monitoring
- Camera status indicators (broadcasting, pending, offline)
- Secure postMessage bridge between widget iframe and player
Technical Details
- Buffer Management: Active camera gets full buffer, preloaded cameras get minimal buffer, stopped cameras load nothing
- PDT Synchronization: Uses `#EXT-X-PROGRAM-DATE-TIME` HLS tags to sync angles. Nudges playback rate ±3% for small drift (200ms-2s), hard seeks for larger drift (>2s)
- Device Adaptation: No artificial limits on modern devices. Only restricts on genuinely slow connections (2G/slow-2G via Network Information API)
- Billing Deduplication: Angle streams share the parent stream's billing period. A 2-hour broadcast with 4 cameras = 2 live hours, not 8
6. Content Delivery Network
6.1 CDN Integration
Architecture:
- Pull zone configuration from object storage
- Global edge distribution via BunnyCDN's worldwide network
- 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 Base Payment Architecture
All payments are processed on Base (Coinbase L2) using USDC or ETH:
| Component | Description |
|---|---|
| Payment Token | USDC (default) or ETH |
| Network | Base (Ethereum L2) |
| Verification | On-chain transaction confirmation |
| Fee Collection | Separate platform fee transfer |
Benefits:
- Low gas fees via L2 scaling
- Near-instant transaction finality
- On-chain fee transparency
- Immutable payment proof
Wallet Cash-Out Via Coinbase Offramp
Circuit supports user-directed USDC cash-out through Coinbase Offramp where Coinbase supports the user's region and withdrawal method. The flow is non-custodial from Circuit's perspective:
- Circuit creates a hosted Coinbase Offramp session.
- The user completes Coinbase's sell flow.
- Circuit helps the user sign the exact USDC transfer from their Circuit wallet to Coinbase's managed destination address.
- Circuit verifies and records the on-chain send status.
Coinbase handles bank account or Coinbase account connection, sell execution, KYC/compliance, and fiat payout. Circuit never receives or holds the user's cash-out funds.
7.2 Deployed Smart Contracts (Base Mainnet)
All Circuit smart contracts are deployed on Base L2 (chain ID 8453) and are publicly verifiable on Basescan.
| Contract | Address | Purpose |
|---|---|---|
| CircuitTicket (ERC-721) | 0x34011586f119fa9B8B2a4CD40131DDC3Ee678E35 | Event ticket NFT contract |
| CircuitPaymentSplitter (PPV v3) | 0x6052Cf98afA7f4759808C79FA363C232796DF6f3 | Atomic USDC PPV payment splitting |
| CircuitTipSplitter | 0xC1f0c0Ca12a6C8bd63DE626fF5e041305b9c7A70 | Atomic USDC + ETH tip splitting |
| CircuitTicketSale | 0x86b87B851f8bD017aCE80cB6bA4c5E4970871e0d | Atomic USDC payment + ERC-721 ticket mint |
Payment Token: USDC on Base — 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
All contracts are written in Solidity 0.8.24, built with Hardhat + Ignition, and use OpenZeppelin v5.2+ as the security baseline. Platform fees are enforced on-chain in basis points (e.g., 1000 bps = 10%).
7.3 Supported Tokens
| Token | Description | PPV | Tips | Tickets |
|---|---|---|---|---|
| USDC | Circle stablecoin on Base (~$1 USD) | Yes (default) | Yes (atomic split via CircuitTipSplitter) | Yes |
| ETH | Native Base chain currency | No | Yes (relay model — see §7.5) | No |
PPV and ticket payments use USDC exclusively. Tips support both USDC and ETH.
7.4 Pay-Per-View (PPV)
Fee Structure:
- Platform fee: 10% (added on top)
- Creator receives: 100% of base price
- User pays: base price + 10%
Example ($10 USDC content): ``` Base price: $10 USDC → Creator (via CircuitPaymentSplitter) Platform fee: $1 USDC → Platform (min $1, enforced on-chain) Total paid: $11 USDC ```
Transaction Verification:
- 1-confirmation finality on Base (no reorgs)
- On-chain verification via viem (decodes PaymentSplit event)
- Automatic entitlement creation on confirmation
7.5 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 USDC / 0.0005 ETH
- Creator receives: 100% of tip amount
Example ($20 USDC tip): ``` Tip amount: $20 USDC → Creator (via CircuitTipSplitter) Platform fee: $1 USDC → Platform (5% = $1, matches minimum) Total paid: $21 USDC ```
Tip Settlement Models
USDC and ETH tips settle differently because of how each token interacts with smart-contract escrow:
| Token | Model | Settlement |
|---|---|---|
| USDC | Splitter — atomic on-chain via CircuitTipSplitter | Creator and platform receive their shares in the same transaction |
| ETH | Relay — tipper sends ETH to a platform-controlled address; platform settles to the creator | Allows ETH support without an atomic-split contract for native value transfers |
Both flows are server-verified against the on-chain transaction before the tip is recorded as confirmed and the creator notified.
7.6 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 | 25 GB | 10 GB | 3 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
7.7 Event Ticketing
Creators can sell tickets to scheduled events (concerts, premieres, watch parties) with on-chain NFT minting for ticket proof-of-purchase.
| Aspect | Detail |
|---|---|
| Ticket Format | ERC-721 NFT on Base (CircuitTicket contract) |
| Payment Token | USDC (on-chain via CircuitTicketSale) |
| Purchase Model | Atomic — USDC payment + NFT mint in one transaction |
| Inventory | Per-tier with on-chain supply caps |
| Fee Model | 10% platform fee enforced on-chain |
Purchase Flow
``` Viewer browses event page │ ▼ ┌─────────────────────────────────┐ │ Select ticket tier │ │ (e.g., General, VIP, Premium) │ └─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ Approve USDC to │ │ CircuitTicketSale contract │ └─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ Call purchase(eventId, tierId) │ │ Atomic: USDC split + NFT mint │ │ If anything fails, tx reverts │ └─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ Entitlement created │ │ Viewer can access stream │ └─────────────────────────────────┘ ```
ERC-721 Ticket Metadata
Each ticket NFT includes OpenSea-compatible metadata:
- Event name and description
- Tier name and tier-specific imagery
- Event date and time
- Unique ticket number
- Creator information
Fee Structure
- Platform fee: 10% (added on top of ticket price)
- Creator receives: 100% of ticket price
- Buyer pays: ticket price + 10%
Inventory Management
- Creators set per-tier supply caps
- Real-time inventory tracking
- Automatic sold-out detection
- Draft → Active → Ended event lifecycle
8. Token Gating
8.1 Token-Gated Content
Creators can restrict content access using token ownership or balance requirements:
Gating Types
| Type | Description | Duration |
|---|---|---|
| Token Gating (NFT) | Any ERC-721 token from specified contract address | 24-hour windows |
| Token Balance Gate | Minimum ERC-20 or ETH balance (not spent) | 24-hour windows |
| Ticket Gating | Atomic USDC + ERC-721 purchase via CircuitTicketSale | Permanent (per-event) |
Verification Flow
- User requests gated content
- System retrieves user's EVM address
- NFT gating: ERC-721 `balanceOf()` checked on-chain via viem
- Balance gating: ERC-20 `balanceOf()` or ETH balance checked via viem
- Ticket gating: CircuitTicketSale purchase verified on-chain
- Entitlement created (24-hour expiry for NFT/balance, permanent for tickets)
- Access granted or denied
8.2 EVM Address Support
All users have a single EVM address (`0x...`) on Base chain. This address is used for:
- Authentication (SIWE signature)
- Token ownership verification
- Payment transactions
- NFT profile picture verification
8.3 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 native 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 layered anti-abuse measures:
- Velocity Monitoring - Flags abnormal earning patterns for review
- 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
Status: Currently active in production.
To prevent early-adopter compounding while the platform builds its initial audience, Circuit launches with Bootstrap Mode enabled — all viewer level-multipliers are normalized to 1.00x regardless of XP earned. Users still earn and accumulate XP at full base rate; what's deferred is the bonus multiplier effect from level-ups.
Configuration is database-driven (xp_config table) so exit can happen without a code deploy. Default exit thresholds:
- 100 concurrent active viewers across the platform
- 100,000 watch-minutes per day
- 14 consecutive days meeting both thresholds
When all three are sustained, multipliers re-engage at the levels defined in §9.4.
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 (rapid actions, click frequency)
- Timing Validation - Identifies impossible user actions (clicks before impressions)
- Session Verification - Ensures valid playback context
- Device Fingerprinting - Flags multiple accounts on the same device
- IP Reputation - Detects IP addresses shared by unusually many accounts
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 | USDC/ETH tips on Base | All |
| Embed | Custom content (Twitter, YouTube) | All |
| Card | Promotional poster with CTA button | All |
| Chat | Real-time messaging | Streams |
| Comments | Discussions | VOD |
| Rewards | Watch-to-earn ads | All |
| Interact | Polls & surveys | All |
| Director | Multi-camera switching controls | Multi-cam Streams |
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 |
| Multi-Camera | Multi-cam configs, angle streams |
| Ticketing | Events, tiers, purchases, redemptions |
| Billing | Usage tracking, tier management |
14.2 Key Models
User Model:
- Authentication data (EVM address, wallet source)
- Profile information
- Statistics and metrics
- Billing fields (Stripe, subscription tier)
- Preferences and settings
Video Model:
- Content metadata
- Delivery configuration
- Gating settings
- Analytics data
Stream Model:
- Stream configuration
- Status tracking
- Security settings
- Widget configuration
MultiCam Model:
- Parent stream reference
- Camera angle configuration
- Layout and switching preferences
TicketEvent Model:
- Event metadata and scheduling
- Linked stream reference
- Ticket tiers with pricing and inventory
- Purchase tracking and NFT minting status
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 |
|---|---|
| Angle Stream | Individual camera feed within a multi-camera broadcast |
| Base | Coinbase's Ethereum Layer 2 rollup — Circuit's primary blockchain |
| Bootstrap Mode | Launch-phase XP setting that normalizes all viewer multipliers to 1.00x; database-configured exit thresholds |
| CDN | Content Delivery Network for global content distribution |
| CDP | Coinbase Developer Platform — social login with embedded EVM wallets |
| CDP Embedded Wallet | EVM wallet provisioned automatically through CDP via Google OAuth or Email OTP, authenticated by access-token validation |
| CircuitPaymentSplitter | Smart contract for atomic USDC PPV payment splitting |
| CircuitTipSplitter | Smart contract for atomic USDC tip splitting |
| CircuitTicketSale | Smart contract for atomic USDC payment + ERC-721 ticket mint |
| Director | Real-time camera switching interface for multi-cam broadcasts |
| Entitlement | Access grant for gated content |
| ERC-721 | Non-fungible token standard used for ticket NFTs |
| ETH | Native Base chain currency, used for gas and tips |
| HLS | HTTP Live Streaming protocol |
| Heartbeat | Periodic client-server ping for session maintenance |
| Multi-Cam | Multi-camera broadcast configuration with synchronized angle streams |
| PDT Sync | Program Date-Time synchronization for aligning multi-camera HLS streams |
| PPV | Pay-Per-View, one-time purchase model |
| Relay (Tips) | ETH tip settlement model — tipper sends ETH to a platform address; platform settles to the creator off-contract |
| RTMP | Real-Time Messaging Protocol — single-camera ingest over TCP 1935 |
| SIWE | Sign-In with Ethereum (EIP-4361) authentication standard |
| Smart Wallet | Coinbase Smart Wallet — passkey-based EVM wallet, no extension required |
| SRT | Secure Reliable Transport — multi-camera ingest protocol over UDP 4200, lower latency and better packet recovery than RTMP |
| Ticket Event | Scheduled event with purchasable ticket tiers and atomic on-chain NFT minting |
| Token Gating | Access control via ERC-721 ownership or ERC-20/ETH balance verification |
| USDC | Circle-issued USD stablecoin on Base (6 decimals) |
| VOD | Video-on-Demand, pre-recorded content |
| XP | Experience Points, platform reward currency |
Document Information
Blueprint Version: 2.0.0 Platform Version: Circuit v2.0.0 Release Date: March 2026 Status: Production
Circuit - Where Creators Thrive
Circuit - Where Creators Thrive
Version 2.0.0 | March 2026