feat: streaming ecash payments + media playback overhaul

Cashu ecash protocol (BDHKE blind signatures, cashuA token format,
mint HTTP client) replacing the stub wallet. TollGate-inspired streaming
data payment system with step-based pricing (bytes/time/requests),
session management with incremental top-ups, usage metering, and
Nostr kind 10021 service advertisements.

13 new streaming.* RPC endpoints. Content server now verifies real
Cashu tokens. Profits tracking includes streaming revenue.

Frontend: GlobalAudioPlayer (persistent bottom bar across all pages),
video lightbox with full controls, audio in MediaLightbox, free file
previews (no blur), paid 10% audio/video previews, separated play
vs download buttons in PeerFiles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-04-11 22:31:28 -04:00
co-authored by Claude Opus 4.6
parent 0995aa1033
commit 2c98bdd19d
25 changed files with 4740 additions and 480 deletions
+39
View File
@@ -0,0 +1,39 @@
//! Streaming ecash payments for metered data access.
//!
//! Implements a TollGate-inspired protocol for paying for streaming data
//! using Cashu ecash micropayments. Supports three metering models:
//!
//! - **Bytes**: Pay per MB downloaded (content, federation sync)
//! - **Time**: Pay per minute of access (relay, API endpoints)
//! - **Requests**: Pay per API call
//!
//! # Architecture
//!
//! ```text
//! Paying Node Selling Node
//! ┌──────────────┐ ┌──────────────────────┐
//! │ Cashu Wallet │──cashuA token──────▶│ Gate │
//! │ (real BDHKE) │ │ verify + receive │
//! └──────────────┘ └──────┬───────────────┘
//! │ create/topup session
//! ┌──────▼───────────────┐
//! │ Meter │
//! │ track usage │
//! └──────┬───────────────┘
//! │ enforce allotment
//! ┌──────▼───────────────┐
//! │ Service │
//! │ content / sync / api │
//! └──────────────────────┘
//! ```
//!
//! # Discovery
//!
//! Services are advertised via Nostr kind 10021 events (TollGate TIP-01
//! compatible) containing pricing tags per TIP-02.
pub mod advertisement;
pub mod gate;
pub mod meter;
pub mod pricing;
pub mod session;