Nostr Node Discovery
Implementation guidelines for node discovery and service announcement using Nostr events for decentralized client discovery.
Node Discovery Overview
Nodes announce their presence and capabilities via Nostr events for client discovery. This mechanism enables decentralized service discovery without relying on centralized registries or DNS-based systems.
Node Announcement Event
Kind: 40500
Service providers publish announcement events using Kind 40500 to make their services discoverable by clients through the Nostr network.
Event Structure:
{
"kind": 40500,
"created_at": <unix-timestamp>,
"tags": [
["d", "<node-id>"], // Unique node identifier
["p", "<operator-pubkey>"], // Operator's public key
["url", "https://..."], // Inference endpoint
["onion", "<tor-onion-address>"] // Tor hidden service endpoint
],
"content": "Human-readable description"
}Implementation Guidelines
For Service Providers:
- Publish announcement events regularly to maintain visibility
- Use consistent node-id across announcements for the same service
- Include both clearnet and Tor endpoints when available
- Provide meaningful descriptions in the content field
- Sign events with the operator's private key for verification
For Clients:
- Monitor multiple relays for node announcements
- Verify operator signatures before trusting announcements
- Cache discovered nodes and their capabilities
- Implement fallback mechanisms for service discovery
- Respect privacy preferences (clearnet vs Tor)