Funnelcake

DiVine Funnelcake Nostr Relay

NIP-11 JSON LLM Guide Funnel API
v0.1.0

Architecture

DiVine FunnelCake is more than a standard Nostr relay—it's a unified video platform combining real-time event streaming with powerful analytics APIs, all backed by ClickHouse for superior performance.

┌─────────────────┐ ┌─────────────────┐ │ Nostr Clients │ │ REST Clients │ └────────┬────────┘ └────────┬────────┘ │ WebSocket │ HTTP ▼ ▼ ┌─────────────────┐ ┌─────────────────┐ │ cake │ │ funnel │ │ (relay:7777) │ │ (api:8080) │ └────────┬────────┘ └────────┬────────┘ │ │ └───────────┬───────────┘ ▼ ┌─────────────────┐ │ ClickHouse │ └─────────────────┘

cake — WebSocket Relay

High-performance Nostr relay optimized for video events

  • Real-time event streaming
  • Subscription management
  • Multi-node via Redis pub/sub
  • Batch writes for high throughput

funnel — REST API

Video analytics and discovery API for applications

  • Video stats & engagement metrics
  • Trending & popular feeds
  • Full-text search
  • NIP-86 management interface

ClickHouse Backend

Column-oriented database for blazing-fast analytics

  • Shared storage for both services
  • Materialized views for trending
  • ReplacingMergeTree for events
  • Optimized for high write throughput

Relay Information

Software DiVine FunnelCake (Cake Relay)
Version 0.1.0
Operator Pubkey 8fd5eb6d8f362163bc00a5ab6b4a3167dbf32d00ec4efdbcf43b3c9514433b7e

REST API (funnel)

The funnel service provides a comprehensive REST API for video analytics, user profiles, search, and platform management.

Videos List, stats, views, categories, bulk operations
Users Profiles, social graph, feeds, creator analytics
Search Full-text and hashtag search
Platform Stats, health probes, NIP-86 management
View Full API Documentation

All endpoints return JSON. Some endpoints require NIP-98 authentication.

Supported NIPs

NIP-01
Basic Protocol
Core Nostr protocol: events, subscriptions, and filters
NIP-04
Encrypted Direct Messages
Legacy encrypted direct messages (kind 4)
NIP-09
Event Deletion
Request deletion of events by ID or coordinates
NIP-11
Relay Information
Machine-readable relay metadata at root URL
NIP-16
Event Treatment
Regular, replaceable, and ephemeral event handling
NIP-18
Reposts
Generic repost and event resharing support (kind 16)
NIP-23
Long-form Content
Long-form articles and addressable text content (kind 30023)
NIP-22
Comments
Threaded comments on non-kind-1 events (kind 1111)
NIP-25
Reactions
Likes, emoji reactions, and upvotes (kind 7)
NIP-32
Labels
Content and moderation labels applied to events (kind 1985)
NIP-33
Parameterized Replaceable
Addressable events with d-tag coordinates
NIP-40
Expiration Timestamp
Events with expiration tags are filtered from query results
NIP-45
Event Counting
COUNT message for subscription result counts
NIP-50
Search Capability
Full-text search in event content
NIP-51
Lists
Mute lists, bookmark lists, categorized people lists, bookmark sets, and curation sets (kinds 10000, 10003, 30000, 30003, 30005)
NIP-52
Calendar and RSVP
Calendar events, calendar collections, and RSVP events (kinds 31922, 31923, 31924, 31925)
NIP-56
Reports
Moderation and abuse reports submitted as kind 1984 events
NIP-71
Video Events
Video metadata, chapters, and collaborator responses (kinds 34235, 34236, 34237, 34238)
NIP-86
Relay Management
Administrative RPC via HTTP POST
NIP-94
Audio Metadata
Audio file metadata and attachments (kind 1063)
NIP-98
HTTP Authentication
NIP-98 signed authorization headers

Resource Limits

Max Message 512 KB
Max Content 100 KB
Max Subscriptions 100
Max Filters/REQ 10
Max Events/Query 5000
Max Tags/Event 2000
Max Sub ID Length 256

Event Kinds

0
Profile
User profiles with display names, avatars, and bios
3
Contacts
Follow lists and social graph connections
4
Encrypted Direct Message
Legacy encrypted private messages between users
5
Deletion
Requests to delete previously published events
7
Reaction
Likes, emoji reactions, and upvotes on content
16
Generic Repost
Share any event type to your followers
62
Relay Set
Relay-scoped list events and NIP-62 vanish coordination
1111
Comment
Threaded comments and replies on videos
1063
Audio File Metadata
Audio file metadata and attachment events
1984
Report
Moderation and abuse reporting events
1985
Label
Content and moderation labels applied to events
10000
Mute List
Private list of muted users and content
10003
Bookmark List
User's saved content bookmarks
24242
Blossom Auth
Authentication events for Blossom file operations
27235
HTTP Auth
NIP-98 signed authorization events for HTTP requests
30000
Categorized People List
Addressable people list used for block lists when d=block
30003
Bookmark Set
Categorized bookmark collections with d-tag identifier
30005
Curation Set
Curated video playlists and collections
30023
Long-form Content
Addressable long-form text content and articles
31922
Calendar Event Date
NIP-52 date-based calendar event
31923
Calendar Event Time
NIP-52 time-based calendar event
31924
Calendar Collection
NIP-52 calendar collection and calendar set
31925
Calendar RSVP
NIP-52 RSVP response event
34235
Horizontal Video
Standard landscape video content
34236
Vertical Video
Short-form portrait video content
34237
Video Chapters
Chapter markers and timestamps for videos
34238
Collaborator Response
Addressable collaborator acceptance response for video credits

Nostr WebSocket Protocol

Nostr (Notes and Other Stuff Transmitted by Relays) is a decentralized protocol where clients connect to relays via WebSocket to publish and subscribe to events. Events are cryptographically signed JSON objects identified by the author's public key. Learn more about Nostr →

Connect to this relay

How it works

1
Connect — Open a WebSocket connection to the relay URL above
2
Subscribe — Send a REQ message with filters to receive matching events
3
Receive — Relay sends matching EVENT messages, then EOSE when history is complete
4
Publish — Send signed EVENT messages; relay responds with OK
5
Real-time — New events matching your subscriptions are pushed automatically

Client → Relay Messages

EVENT Publish a signed event to the relay for storage and broadcast ["EVENT", <signed event object>]
REQ Subscribe to events matching filters (by author, kind, tags, time, etc.) ["REQ", "sub-id", <filter1>, <filter2>, ...]
CLOSE Unsubscribe from a subscription by its ID ["CLOSE", "sub-id"]
COUNT Request a count of events matching filters (NIP-45) ["COUNT", "sub-id", <filter>]

Relay → Client Messages

EVENT An event matching your subscription ["EVENT", "sub-id", <event object>]
OK Acknowledgment after publishing (true = accepted, false = rejected with reason) ["OK", "event-id", true, ""]
EOSE End of Stored Events — all historical matches sent, now streaming live ["EOSE", "sub-id"]
NOTICE Human-readable message from relay (errors, warnings, info) ["NOTICE", "rate limited"]
COUNT Response to COUNT request with matching event count ["COUNT", "sub-id", <count result>]