Discovery¶
Routstr uses Nostr as a decentralized directory for service discovery. Your node announces its presence, models, and pricing on Nostr relays, allowing clients to find you without a central server.
How It Works¶
- Provider Advertisement (Kind 38421): Your node periodically publishes an event with its URL, models, and pricing
- Client Discovery: Clients query relays for these events to find suitable providers
Configuration¶
Configure discovery in Dashboard → Settings → Nostr.
Required Settings¶
| Field | Description |
|---|---|
| Npub | Your node's public identity (clients use this to verify your node) |
| Nsec | Your node's private key (used to sign advertisements) |
| Relays | Where to publish your announcements |
Default Relays¶
If not configured, Routstr publishes to:
wss://relay.damus.iowss://relay.nostr.bandwss://nos.lol
Advertisement Format¶
Your node publishes events like:
{
"kind": 38421,
"content": {
"name": "My Routstr Node",
"description": "Fast GPT-4 access via Lightning",
"endpoints": {
"http": "https://api.mynode.com",
"onion": "http://xyz...onion"
},
"models": ["gpt-4", "claude-3-opus"],
"pricing": { ... }
},
"tags": [
["d", "routstr-provider"],
["g", "US"]
]
}
Tor Integration¶
If you're running with Tor (see Tor Support), your .onion address is automatically included in announcements. This allows clients to connect anonymously.
Verify Your Announcements¶
Check if your node is broadcasting:
- Copy your
Npub - Search on Nostr.band or Primal
- Look for Kind 38421 events
Generating Keys¶
If you don't have a Nostr identity:
- Use any Nostr client (e.g., Primal, Damus)
- Create an account
- Export your keys (npub and nsec)
- Enter them in the dashboard
Or generate keys programmatically:
from nostr_sdk import Keys
keys = Keys.generate()
print(f"npub: {keys.public_key().to_bech32()}")
print(f"nsec: {keys.secret_key().to_bech32()}")