Background

Nostr: Notes and Other Stuff Transmitted by Relays [1] is an open source protocol for censorship-resistant social media. Users maintain public key - private key pairs and use the Schnorr signature standard for digital signatures and encodings. Content is stored in objects called events (a.k.a. notes) which are signed and broadcast to relays which act as the backend servers for Nostr. Relays transmit events with users, with clients, and with each other via websockets following the protocol specified in NIP-01 (Nostr Implementation Possibility-01: Basic Protocol) [2].

Most Nostr relays store events using relational databases or key-value databases such as LMDB. However, as of Nov 2025, no native graph database nostr relays have been built. This is unfortunate, given the performance advantages of native graph databases in social graph analysis. This prompts us at NosFabrica to construct a fully NIP-01 compliant, native graph database nostr relay based on neo4j. This document provides an overview of a proposed data model [3] for a neo4j nostr relay.

The primary function of this data model is to provide support for NIP-01. However, it also provides support for Follow Lists (NIP-02), Mute Lists (NIP-51), Reports (NIP-56), Replies (NIP-10), Reactions (NIP-25), Reposts (NIP-18), Comments (NIP-22), and Trusted Assertions (NIP-85) [4].

Data Model

Node labels

Relationship types

Properties

See graph below.