How named666/nostrogotho works
nostrogotho is a C99 Nostr relay: clients send WebSocket protocol messages, the relay validates and applies protocol policy, persists or queries events, then returns protocol responses. The documented NIP modules extend event handling with capabilities such as deletion, authentication, counts, and expiration. Main initializes crypto and SQLite before configuring the server. Source excerpts show the server and storage interfaces, but not all handler wiring; edges for unsampled NIP behavior follow README descriptions and are limited to documented dispatch and capability relationships.
Main entry points: nip_plugin.c Plugin dispatch · server.c Message dispatch · nip01.c Core event flow · storage.h Storage interface
Components 23
Runtime and transport
- Process setup
src/main.c - Relay server
src/server.c - WebSocket and HTTP
src/server.c - Message dispatch
src/server.c - Protocol responses
src/server.c
Protocol processing
- Core event flow
src/nips/nip01.c - Event and filters
src/nostrogotho.c - Plugin dispatch
src/nips/nip_plugin.c
NIP capabilities
- Deletion
src/nips/nip09.c - Relay information
src/nips/nip11.c - Proof of work
src/nips/nip13.c - Private messages
src/nips/nip17.c - Delegated signing
src/nips/nip26.c - Event expiration
src/nips/nip40.c - Client authentication
src/nips/nip42.c - Event counts
src/nips/nip45.c - Request to vanish
src/nips/nip62.c - EOSE completeness
src/nips/nip67.c
Persistence and crypto
- Signature checks
src/crypto.c - Storage interface
src/storage.h - SQLite event store
src/storage.c - SQLite engine
thirdparty/sqlite3.c
Other components
- Nostr clients
Connections 25
- Nostr clients → WebSocket and HTTP: send messages
- Process setup → Relay server: configure and run
- Relay server → WebSocket and HTTP: runs transport
- WebSocket and HTTP → Message dispatch: frames messages
- Message dispatch → Core event flow: dispatches events
- Message dispatch → Plugin dispatch: dispatches messages
- Core event flow → Signature checks: validates signatures
- Core event flow → Event and filters: processes events
- Core event flow → Plugin dispatch: dispatches handlers
- Core event flow → Storage interface: stores events
- Message dispatch → Storage interface: queries events
- Storage interface → SQLite event store: reads and writes
- SQLite event store → SQLite engine: uses engine
- Plugin dispatch → Deletion: dispatches NIP
- Plugin dispatch → Relay information: dispatches HTTP info
- Plugin dispatch → Proof of work: dispatches NIP
- Plugin dispatch → Private messages: dispatches NIP
- Plugin dispatch → Delegated signing: dispatches NIP
- Plugin dispatch → Event expiration: dispatches NIP
- Plugin dispatch → Client authentication: dispatches NIP
- Plugin dispatch → Event counts: dispatches NIP
- Plugin dispatch → Request to vanish: dispatches NIP
- Plugin dispatch → EOSE completeness: dispatches NIP
- Message dispatch → Protocol responses: sends responses
- Protocol responses → Nostr clients: returns messages