pull down to refresh

A standards-compliant gateway to Primal's cache server

Antiprimal is a WebSocket proxy that exposes Primal's powerful caching infrastructure through standard Nostr protocol messages (NIPs), making Primal's enhanced features available to any Nostr client without proprietary extensions. It exposes Primal's powerful caching infrastructure through standard Nostr protocol messages (NIPs), making Primal's enhanced features available to any Nostr client without proprietary extensions.

The ProblemThe Problem

Primal offers excellent features like event statistics, search, and precomputed data through their cache server at wss://cache.primal.net/v1. However, accessing this data requires using Primal's proprietary message format with a special cache field, which isn't compatible with standard Nostr clients.

For example, to get statistics about an event, you need to send:

["REQ", "sub1", {"cache": ["events", {"event_ids": ["..."], "extended_response": true}]}]

This makes it impossible for standard Nostr clients to benefit from Primal's infrastructure.

The SolutionThe Solution

Antiprimal acts as a translation layer that:

  1. Accepts standard Nostr messages (NIP-01, NIP-11, NIP-45 COUNT, NIP-50 search)
  2. Routes intelligently:
    • COUNT queries → Primal cache server (translated)
    • Search queries (NIP-50) → Primal cache server (translated)
    • Standard queries → Primal relay (wss://relay.primal.net)
  3. Translates responses back to standard Nostr format
  4. Filters out proprietary events (kinds 10000000-10999999)
  5. Provides relay information via NIP-11 for client discovery

Read more on the repo: https://gitlab.com/soapbox-pub/antiprimal

Cool to see! Thanks for the write up on this.

reply