Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sandwichfarm/nostr-watch/llms.txt

Use this file to discover all available pages before exploring further.

NIP-66 relay monitoring events use a defined set of tags to encode relay health, capabilities, and metadata. This page documents every tag used across the three NIP-66 event kinds: kind 10166 (monitor announcement), kind 30166 (relay status), and kind 1066 (relay status delta). For background on the event kinds themselves, see NIP-66 event kinds.

Kind 10166 tags — Monitor Announcement

These tags appear in kind 10166 events published by monitors to describe their configuration and capabilities.
TagValuesRequiredDescription
frequencyseconds, e.g. 3600YesHow often this monitor checks relays
nclearnet, tor, i2pYesNetworks this monitor covers — one tag per network
copen, read, write, ssl, dns, geo, infoYesCheck types performed — one tag per check type
timeoutcheck name + ms, e.g. open, 5000NoTimeout for the named check (multi-value tag)
kkind number, e.g. 30166NoEvent kinds this monitor publishes
ggeohash, e.g. u4pruydNoGeohash of the monitor’s physical location
frequency
string
required
Check interval in seconds as a string. A monitor with ["frequency", "3600"] checks relays every hour. Use this to determine how stale monitor data may be.
n
string
required
Network type the monitor covers. One tag per network. Valid values: clearnet, tor, i2p.
c
string
required
Check type performed. One tag per check. Valid values:
  • open — can the monitor open a WebSocket connection?
  • read — does the relay respond to REQ messages?
  • write — does the relay accept EVENT messages?
  • ssl — is the TLS certificate valid?
  • dns — does the hostname resolve?
  • geo — what is the relay’s geographic location?
  • info — what does the NIP-11 info document say?
timeout
string
Multi-value tag. First value is the check name; second is the timeout in milliseconds as a string. Example: ["timeout", "open", "5000"].
k
string
Event kinds this monitor publishes as a result of its checks. Typically 30166 and optionally 1066.
g
string
Geohash of the monitor’s physical location. Used for geographic coverage analysis. Longer geohashes indicate more precision.

Kind 30166 tags — Relay Status

These tags appear in kind 30166 events, which are the primary relay status events. One event exists per (relay URL, monitor pubkey) pair.
TagValuesRequiredDescription
drelay URLYesAddressable identifier — makes this event parameterized replaceable
rrelay URLYesQueryable relay URL (used in #r filter)
nclearnet, tor, i2pYesNetwork type of this relay
Rcapability flagNoRelay capability/requirement flag (see R tag below)
rtt-openmillisecondsNoRound-trip time for WebSocket open in ms
rtt-readmillisecondsNoRound-trip time for read check in ms
rtt-writemillisecondsNoRound-trip time for write check in ms
NNIP numberNoSupported NIP — one tag per NIP
kkind numberNoSupported event kind — one tag per kind, max 21
phex pubkeyNoRelay operator pubkey (from NIP-11)
ssoftware nameNoRelay software name (from NIP-11 software field)
LnamespaceNoLabel namespace declaration (NIP-32)
lvalue + namespaceNoLabel value in the declared namespace (NIP-32)
d
string
required
The relay’s WebSocket URL. Serves as the d tag for parameterized replaceability: only the most recent event per (pubkey, d tag) is retained on relays.
r
string
required
The relay’s WebSocket URL, also stored as a queryable r tag. Use #r in REQ filters to match this tag.
n
string
required
Network type of the relay being monitored. One of clearnet, tor, or i2p.
R
string
Relay capability flag. Values without a ! prefix are active; values with ! are not active.
ValueMeaning
openAccepted a WebSocket connection
readResponded to REQ
writeAccepted EVENT
sslTLS certificate is valid
authRequires NIP-42 auth
paymentRequires payment
powRequires proof of work
!authDoes not require auth
!paymentDoes not require payment
!powDoes not require proof of work
rtt-open
string
Round-trip time for the WebSocket open check in milliseconds, as a string. Example: ["rtt-open", "120"].
rtt-read
string
Round-trip time for the read check in milliseconds, as a string.
rtt-write
string
Round-trip time for the write check in milliseconds, as a string.
N
string
A NIP number supported by this relay, as a string. One tag per NIP. Example: ["N", "42"]. Query with '#N': ['42'].
k
string
An event kind supported by this relay, as a string. One tag per kind, with a maximum of 21 kinds listed. Example: ["k", "1"].
p
string
The relay operator’s Nostr pubkey in hex, sourced from the NIP-11 info document’s pubkey field.
s
string
The relay software name sourced from the NIP-11 software field. Examples: strfry, nostr-rs-relay, nostream.
L
string
NIP-32 label namespace declaration. Paired with one or more l tags that declare values in this namespace. Example: ["L", "ISO-639-1"].
l
string
NIP-32 label value in a declared namespace. Two values: the label and the namespace. Example: ["l", "en", "ISO-639-1"]. Also used for NIP-66 version labeling: ["l", "draft7", "nip66.draft"].

Kind 1066 tags — Relay Status Delta

Kind 1066 events use a subset of kind 30166 tags. Only tags that changed since the last status event are included.
TagValuesDescription
rrelay URLWhich relay this delta applies to
Rcapability flagsChanged requirement/capability flags
rtt-openmillisecondsChanged open latency
rtt-readmillisecondsChanged read latency
rtt-writemillisecondsChanged write latency
NNIP numberChanged NIP support

Content field by kind

KindContentFormat
10166Empty string
30166NIP-11 info documentJSON string — parse with JSON.parse()
1066Empty or partial NIP-11 diffJSON string
The kind 30166 content contains the relay’s self-reported NIP-11 information document. Always validate and sanitize this data — it comes from the relay operator, not the monitor.
// Parsing the NIP-11 content from a kind 30166 event
function parseRelayInfo(event) {
  if (!event.content) return null
  try {
    return JSON.parse(event.content)
  } catch {
    return null // Content may be empty or invalid JSON
  }
}

const info = parseRelayInfo(event)
if (info) {
  console.log('Software:', info.software)
  console.log('Supported NIPs:', info.supported_nips)
  console.log('Limitation:', info.limitation)
}

REQ filter patterns

NIP-01 REQ filters support tag matching with the #<tag-letter> syntax. Tag filter values are always strings, even when the tag contains a number.
// Filter by network
{ kinds: [30166], '#n': ['clearnet'] }

// Filter by capability flags
{ kinds: [30166], '#R': ['!auth', '!payment'] }

// Filter by NIP support
{ kinds: [30166], '#N': ['42'] }

// Filter by software
{ kinds: [30166], '#s': ['strfry'] }

// Filter by relay URL (d tag)
{ kinds: [30166], '#d': ['wss://relay.damus.io'] }

// Filter by relay URL (r tag, queryable in 1066)
{ kinds: [1066], '#r': ['wss://relay.damus.io'] }

// Combine multiple filters (AND logic)
{
  kinds: [30166],
  '#n': ['clearnet'],
  '#R': ['!auth'],
  '#N': ['42'],
  '#s': ['strfry'],
}
Multiple values within a single tag filter use OR logic: '#n': ['clearnet', 'tor'] matches events with either clearnet or tor. Multiple separate tag filters use AND logic: '#n': ['clearnet'], '#R': ['!auth'] matches events that are clearnet and do not require auth.

Build docs developers (and LLMs) love