Skip to content
Melvin Carvalho edited this page May 13, 2023 · 2 revisions

Nostr Algorithms

The Nostr protocol provides a rich ground for developing a variety of algorithms that can enhance the user experience by customizing the content delivery based on specific user preferences, temporal relevance, or trending topics. This article provides a brief overview of some hypothetical and abstract algorithms that could be implemented in the Nostr ecosystem.

Note: The algorithms mentioned here are not exhaustive, and they do not constitute a recommendation for implementation. Their purpose is merely illustrative, to demonstrate the potential of the Nostr platform. Any algorithm should go through the approval process detailed in the Nostr Improvement Proposal.

Hypothetical but Relatively Concrete Algorithms

These algorithms provide basic sorting and filtering capabilities based on a single dimension:

  1. Created_at in descending order - "I want to see the newest events"
  2. Created_at in ascending order - "I want to see the oldest events"
  3. Sum(zap amount) in descending order - "I want to see the events earning the most money"
  4. Sum(reactions) in descending order - "I want to see events with the most reactions"
  5. Sum(comments) in descending order - "I want to see events with the most comments"
  6. Sum(followers) in descending order - "I want to see people with the most followers"
  7. Content_contains("some string") - "I want to see events with this string in this field"

More Advanced Algorithms

These algorithms provide more complex sorting capabilities, allowing for combinations of the basic algorithms and incorporating a time decay factor:

  1. Arbitrary combinations of the naive algorithms - e.g., sum(zap amount)+sum(reactions)+sum(comments)
  2. Any naive algorithm (or combination) with a time decay - e.g., "I want the most zapped events with a bias toward the most recent"

Complex Algorithms

These algorithms introduce personalized weighting based on a user's following graph or the use of a TrustRank like algorithm:

  1. The advanced algorithms weighted by my following graph
  2. The advanced algorithms but weighted by a TrustRank-like algorithm

Abstract but "Real World" Algorithms

These are algorithms that are commonly found in major social media applications. They aim to deliver the most relevant and important content to the user:

  1. Algorithmic feed - This aims to distill subjective and recent signal.
  2. Trending topics/events/stories - This delivers what's happening now that the user might be interested in.
  3. Who/What to follow - This provides recommendations for things the user might want to see more of.

Existing Algorithms in Nostr

Several centralized services already provide algorithmic sorting and recommendation capabilities within the Nostr network:

  1. Nostr.band - Provides trending and discovery features.
  2. Primal.net - Provides trending and discovery features.
  3. Zaplife.lol - Provides a unique and somewhat mysterious algorithmic experience.

Summary

As Nostr continues to grow and evolve, the implementation of algorithms can greatly enhance the user experience by providing customized, relevant, and engaging content. Even in a Nostr world with topic-based relays, the implementation of basic algorithms can empower users and democratize the content delivery process.

For more details about the Nostr algorithms, please refer to the source here.

Clone this wiki locally