Nostr Relays Explained: Complete Guide
Understanding Nostr relays - how they work, types of relays, choosing the right relays, and the role they play in the decentralized protocol.
Introduction
Relays are the backbone of Nostr. They store and distribute your messages, yet they don’t control your identity or content. Understanding relays—how they work, why they matter, and how to choose them—is essential to using Nostr effectively.
This guide explains everything about Nostr relays: from basic concepts to advanced selection strategies.
What Are Relays?
The Simple Explanation
A relay is a server that:
- Accepts events (posts, messages, reactions) from users
- Stores those events in a database
- Distributes events to other users who request them
That’s it. Relays are deliberately simple.
What Relays Are NOT
Relays are not:
- ❌ Platforms (they don’t own your identity)
- ❌ Services (they don’t provide accounts)
- ❌ Social networks (they don’t create communities)
- ❌ Authorities (they can’t change your content)
Relays are merely:
- ✅ Message storage and distribution servers
- ✅ Dumb pipes (they don’t interpret content)
- ✅ Infrastructure (neutral, replaceable)
The Email Analogy
Think of relays like email servers:
Email:
- You have an email address (
you@example.com) - Email servers (Gmail, Outlook, etc.) store and route your messages
- You can send email to anyone on any email server
- If Gmail goes down, you can still receive email at other providers
Nostr:
- You have a public key (npub)
- Relays store and route your events
- You can publish to any relay and be read from any relay
- If one relay goes down, you’re still on other relays
Key Difference: With email, your address is tied to a provider. With Nostr, your identity is independent of any relay.
How Relays Work
The Technical Flow
Publishing (You → Relay):
- You write a post in your client
- Client creates an event (JSON)
- Client signs event with your private key
- Client sends signed event to your relays
- Relays verify signature
- Relays store event
- Relays return “OK” or “error”
Subscribing (Relay → You):
- Your client subscribes to events from relays
- Client sends filter (e.g., “events from these pubkeys”)
- Relays find matching events
- Relays send events to your client
- Client verifies signatures
- Client displays events to you
Event Structure
Every interaction on Nostr is an event sent to relays:
{
"id": "event_hash_here",
"pubkey": "your_pubkey_here",
"created_at": 1674055201,
"kind": 1,
"tags": [],
"content": "Hello Nostr!",
"sig": "signature_here"
}
Components:
- id: Unique event identifier (hash)
- pubkey: Your public key (who created it)
- created_at: Unix timestamp
- kind: Event type (1 = note, 4 = DM, 7 = reaction, etc.)
- tags: Additional metadata (references, replies, mentions)
- content: The actual message
- sig: Cryptographic signature
What Relays Store
Relays typically store:
Events (primary data):
- Short text notes (kind:1)
- Long-form content (kind:30023)
- Direct messages (kind:4, encrypted)
- Reactions (kind:7)
- Reposts (kind:6)
- Profile metadata (kind:0)
- Contact lists (kind:3)
- Many other event types (NIPs define them)
Relay Databases:
- Events indexed by author, timestamp, kind, tags
- Queryable via subscriptions
- Retention policies vary by relay
What Relays Cannot Do
Relays cannot:
- ❌ Change your event content (signature would break)
- ❌ Forge events from you (they don’t have your private key)
- ❌ Delete your events from other relays (only their own)
- ❌ Ban your identity (you can use different relays)
- ❌ Control the network (relays are independent)
Relays can:
- ✅ Refuse to store your events (their choice)
- ✅ Delete events they previously stored
- ✅ Block your IP address
- ✅ Rate-limit your requests
- ✅ Charge for access (paid relays)
- ✅ Have moderation policies
Types of Relays
Relays come in different types serving different purposes.
Public Relays (Free)
Characteristics:
- Open to everyone
- No cost to use
- Funded by donations or operators
- Variable retention policies
- May have content policies
Popular Public Relays:
wss://relay.damus.io- Popular, well-maintainedwss://relay.nostr.band- Aggregation and search featureswss://nos.lol- Community-runwss://relay.snort.social- Associated with Snort clientwss://nostr.wine- Reliable, moderate policies
Advantages:
- ✅ Free
- ✅ Easy to join
- ✅ Large user base
- ✅ Good for beginners
Disadvantages:
- ❌ May be overcrowded
- ❌ Variable uptime
- ❌ Limited support
- ❌ May shut down unexpectedly
- ❌ Uncertain retention policies
Paid Relays (Subscription)
Characteristics:
- Require payment (Lightning, credit card)
- Subscription model (monthly/annual)
- Usually better uptime and performance
- Often better retention
- Customer support sometimes available
Popular Paid Relays:
wss://relay.nostr.wine(freemium, paid tiers)wss://eden.nostr.land(subscription)wss://nostr.land(paid features)wss://relay.damus.io(Damus Purple subscription)
Typical Costs: £3-10/month
Advantages:
- ✅ Better uptime/reliability
- ✅ Defined retention policies
- ✅ Customer support
- ✅ Sustainable business model
- ✅ Often faster performance
- ✅ Sometimes spam filtering
Disadvantages:
- ❌ Costs money
- ❌ Requires payment setup
- ❌ May require identity (email)
- ❌ Still can shut down
Specialized Relays
Relays focused on specific purposes or communities.
Types:
1. Media Relays:
- Optimized for image/video hosting
- Large storage capacity
- Example:
wss://nostr.build
2. Geographic Relays:
- Focused on specific regions/languages
- Local content prioritization
- Example: Various country-specific relays
3. Topic-Based Relays:
- Bitcoin-focused, art, specific communities
- Curated content
- Niche audiences
4. Private Relays:
- Invite-only or whitelist-based
- Small communities
- High trust, low spam
- Often self-hosted
5. Onion Relays:
- Tor hidden services (.onion addresses)
- Privacy-focused
- Slower but anonymous
- Example: Some relays offer both clearnet and onion addresses
6. Read-Only Relays:
- Archive/search services
- Don’t accept new events
- Useful for historical data
- Example: Some nostr.band relays
Self-Hosted Relays
Running your own relay gives ultimate control.
Why Run Your Own:
- Complete control over data
- Guaranteed availability (as long as you maintain it)
- Privacy (you control logs)
- Backup of your own content
- Can host for community/family
Relay Software Options:
1. strfry (Recommended):
- Written in C++
- Extremely fast and efficient
- Low resource requirements
- Easy to configure
- Most popular relay implementation
2. nostream:
- Written in TypeScript
- PostgreSQL database
- Good for developers familiar with Node.js
3. relayer (Rust):
- Written in Rust
- Performance-focused
- SQLite backend
Self-Hosting Requirements:
- VPS or server ($5-20/month)
- Domain name (optional, can use IP)
- Basic Linux knowledge
- SSL certificate (Let’s Encrypt free)
- Maintenance time
Choosing Your Relays
Relay selection significantly impacts your Nostr experience.
How Many Relays?
Recommended Range: 5-10 relays
Too Few (1-3):
- Single points of failure
- Limited reach (fewer people see your posts)
- Reduced redundancy
Optimal (5-10):
- Good redundancy
- Wide distribution
- Acceptable performance
- Manageable
Too Many (15+):
- Slower client performance
- Redundant (diminishing returns)
- More attack surface
Selection Criteria
1. Uptime and Reliability:
- Check relay monitoring services (nostr.watch)
- Look for >99% uptime
- Established relays with history
2. Retention Policy:
- How long do they keep events?
- Do they archive everything?
- Clear policy statements?
3. Geographic Diversity:
- Mix relays from different countries
- Reduces legal/jurisdictional risk
- Better geographic coverage
4. Operator Reputation:
- Known operators vs. anonymous
- Community trust
- Transparency
5. Speed and Performance:
- Low latency
- Fast response times
- Adequate bandwidth
6. Content Policies:
- Moderation approach
- What content is blocked (if any)
- Spam filtering
7. Privacy Considerations:
- Logging policies
- Jurisdiction
- Tor support
Recommended Relay Mix
Balanced Setup (for most users):
Core General Relays (3-4):
- Large, reliable, public relays
- Examples: relay.damus.io, nos.lol, relay.snort.social
Paid Relay (1):
- Better performance and retention
- Sustainable model
- Example: nostr.wine (paid tier)
Specialized Relay (1-2):
- Based on your interests
- Geographic, topic, or community-focused
Personal Backup (Optional):
- Your own relay (if self-hosting)
- Guarantees your content persists
Geographic Consideration:
- If you’re UK-based, include European relays
- Mix with US and global relays for diversity
Where to Find Relay Lists
Resources:
-
nostr.watch:
- Real-time relay monitoring
- Uptime statistics
- Performance metrics
- Filter by features
-
Client Defaults:
- Most clients suggest good starting relays
- Damus, Amethyst, Snort have curated lists
-
Community Recommendations:
- Ask in Nostr communities
- Follow relay operator accounts
- Check what established users recommend
-
Relay Directories:
- Some clients have built-in relay browsers
- Shows relay features and policies
Managing Your Relays
Adding Relays
In Most Clients:
-
Open Settings → Relays
-
Add relay URL (format:
wss://relay.example.com) -
Choose read/write permissions:
- Read: Get events from this relay
- Write: Publish events to this relay
- Both: Default for most
-
Save
Read vs. Write Permissions:
Read-Only:
- Use for archive/search relays
- Large public relays where you don’t need to publish
- Reduces publishing load
Write-Only:
- Rare use case
- Publishing to backup relay without reading
Both (Recommended Default):
- Most relays should be both
- Maximum utility
Testing Relays
Before committing, test:
-
Connection Test:
- Can client connect?
- SSL/TLS working?
- WebSocket established?
-
Publish Test:
- Post a test note
- Verify it appears on relay
- Check from different client
-
Speed Test:
- How fast do events load?
- Latency acceptable?
- Feed refresh speed
-
Reliability Test:
- Is it consistently available?
- Check nostr.watch uptime
Regular Relay Maintenance
Monthly Review:
-
Check Uptime:
- Visit nostr.watch
- Remove relays with poor uptime
-
Performance:
- Are some relays slow?
- Replace laggy relays
-
Relevance:
- Still serving your needs?
- Better alternatives available?
-
Geographic/Political Changes:
- Policy changes?
- Jurisdiction concerns?
Update When:
- Relay frequently offline
- Performance degraded
- Policy changes you disagree with
- Better relays available
- Operator communication stops
Advanced Relay Topics
Relay-Based Discovery
Relays influence whose content you see.
How It Works:
- You see events from people on relays you read from
- If you don’t share relays with someone, you won’t see their content
- “Relay overlap” determines network effects
Example:
- You use relays A, B, C (reading)
- Alice posts to relays B, C, D
- You’ll see Alice’s posts (overlap: B and C)
- Bob posts only to relay E
- You won’t see Bob’s posts (no overlap)
Implication: Relay choice affects your “social graph reach”
NIP-65 Relay Lists
NIP-65 defines relay list metadata:
Purpose: Publish your relay preferences in an event
How It Works:
- You publish a kind:10002 event listing your relays
- Other clients can read this
- They know where to find your content
- Improves discoverability
Benefit: Even if clients have different default relays, they can find your events by checking your relay list.
Relay Hints
When sharing events or profiles, you can include relay hints:
Format (NIP-19):
nevent1... (event with relay hints)
nprofile1... (profile with relay hints)
Purpose: Tell others where to fetch the referenced content
Example: “Here’s an interesting post” + relay hint → Other person’s client knows where to find it
Outbox Model (NIP-65)
Concept: Separate relays for reading (inbox) and writing (outbox)
Inbox Relays:
- Where you check for mentions, DMs, replies
- Optimized for receiving
Outbox Relays:
- Where you publish your content
- People following you read from here
Benefits:
- Specialization
- Better scalability
- Load distribution
Status: Emerging pattern, growing client support
Relay Economics
Why Relays Exist
Motivations for Running Relays:
-
Community Service:
- Supporting the protocol
- Altruism
- Ideological commitment
-
Business Model:
- Paid subscriptions
- Services built on relay infrastructure
- Data/analytics (ethically questionable)
-
Personal Use:
- Backup of own content
- Hosting for friends/family
- Privacy/control
-
Integration:
- Businesses integrating Nostr
- Relay as part of larger service
Sustainability Concerns
Free Relay Challenges:
- Storage costs increase over time
- Bandwidth costs
- Maintenance time
- Spam management
- No revenue model
Many free relays shut down. This is normal and expected.
Paid Relays offer sustainability:
- Predictable revenue
- Better alignment (users are customers)
- Higher quality service
- Long-term viability
Recommendation: Support the protocol by subscribing to at least one paid relay.
UK-Specific Relay Considerations
Jurisdiction and the Online Safety Act
Implications:
- UK-based relays may face regulatory pressure
- Global relays outside UK jurisdiction largely unaffected
- Content moderation expectations differ by jurisdiction
Strategy for UK Users:
- Diversify across jurisdictions (don’t use only UK relays)
- Include relays in privacy-friendly countries
- Understand UK-based relays may moderate more heavily
UK Relays
Currently Limited:
- Few UK-specific relays exist
- Most UK users use global relays
- Opportunity for UK relay operators
Potential Benefits of UK Relays:
- Lower latency for UK users
- Local community focus
- UK time zone optimized
Common Relay Problems
Problem: “Relay Not Connecting”
Causes:
- Relay offline
- Incorrect URL
- SSL certificate issue
- Firewall blocking
Solutions:
- Check URL format (
wss://notws://) - Test on nostr.watch
- Try different network
- Check client logs
Problem: “My Posts Aren’t Seen”
Causes:
- Low relay overlap with followers
- Relay offline when you posted
- Followers not using relays you publish to
Solutions:
- Use more popular relays
- Check relay uptime
- Publish NIP-65 relay list
- Ask followers which relays they use
Problem: “Slow Feed Loading”
Causes:
- Too many relays
- Slow relays
- Poor internet connection
- Client inefficiency
Solutions:
- Reduce relay count to 5-10
- Remove slow relays
- Use paid relays (often faster)
- Try different client
Problem: “Spam in Feed”
Causes:
- Public relays with no spam filtering
- Following accounts that are spammy
Solutions:
- Use paid relays (often better spam filtering)
- Mute/block spam accounts
- Choose relays with moderation policies
- Use clients with built-in spam detection
Relay Checklist
For Beginners
- Using 5-7 relays
- Mix of popular public relays
- At least one paid relay (if affordable)
- All relays tested and connecting
- Understanding read/write permissions
- Periodic uptime checks
For Intermediate Users
- Geographic diversity (multiple countries)
- NIP-65 relay list published
- One specialized relay matching interests
- Regular relay performance review
- Using relay monitoring tools
- Privacy-conscious relay selection
For Advanced Users
- Self-hosted relay (optional)
- Outbox model implementation
- Strategic relay selection based on network
- Onion relay for privacy use cases
- Understanding relay economics
- Supporting relay operators financially
Conclusion
Relays are Nostr’s infrastructure—the neutral, replaceable servers that make the network work. They’re deliberately simple, which makes the protocol resilient.
Key Takeaways:
- Relays are simple: Store and forward events, nothing more
- Relays don’t control you: Your identity is independent
- Choose relays strategically: 5-10 diverse, reliable relays
- Expect relay churn: Relays come and go, this is normal
- Support paid relays: Sustainability matters
- Geographic diversity: Don’t rely on one jurisdiction
Your relay choices directly impact:
- Who sees your content (reach)
- Whose content you see (discovery)
- Your privacy (jurisdiction, logs)
- Your censorship resistance (diversity)
Choose wisely, diversify, and review regularly.
Further Resources
- Nostr Relay Directory - Browse and choose relays
- How Nostr Works - Understanding the protocol
- Getting Started - Beginner setup including relay selection
- nostr.watch - Real-time relay monitoring
- NIP-01 - Basic protocol and relay communication
- NIP-65 - Relay list metadata
Remember: Relays are infrastructure, not platforms. Treat them as interchangeable utilities, not permanent homes. 🔄