diff --git a/RIP-02.md b/RIP-02.md index 9ad4d50..dbaf0c9 100644 --- a/RIP-02.md +++ b/RIP-02.md @@ -1,23 +1,64 @@ # RIP-02: Node Listing -- [ ] Create PR to the Nostr repo to add a new Kind 40500 event +Nodes announce their presence and capabilities via Nostr events for client discovery, following NIP-91. -Nodes announce their presence and capabilities via a Nostr event for client discovery. +## Provider Information Event -**Kind**: 40500 +**Kind**: 38421 ```json { - "kind": 40500, + "kind": 38421, + "pubkey": "", "created_at": , + "content": "", "tags": [ - ["d", ""], // Unique node identifier - ["p", ""], - ["url", "https://..."], // Inference endpoint - ["onion", ""], // Tor hidden service endpoint - ], - "content": "Human-readable description" + ["d", ""], + ["u", "https://..."], // HTTP endpoint + ["u", ""], // Tor hidden service endpoint + ["models", "gpt-4o-mini", "gpt-4o", "claude-3-5-sonnet", "..."], + ["mint", "https://mint.example.com"], + ["version", "0.0.1"] + ] } ``` -Clients subscribe to Kind 40500, index by `d` tag, and override older listings with newer events. +### Model Capabilities (Optional) + +Providers MAY include additional tags to describe model-specific capabilities: + +```json +{ + "tags": [ + ["model-cap", "gpt-4o", "max_tokens:128000,vision:true,tools:true"], + ["model-cap", "claude-3-5-sonnet", "max_tokens:200000,vision:true,tools:true"] + ] +} +``` + +## Recommendation Event + +**Kind**: 38000 (as defined in NIP-87) + +```json +{ + "kind": 38000, + "pubkey": "", + "tags": [ + ["k", "38421"], + ["d", ""], + ["u", ""], + ["a", "38421:routstr-provider-pubkey:", "wss://relay1"] + ], + "content": "Fast and reliable AI proxy with great model selection" +} +``` + +## Discovery + +Clients can discover providers by: + +1. Querying for `kind:38000` events with `#k` filter for `38421` (recommendations) +2. Directly querying for `kind:38421` events (provider announcements) + +Provider events are replaceable by the `d` tag, with newer events overriding older listings.