Skip to content

mmalmi/nostr-social-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

193 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ask DeepWiki

Nostr Social Graph

Main development is on decentralized git: htree://npub1xdhnr9mrv47kkrn95k6cwecearydeh8e895990n3acntwvmgk2dsdeeycm/nostr-social-graph

A TypeScript library for building and querying social graphs from Nostr follow events.

Features

  • Build social graphs from Nostr follow events
  • Query followed users, followers, and follow distances
  • Change social graph root user with efficient distance recalculation
  • Low memory consumption
  • Efficient binary serialization (55% smaller than JSON)
  • Pre-crawled datasets
  • Server for maintaining and serving the up-to-date social graph, for quick initialization in web apps

Usage

See tests for detailed usage examples.

Demo & API

To point the examples search at a hashtree index, set VITE_PROFILE_SEARCH_INDEX=nhash1qqsgm4ex4d4dxgz39hj6q7t7ax7u4k57gp2zkjuxtfga7wpw6dy6xpg9yqu6y09zecw9hzettkaulu928dt58ndt0h2exw6qg5kxyrprucz0cukym2c (and optionally VITE_BLOSSOM_SERVERS=url1,url2). Latest published profile search index (2025-01-23): nhash1qqsgm4ex4d4dxgz39hj6q7t7ax7u4k57gp2zkjuxtfga7wpw6dy6xpg9yqu6y09zecw9hzettkaulu928dt58ndt0h2exw6qg5kxyrprucz0cukym2c. To publish the profile search index to Blossom, run BLOSSOM_NSEC=... yarn publish-profile-index.

Core Implementation

The TypeScript implementation lives in SocialGraph.ts, and the Rust workspace lives under rust/.

The Rust workspace now has two interchangeable backends:

Both Rust backends implement the shared SocialGraphBackend runtime trait from the core crate.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors