Nostr Tube - Web3 Video Platform
π Built in 1 week. Like CSS separated presentation from data, UPlanet separates events from processing chains.
π― The Revolution
No API to build: NOSTR events handle distribution
No auth to implement: NIP-42 cryptographic authentication
No servers to manage: IPFS + NOSTR network
Interoperable by design: Any NOSTR client can interact
Result: Focus on your features, not infrastructure.
Overview
Nostr Tube is a fully decentralized YouTube alternative built on NOSTR, IPFS, and MULTIPASS. It enables users to upload, share, like, and comment on videos without relying on centralized platforms.
Architecture
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββ βββββββββββββββ
β YouTube Sync ββββββΆβ IPFS Upload ββββββΆβ NOSTR Pub ββββββΆβ Web UI β
β (liked videos) β β (storage) β β (kind 21/22)β β (display) β
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββ βββββββββββββββ
β β β β
β β β β
βΌ βΌ βΌ βΌ
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββ βββββββββββββββ
β Webcam Record ββββββΆβ uDRIVE β β Relay β β Channel β
β (user videos) β β (local) β β (ws://...) β β Groups β
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββ βββββββββββββββKey Technologies
NOSTR: Decentralized social protocol for video events (NIP-71)
IPFS: Content-addressed storage for video files
MULTIPASS: Unified identity system with NOSTR keys and uDRIVE storage
NIP-42: Authentication mechanism for secure uploads
NIP-101: UPlanet protocol for decentralized identity, geographic coordination, and constellation synchronization
UMAP: Geographic anchoring of videos (latitude/longitude) - defined in NIP-101
Components
1. YouTube Synchronization (youtube.com.sh)
Synchronizes liked videos from YouTube to Nostr Tube.
Location: Astroport.ONE/IA/youtube.com.sh
Features:
Fetches up to 5 liked videos per sync (configurable)
Uses YouTube cookies for authentication (Netscape format)
Processes max 2 new videos per day (prevents overload)
Filters already processed videos
Checks if videos exist in uDRIVE before downloading
Sends email notifications after sync
Workflow:
Cookie Setup:
Export YouTube cookies using browser extension (e.g., "Get cookies.txt LOCALLY")
Upload to
/cookieendpoint or directly to~/.zen/game/nostr/{PLAYER}/.cookie.txtCookie file must be Netscape format (tab-separated with 7+ columns)
Tracking Files:
Last sync date:
~/.zen/game/nostr/{PLAYER}/.last_youtube_syncProcessed videos:
~/.zen/game/nostr/{PLAYER}/.processed_youtube_videosLogs:
~/.zen/tmp/IA.log
2. Video Processing (process_youtube.sh)
Downloads and processes YouTube videos, then uploads to IPFS.
Location: Astroport.ONE/IA/process_youtube.sh
Usage:
Options:
--debug: Enable debug logging--json: Output pure JSON (no separators) to stdout--json-file <file>: Write JSON to a separate file (recommended for reliable parsing)--output-dir <dir>: Specify custom output directory for downloaded files--no-ipfs: Deprecated (IPFS upload removed for UPlanet_FILE_CONTRACT.md compliance)
Features:
Downloads video in MP4 format (max 720p) or MP3
Extracts comprehensive metadata (title, duration, uploader, YouTube metadata, etc.)
Validates video duration (max 3 hours)
Automatically selects resolution based on video duration to stay under 650MB limit
Organizes files in uDRIVE structure:
Videos β
uDRIVE/Videos/Audio β
uDRIVE/Music/{artist}/
Returns JSON with file path, metadata, and comprehensive YouTube information
Supports playlist downloads (MP3 format)
Output Format:
Dependencies:
yt-dlp: YouTube downloaderipfs: IPFS daemon for content addressingffmpeg: Video processing (optional, for metadata extraction)
3. Webcam Interface (webcam.html)
Web-based interface for recording and uploading videos.
Location: UPassport/templates/webcam.html
Route: GET /webcam, POST /webcam
Features:
Recording: Browser-based video recording (3-30 seconds)
Upload: Direct file upload (MP4, WebM, MOV, max 500MB)
NOSTR Auth: Supports extension (nos2x, Alby) or nsec key
Geographic Tagging: UMAP coordinates via map picker or GPS
Preview: Modal with video preview before publishing
Mobile Optimized: Responsive design for mobile devices
Workflow:
Connect to NOSTR (extension or nsec)
Record video or upload file
Add title, description, location
Upload to IPFS via
/api/fileupload(returns CID)Publish NOSTR event (kind 21 or 22) via
POST /webcam
JavaScript Functions:
handleNostrConnect(): Authenticate with NOSTRinitWebcamFeatures(): Initialize camera recordinghandleVideoUpload(): Process uploaded filepublishVideo(): Upload to IPFS and publish to NOSTRshowVideoModal(): Preview before publishing
4. File Upload API (/api/fileupload)
Secure file upload endpoint with NIP-42 authentication.
Route: POST /api/fileupload
Location: UPassport/54321.py (line 3348)
Authentication:
NIP-42: NOSTR authentication required via
npubparameterVerification via
verify_nostr_auth()functionChecks relay connection and event signature
Features:
Detects file type (image, video, audio, document)
Organizes files in uDRIVE structure:
Images/- Images with AI-generated filenamesVideos/- Video filesMusic/- Audio files organized by artistDocuments/- Text/PDF filesApps/- Application files
Cookie Detection: Special handling for Netscape cookie files
Saves to
~/.zen/game/nostr/{email}/.cookie.txtNo IPFS upload for security
AI Filenames: Images get AI-generated descriptive filenames
IPFS CID generation via
upload2ipfs.sh
Request Format:
Response Format:
5. Video Publishing (POST /webcam)
Publishes videos as NOSTR events (NIP-71).
Route: POST /webcam
Location: UPassport/54321.py (line 2713)
Process:
Receives IPFS CID from previous upload
Validates player email and NOSTR authentication
Extracts video metadata (duration, dimensions) via
ffprobeGenerates thumbnail (if possible)
Creates NOSTR event with NIP-71 tags
Publishes to relay(s)
NOSTR Event Structure (NIP-71 + Provenance Extension):
Video Kind Selection:
kind: 21: Regular videos (>60 seconds)kind: 22: Short videos (β€60 seconds)
Tags Explained:
title: Video titleurl: IPFS URL (required forcreate_video_channel.py)m: Media type (video/mp4,video/webm, etc.)Automatic detection by
upload2ipfs.shfrom file contentPriority: file magic bytes β file extension β
video/mp4(default)For MP4 files: Will be
video/mp4(notvideo/webm)
imeta: NIP-71 metadata tag with dimensions and URLduration: Video duration in secondsg: Geohash tag (latitude,longitude) for UMAP anchoringChannel-*: Channel grouping tagTopic-*: Topic/keyword tags for categorizationimage: Thumbnail IPFS URLx: SHA-256 file hash (for deduplication and provenance)info: CID of info.json (metadata reuse, avoids redundant IPFS operations)upload_chain: Distribution chain (comma-separated pubkeys showing file propagation)e: Reference to original event ID (if video is a re-upload)p: Reference to original author pubkey (if video is a re-upload)
Publishing Script:
Uses
~/.zen/Astroport.ONE/tools/nostr_send_note.pyRelay discovery via Astroport swarm: each node exposes
myRELAYin12345.jsonLocal relay:
ws://127.0.0.1:7777(strfry local)Swarm relays: discovered via
_12345.shfrom compatible Astroport nodesConstellation sync:
backfill_constellation.shsynchronizes video events (kind 21/22) across swarmReturns event ID on success
6. Video Discovery (/youtube)
Fetches and displays videos from NOSTR events.
Route: GET /youtube
Location: UPassport/54321.py (line 2211)
Parameters:
html=1: Return HTML page instead of JSONchannel: Filter by channel namesearch: Search in titles and keywordskeyword: Filter by specific keywords (comma-separated)date_from/date_to: Date range filter (YYYY-MM-DD)duration_min/duration_max: Duration filter (seconds)sort_by: Sort order (date,duration,title,channel)lat/lon/radius: Geographic filter (decimal degrees, km)
Process:
Fetches NOSTR events via
create_video_channel.pyFilters events by:
Kind: 21 (normal) or 22 (short)
Tags: Must have
urltag with IPFS/YouTube URLTags: Must have
mtag withvideomedia type
Applies user filters (channel, search, date, location)
Groups videos by channel
Returns JSON or renders HTML template
Response Format:
7. Channel Creation (create_video_channel.py)
Organizes videos into channels from NOSTR events.
Location: Astroport.ONE/IA/create_video_channel.py
Usage:
Features:
Fetches NOSTR events (kind 21, 22) from relay
Validates NIP-71 compatibility
Groups videos by channel (
Channel-*tags)Calculates channel statistics (duration, size, video count)
Supports export formats: JSON, M3U, CSV
Event Validation:
Must be kind 21 or 22
Must have
urltag with IPFS/YouTube URLMust have
mtag indicating video media typeFilters incompatible events automatically
Channel Detection:
Primary:
Channel-*tagsFallback: Uploader name from metadata
Format:
Channel-{sanitized_name}
Metadata Extraction:
Title: From
titletag or content parsingUploader: From
uploadertag or channel nameDuration: From
durationtagFile size: From
sizetagDimensions: From
dimtag orimetaLocation: From
g,latitude,longitudetagsThumbnail: From
imageorrtags
8. User Interface (youtube.html)
Web interface for browsing and watching videos.
Location: UPassport/templates/youtube.html
Route: GET /youtube?html=1
Features:
Sidebar: Channel navigation, filters, search
Video Grid: Thumbnail grid with video cards
Player: HTML5 video player with IPFS gateway detection
Filters: Channel, search, date, duration, location
Map View: Geographic visualization of videos (UMAP)
Responsive: Mobile-optimized layout
IPFS Gateway Detection:
Auto-detects IPFS gateway based on current Astroport station domain
Uses gateway from same Astroport swarm (ORIGIN public or αΊEN private)
Discovery via
_12345.sh: each node exposes itsmyIPFSgateway in12345.jsonLocal gateway:
http://127.0.0.1:8080for localhost accessDomain-based:
https://ipfs.{domain}derived from station hostnameDefault:
https://ipfs.copylaradio.comfor UPlanet ORIGINSwarm synchronization: compatible gateways discovered via IPNS swarm map (
~/.zen/tmp/swarm/)
Video Card Structure:
JavaScript Functions:
loadVideos(): Fetches videos from/youtubeAPIrenderVideoGrid(): Renders video cardsopenVideoInTheater(): Opens video in theater modetoggleVideoPlayer(): Inline video player toggleapplyFilters(): Applies search/filter criteriashowMapView(): Displays geographic maploadAllVideoStats(): Loads engagement statistics for all videosloadNetworkVideos(): Loads videos from NΒ² network
Enhanced Features:
Real-time engagement stats on video cards (likes, comments, shares)
Theater mode integration (double-click video to open)
NOSTR authentication for likes, comments, bookmarks
Network-based video recommendations
Workflow Examples
Example 1: Upload YouTube Liked Video
Example 2: Record and Publish Webcam Video
Example 3: View Videos by Channel
Example 4: Search Videos by Location
Data Flow
Upload Flow
Discovery Flow
Astroport Swarm Integration & NIP-101 Protocol
Nostr Tube leverages the Astroport swarm network and NIP-101 protocol for decentralized video distribution, identity management, and geographic coordination.
NIP-101 Integration
NIP-101 (UPlanet: Decentralized Identity & Geographic Coordination) is applied to Nostr Tube through:
Hierarchical GeoKeys: Geographic coordinate-based Nostr keypairs (UMAP, SECTOR, REGION) for location-based video discovery
DID Documents (kind 30800): W3C-compliant decentralized identities linked to video creators
Constellation Synchronization: Automatic event sync across Astroport relay network using NIP-101's synchronization protocol
Protocol NΒ² (Network of Networks)
Nostr Tube implements the NΒ² protocol for social graph-based video discovery:
N1 (Friends): Videos from direct connections (kind 3 contact lists) are prioritized in recommendations
N2 (Friends of Friends): Videos from extended network (2nd degree) appear in discovery feed
Constellation Sync:
backfill_constellation.shsynchronizes events across NΒ² network using NIP-101's event kind list
Event Kinds Synchronized (per NIP-101):
Core: 0, 1, 3, 5, 6, 7
Media: 21, 22 (videos)
Content: 30023, 30024
Identity: 30800 (DID Documents)
Oracle: 30500-30503 (Permit system)
ORE: 30312-30313 (Environmental verification)
Total: 18 event types automatically synchronized across constellation
Swarm Discovery (_12345.sh)
Each Astroport node publishes its services via IPNS in
12345.jsonContains:
myIPFS(gateway),myRELAY(NOSTR),myAPI(UPassport),ipfsnodeidSwarm map stored in:
~/.zen/tmp/swarm/{ipfsnodeid}/Two swarm levels:
UPlanet ORIGIN: Public swarm (all Astroport nodes)
UPlanet αΊEN: Private swarm (cooperative members only)
Constellation Synchronization (backfill_constellation.sh)
Implements NIP-101 synchronization protocol across Astroport relays
Synchronizes NOSTR events (including video events kind 21/22) across swarm
Discovers peers via IPNS swarm map
Uses IPFS P2P tunnels for localhost relays (via
DRAGON_p2p_ssh.sh)Targets constellation members (friends N1 and friends of friends N2) per NΒ² protocol
Video events are automatically synchronized from swarm peers
Also synchronizes NIP-101 events (kind 30800, 30500-30503, 30312-30313) for identity and geographic coordination
Video Gateway Selection
Videos are served from Astroport IPFS gateways in the same swarm
Gateway URLs discovered from
12345.jsonfiles in swarm directoryLocal gateway preferred:
http://127.0.0.1:8080Fallback to swarm peers:
https://ipfs.{domain}from discovered nodes
NOSTR Event Standards
NIP-101 Integration
Nostr Tube events are synchronized across Astroport relays according to NIP-101's Constellation Synchronization protocol:
Synchronized Event Kinds:
Core Events: 0 (Metadata), 1 (Text Notes), 3 (Contact Lists), 5 (Events), 6 (Reposts), 7 (Reactions)
Video Events: 21 (Normal Videos), 22 (Short Videos) - NIP-71
Content: 30023 (Long-form), 30024 (Article)
Identity: 30800 (DID Documents) - NIP-101
Oracle: 30500-30503 (Permit System) - NIP-101
ORE: 30312-30313 (Environmental Verification) - NIP-101
All events are authenticated via NIP-42 and synchronized through the NΒ² network (friends N1, friends of friends N2).
NIP-71 Video Events
Kind 21 (Normal Videos):
Horizontal/landscape videos
Longer format content
Standard viewing experience
Kind 22 (Short Videos):
Vertical/portrait videos
Short-form content (β€60 seconds)
Stories/reels/shorts format
Required Tags
title: Video title (required)url: Primary video URL (IPFS or HTTP) (required)m: Media type, e.g.,video/mp4,video/webm(required)Automatic detection by
upload2ipfs.shfrom file contentPriority: file magic bytes β file extension β
video/mp4(default)For MP4 files: Will be
video/mp4(notvideo/webm)
published_at: Unix timestamp (required)x: SHA-256 file hash (required for provenance & deduplication)info: CID of info.json (required for metadata reuse)
Recommended Tags
duration: Duration in secondsdim: Video dimensions (e.g.,1920x1080)image: Thumbnail URLimeta: NIP-71 metadata tag with full specsg: Geographic coordinates (UMAP)Channel-*: Channel groupingTopic-*: Topic/keyword tagsupload_chain: Distribution chain (pubkeys of uploaders)e: Original event ID (for re-uploads, provenance tracking)p: Original author pubkey (for re-uploads, copyright respect)
Optional Tags
alt: Accessibility descriptioncontent-warning: NSFW warningtext-track: Subtitles/captions (WebVTT)p: Participant pubkeysr: Reference linkst: Hashtags
Provenance & Deduplication System π
Nostr Tube implements a comprehensive provenance tracking and deduplication system to ensure content integrity, avoid redundant uploads, and respect copyright.
Key Features
1. File Hash (SHA-256)
Every file uploaded gets a SHA-256 hash calculated by
upload2ipfs.shHash is stored in NOSTR event tag:
["x", "sha256_hash"]Enables client-side deduplication: identical files are detected before upload
Published in both:
Direct tag:
["x", "hash"]for quick lookupimetatag: For NIP-71 compatibility
2. Info.json CID
Complete metadata stored in IPFS as
info.jsonIncludes: duration, dimensions, codecs, thumbnails, animated GIF CIDs
Tag:
["info", "QmInfoCID"]
Format Standardization (v2.0):
NostrTube uses a standardized info.json v2.0 format for metadata:
Base structure:
protocol,file,ipfs,metadata,nostrMedia-specific:
mediasection with camelCase fields (v2.0)Object-based dimensions:
{width, height, aspectRatio}Nested codecs:
{video, audio}Thumbnails object:
{static, animated}
Source attribution:
source.youtubeorsource.tmdbfor external content (v2.0)Provenance tracking:
provenance.uploadChainwith timestamps (v2.0)Backward compatible: Clients support both v1.0 (snake_case, flat) and v2.0 (camelCase, nested)
π See: INFO_JSON_FORMATS.md for complete specification
Format varies by media type and source:
Video (webcam/personal): Base +
mediasectionVideo (Film/Serie): Base +
media+source.tmdbVideo (YouTube): Base +
media+source.youtubeAudio (MP3): Base +
media(audio-specific)Image: Base +
imagesectionPDF/Document: Base structure only
Re-uploads: All above +
provenancesectionBenefits:
Avoids redundant metadata extraction (expensive ffprobe operations)
Enables instant metadata reuse on re-uploads
Centralized source of truth for file metadata
3. Upload Chain
Distribution tracking: Records all users who have uploaded this file
Format:
["upload_chain", "pubkey1,pubkey2,pubkey3"]Shows propagation path through the network
First pubkey = original uploader
Subsequent pubkeys = redistributors (sharing via their nodes)
4. Provenance References
["e", "original_event_id"]: Links to the first NOSTR event for this file["p", "original_author_pubkey"]: Credits the original uploaderEnables:
Copyright respect: Original creator is always visible
Content verification: Users can verify file authenticity
Social graph tracking: See who in your network shared this content
Workflow Example
Alice uploads a video:
Bob uploads the SAME video (detected by hash):
Note: The main file CID is reused, but a new info.json is created with updated timestamp and upload_chain. This allows the upload history to evolve with each re-publication.
Implementation
Backend (upload2ipfs.sh):
Calculate SHA-256 hash before IPFS operations
Search relay for existing events with same hash:
OPTIMIZATION: Uses NIP-01 tag filters (
#x) for direct server-side filteringVideos:
--kind 21 --tag-x <hash> --limit 1and--kind 22 --tag-x <hash> --limit 1Documents:
--kind 1063 --tag-x <hash> --limit 1Performance: ~1000x faster than fetching all events and filtering client-side
Bandwidth: Queries return only matching event instead of 1000+ events
If found:
Skip
ipfs add(file already exists)Use
ipfs getto fetch existing CID locally (pins automatically)Reuse
info.jsonCID for metadataAppend current user to
upload_chain
If not found:
Upload to IPFS normally
Create new
info.jsonInitialize
upload_chainwith current user
Frontend (youtube.enhancements.js):
extractVideoMetadata(): Extracts provenance tags from eventsloadTheaterProvenance(): Displays provenance in theater modeShows:
File hash (for verification)
Link to info.json (view full metadata)
Distribution chain (visual badges)
Original uploader (if re-upload)
Benefits
β Bandwidth Savings: Identical files uploaded only once to IPFS β Storage Efficiency: Main file CID reused, no duplicate uploads β Copyright Respect: Original creator always credited β Content Verification: Users can verify file authenticity via hash β Network Transparency: See distribution path through network β Faster Uploads: Re-uploads are near-instant (no IPFS operations for main file) β Living History: Each re-publication creates new info.json with updated timestamp and upload_chain β Event Evolution: Upload history evolves with new NOSTR events while reusing same file CID
Re-publication Behavior
When a user re-uploads an identical file (same SHA-256 hash):
What is reused:
β Main file CID (no redundant IPFS upload)
β Thumbnail CID (if available from original)
β Animated GIF CID (if available from original)
β Video metadata (duration, dimensions, codecs) - extracted from original info.json
What is created new:
π New NOSTR event (kind 21/22) with new event ID
π New info.json with:
Updated timestamp (
"date": "2025-11-06 01:30 +0000")Updated upload chain (
"upload_chain": "alice_pubkey,bob_pubkey")Reference to original event (
"original_event_id": "...")Same file CID but new metadata document
π New info.json CID (because content changed)
Why this matters:
π History tracking: Each re-publication is visible in the relay
π Chain evolution: Upload chain grows with each redistribution
π Temporal context: Timestamps show when each user shared the content
π― Event-based discovery: Users can find the same content via different events
π Network propagation: See how content spreads through the NΒ² network
Example timeline:
Result: 1 file on IPFS, 3 events in NOSTR, 3 info.json documents tracking distribution
Security Considerations
Hash Collision: SHA-256 provides 256-bit security (practically impossible to forge)
Metadata Integrity: Info.json is content-addressed (CID = hash of content)
Event Authenticity: All NOSTR events signed by uploader's private key
Trust Model: Users trust their NΒ² network (friends & friends of friends)
Storage Structure
uDRIVE Organization
IPFS Structure
Videos are stored in IPFS with content addressing:
CID format:
Qm{hash}URL format:
/ipfs/{cid}/{filename}Thumbnails: Separate IPFS uploads
Security & Authentication
NIP-42 Authentication
All uploads require NIP-42 authentication:
Client: Connects to relay and sends
AUTHeventRelay: Challenges with random message
Client: Signs challenge and sends response
Server: Verifies signature via
verify_nostr_auth()
Implementation:
Cookie Security
Cookie files are NOT uploaded to IPFS
Stored locally:
~/.zen/game/nostr/{hex}/.domain.cookieUsed only for Domain authentication
Is kept private
Geographic Anchoring (UMAP) - NIP-101
Videos can be anchored to geographic locations using NIP-101's UMAP system:
UMAP Grid Levels (NIP-101)
UMAP
0.01Β°
~1.2 kmΒ²
Neighborhood-level video discovery
SECTOR
0.1Β°
~100 kmΒ²
City-level video grouping
REGION
1.0Β°
~10,000 kmΒ²
Regional video collections
Tag Format (NIP-101 Compatible)
g:"lat,lon"(e.g.,["g", "48.8566,2.3522"]) - Primary geographic taglatitude: Separate latitude tag (FLOAT_STRING)longitude: Separate longitude tag (FLOAT_STRING)application:"UPlanet"(identifies UPlanet/NIP-101 events)
Use Cases:
Location-based video discovery
UMAP visualization
Geographic filtering in
/youtubeAPIIntegration with NIP-101 ORE system (environmental verification at location)
Local community video feeds (NΒ² network filtered by UMAP)
Example:
Geographic Video Discovery
Videos tagged with UMAP coordinates can be discovered by:
UMAP-level feeds: Subscribe to videos from specific neighborhood (0.01Β° precision)
SECTOR-level feeds: Browse videos from entire city area (0.1Β° precision)
REGION-level feeds: Explore videos from regional collection (1.0Β° precision)
NΒ² Network filtering: Combine geographic tags with social graph (friends N1/N2 in same UMAP)
API Endpoints Summary
/youtube
GET
No
List videos (with filters)
/theater
GET
No
Theater mode modal template
/playlist
GET
No
Playlist manager interface
/webcam
GET
No
Webcam recording interface
/webcam
POST
NIP-42
Publish video to NOSTR
/api/fileupload
POST
NIP-42
Upload file to IPFS
/api/delete
POST
NIP-42
Delete file from uDRIVE
/cookie
GET
NIP-42
Cookie upload guide
Troubleshooting
Video Not Appearing in /youtube
Check NOSTR Event:
Verify event is kind 21 or 22
Ensure
urltag contains IPFS/YouTube URLEnsure
mtag indicates video type
Check Relay Connection:
Local relay:
ws://127.0.0.1:7777(strfry on local node)Swarm relays: Check
~/.zen/tmp/swarm/*/12345.jsonformyRELAYentriesConstellation sync: Verify
backfill_constellation.shis running to sync from swarm peersEvents must be published successfully
Check Tags:
create_video_channel.pyfilters incompatible eventsCheck logs:
~/.zen/tmp/IA.log
YouTube Sync Not Working
Cookie File:
Verify cookie file format (Netscape, tab-separated)
Check file location:
~/.zen/game/nostr/{hex}/.cookie.txtTest with
--debugflag
Rate Limiting:
YouTube may rate-limit requests
Sync runs max once per day
Max 2 videos processed per sync
yt-dlp Issues:
Update
yt-dlp:pip install -U yt-dlp20H12 process takes care about it
IPFS Upload Fails
IPFS Daemon:
Ensure IPFS daemon is running:
ipfs daemonCheck IPFS version:
ipfs version
File Size:
Videos max 500MB (webcam upload)
YouTube downloads: max 3 hours duration
Disk Space:
Check available space:
df -hMinimum 1GB required for sync
Enhanced UX Features (Implemented)
Nostr Tube includes advanced UX features to provide a unique and engaging video experience:
User Tags & Tag Cloud π·οΈ
Community-driven tagging: Users can add tags to any video (NIP-32 Labeling)
Tag cloud visualization: Display most popular tags with size-based weighting
Tag-based search: Find videos by user-contributed tags (single or multiple tags with AND/OR operators)
Tag aggregation: See which tags are most popular across all videos
Tag management: Users can add/remove their own tags
Standards-compliant: Uses NIP-32 (Labeling) for tag events (kind 1985)
See:
nostr-nips/71-video-user-tags-extension.mdfor full specification
Theater Mode π¬
Full-screen immersive viewing with integrated comments panel
Real-time comments with timestamp support (jump to specific moments)
Comment timeline showing markers on video progress bar
Live chat during playback via NOSTR relay WebSocket
Related videos automatically displayed
Picture-in-Picture mode support
Provenance Display: Shows file hash, info.json link, distribution chain, and original uploader
Template:
theater-modal.html(route:/theater)
Engagement Statistics π
Real-time stats displayed on video thumbnails (likes, comments, shares)
Live updates when reactions occur
Engagement badges for trending content
Integrated with NOSTR reactions (kind 7) and comments
Playlists π
Create and manage video playlists (NIP-51 kind 10001)
Add videos to playlists directly from theater mode
Share playlists with NOSTR links
Template:
playlist-manager.html(route:/playlist)
NΒ² Network Recommendations π
Personalized feed based on social graph (Protocol NΒ²)
Videos from friends (N1) prioritized - uses NOSTR contact lists (kind 3)
Videos from friends of friends (N2) in discovery section
Geographic filtering: Combines NΒ² network with UMAP tags (NIP-101) for local video discovery
Constellation sync: Events automatically synchronized across NΒ² network via NIP-101 protocol
Relay synchronization: Uses
backfill_constellation.shto sync events across Astroport relays
Enhanced Video Actions π―
Share with preview modal showing video card
Custom messages and tags when sharing
Copy shareable links with metadata
Bookmark with custom notes
All integrated with NOSTR events
Comment Timeline β±οΈ
Visual markers on video progress bar for comments
Click to jump to specific timestamps
Submit comments at current playback position
Timeline overlay with tooltips
Related Videos π
Same channel videos
Similar tags matching
Same location (UMAP) videos
Videos liked by same users
Displayed in theater mode sidebar
Implementation Files
Core JavaScript
UPlanet/earth/youtube.enhancements.js: All UX enhancement functionsTheater mode, VideoStats, LiveVideoChat, Playlists, Related videos, etc.
UPlanet/earth/common.js: Core NOSTR functions (already exists)
Templates
UPassport/templates/youtube.html: Main video interface with all enhancements integratedUPassport/templates/theater-modal.html: Theater mode templateUPassport/templates/playlist-manager.html: Playlist management interface
Routes (54321.py)
GET /theater: Theater mode modal templateGET /playlist: Playlist manager interfaceGET /youtube: Main video browsing interface
Integration
All enhancements are loaded via:
Future Enhancements
NOSTR Event Kinds Used
Video & Content Events
Kind 1
Text Notes
Video posts, comments, shares
NIP-01
Kind 7
Reactions
Likes and reactions on videos
NIP-25
Kind 21/22
Video Events
Video content (NIP-71) - 21 for regular, 22 for short videos
NIP-71
Kind 10001
Playlists
Video playlists (NIP-51 Lists)
NIP-51
Kind 30001
Bookmarks
Video bookmarks
NIP-51
Kind 3
Contact Lists
Used for NΒ² network recommendations
NIP-02
Kind 1985
User Tags
User-generated tags for videos (NIP-32 Labeling)
NIP-32
NIP-101 Events (Identity & Geographic Coordination)
Kind 30800
DID Documents
W3C-compliant decentralized identities for video creators
β Constellation
Kind 30500
Permit Definitions
License/permit type definitions for ORE verifiers
β Constellation
Kind 30501
Permit Requests
User applications for permits/credentials
β Constellation
Kind 30502
Permit Attestations
Peer attestations for permit applicants
β Constellation
Kind 30503
Permit Credentials
W3C Verifiable Credentials issued by Oracle
β Constellation
Kind 30312
ORE Meeting Spaces
Geographic spaces for environmental verification
β Constellation
Kind 30313
ORE Verification Meetings
Completed environmental compliance verifications
β Constellation
Constellation Synchronization: All NIP-101 events (kinds 30800, 30500-30503, 30312-30313) are automatically synchronized across Astroport relays via backfill_constellation.sh as part of the NΒ² protocol.
References
NOSTR Improvement Proposals (NIPs)
NIP-01: Basic protocol flow
NIP-02: Contact Lists
NIP-25: Reactions (likes)
NIP-32: Labeling (user tags for videos - kind 1985)
NIP-42: Relay Authentication (required for all uploads)
NIP-51: Lists (playlists - kind 10001, bookmarks - kind 30001)
NIP-71: Video Events specification (kinds 21/22)
NIP-71 Extension: User Tags for Videos (
nostr-nips/71-video-user-tags-extension.md)NIP-92: Media Metadata (imeta tags)
NIP-101: UPlanet protocol - Decentralized Identity & Geographic Coordination
DID Documents (kind 30800)
Oracle System (kinds 30500-30503)
ORE System (kinds 30312-30313)
Constellation Synchronization
Hierarchical GeoKeys (UMAP, SECTOR, REGION)
Additional Resources
MULTIPASS:
make_NOSTRCARD.shdocumentationUMAP: Geographic anchoring system (defined in NIP-101)
Protocol NΒ²: Network of Networks for social graph-based discovery
Astroport Swarm: Decentralized network of Astroport nodes
NIP-101 Implementation
Main Repository: github.com/papiche/Astroport.ONE
NIP-101 Repository: github.com/papiche/NIP-101
Documentation: See
nostr-nips/101.mdin Astroport.ONE repository
License
This documentation is part of the Astroport.ONE project and follows the project's licensing terms.
Last updated