antiprimal

A Primal to Nostr bridge

Antiprimal is a standards-compliant gateway to Primal's cache server. 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.

NIP-45 COUNT Queries

Get event statistics using standard COUNT messages. Query reactions, replies, reposts, zaps, followers, and more:

Count reactions on an event (kind 7)
["COUNT", "sub1", {"kinds": [7], "#e": ["<event-id>"]}]
Response: ["COUNT", "sub1", {"count": 76}]
Count replies (kind 1)
["COUNT", "sub2", {"kinds": [1], "#e": ["<event-id>"]}]
Response: ["COUNT", "sub2", {"count": 128}]
Count followers (kind 3)
["COUNT", "sub3", {"kinds": [3], "#p": ["<pubkey>"]}]
Response: ["COUNT", "sub3", {"count": 1523}]
Count notes by author (kind 1)
["COUNT", "sub4", {"kinds": [1], "authors": ["<pubkey>"]}]
Response: ["COUNT", "sub4", {"count": 13672}]

NIP-50 Search

Search for content using standard search filters. Antiprimal routes search queries to Primal's cache and returns standard Nostr events:

Search for "bitcoin"
["REQ", "search1", {"search": "bitcoin", "limit": 20}]
Returns up to 20 standard Nostr events matching "bitcoin"

NIP-85 Trusted Assertions

Antiprimal provides access to Primal's Web of Trust calculations through NIP-85 Trusted Assertions. A NIP-85 bot (npub19qs86y2dasgyd3q2m8v0tvkcdc8ywrjvplp4wwwpweul42xlg56qxjh3jt) publishes kind 30382 and 30383 events containing computed stats and metrics from Primal's server.

Kind 30382: User Statistics
["REQ", "user-stats", {"kinds": [30382], "authors": ["28207d114dec1046c40ad9d8f5b2d86e0e470e4c0fc35739c17679faa8df4534"]}]
Returns user metrics like follower count and rank:
{
  "kind": 30382,
  "tags": [
    ["d", "<user-pubkey>"],
    ["followers", "6160"],
    ["rank", "6160"]
  ],
  ...
}
Kind 30383: Event Engagement
["REQ", "event-stats", {"kinds": [30383], "authors": ["28207d114dec1046c40ad9d8f5b2d86e0e470e4c0fc35739c17679faa8df4534"]}]
Returns event engagement metrics:
{
  "kind": 30383,
  "tags": [
    ["d", "<event-id>"],
    ["rank", "7472527464"],
    ["comment_cnt", "3"],
    ["repost_cnt", "3"],
    ["reaction_cnt", "5"],
    ["zap_cnt", "1"],
    ["zap_amount", "22"]
  ],
  ...
}

These assertion events are continuously updated by Primal's infrastructure, providing real-time stats for users and events. Learn more about NIP-85 Trusted Assertions.

Frequently Asked Questions

Q: Who is this for?
A: This is primarily for Nostr developers who want to leverage Primal's caching infrastructure through standard Nostr protocols. It's not intended as an end-user product, but rather as a developer tool and gateway service.
Q: Why is it called "Antiprimal"? Do you hate Primal?
A: Not at all! The name is tongue-in-cheek. We love Primal's infrastructure! But we want it to be accessible through anti-proprietary, standards-compliant interfaces. This gateway makes Primal's powerful features available to the entire Nostr ecosystem.
Q: Where can I learn more?
A: Check out the documentation for detailed API information and examples.