Nostr Series — Part 1: A Gentle Introduction to Nostr

Michael Stewart
4 min readApr 15, 2024

--

What is Nostr?

Nostr is an open, decentralized, censorship-resistant messaging protocol, launched in November 2020 by Bitcoin Core developer FiatJaf. It continues a technological revolution that does not rely on centralized servers, instead leveraging distributed networks along with public key cryptography to give power back to users as opposed to reliance on trusting central entities and authorities such as corporations and governments. Nostr enables users of the network to communicate freely and securely, ushering in a new generation of privacy-centric messaging solutions.

Nostr, for freedom

Why Nostr?

In an era where digital communication has become ubiquitous, concerns over censorship, privacy, security and data sovereignty have become increasingly important. Centralized messaging platforms, such as Twitter, despite what these corporations themselves say, are failing to protect freedom of expression. Users may find themselves banned from platforms for expressing the wrong views, political or otherwise; user data is owned by corporations who can, and have been sharing it with other companies in order to profile and sell targeted advertisements. Data has also been given to governments to surveil, stifle and shut down dissent.

Nostr offers an alternative solution; a paradigm shift for how we communicate, share and own data in the digital sphere. There is no central, single point of control on the network. A server for communication (relay) can be set up by anyone on any set of infrastructure, creating a “whack-a-mole” type scenario for trying to shut down the network. The protocol fosters resilience and robustness in the face of adversity, where even if one node in the network is taken down or compromised, the system as a whole remains operational, ensuring uninterrupted communication.

It facilitates free speech and decentralization at it’s core, while the internet has become significantly more centralized with only a handful of major players dominating. Nostr represents a return to the initial ethos of a decentralized internet, building on top of a technological movement that empowers individuals, such as public key cryptography allowing true sovereignty over identity without any intermediary, and of course I would be amiss to leave out the trustless and censorship-resistant transfer of value with Bitcoin.

Architecture

The architecture of Nostr follows the publisher/subscriber messaging pattern and uses WebSockets for transport. It is incredibly simple to understand.

Nostr is an acronym for “Notes and Other Stuff Transmitted by Relays”. Users, generally through a client (eg. a front-end application) send to one or many relays through a common interface, such that all relays are able to accept and understand the messages, also referred to as events. A relay can simply be considered a server, or even more accurately a node on the network; they are very simple and require only some configuration to set them up.

Clients subscribe to any number of relays to receive new events posted to them. Since they all follow the same common protocol, they are all interoperable with each other, so one user could be posting a message on Client X (for instance a decentralized Twitter, let’s call it de-Twitter), which is received by another user on Client Y (de-Facebook) as well as Client Z (de-Instagram), given that they are all subscribed to the same relay.

Identity verification is performed using public key cryptography. Events are signed with a user’s private key, so that users on any client can immediately verify that a message is coming from who it says it does. Thus, private keys should be kept completely private and secure, consider it like a password. Private keys should never be sent to anyone, or exposed on any client. Public identification, such as tagging or addressing a user is achieved with the public key.

Source: https://github.com/nostr-protocol/nostr

Applications

Currently, a majority of the existing applications are social media clients similar to Twitter. However, the protocol is incredibly powerful and there is an increasing understanding that it can be utilized for far more than that. Many of these clients have integrations with Bitcoin Lightning Network for tipping users, enabling a tipping/transfer of value mechanism, that can also be fully sovereign/non-custodial via specific implementations (i.e., running your own lightning node).

Some popular Nostr social media applications are:

Some other applications outside of the realm of social media are:

  • Jester — play chess
  • Habla — long-form content, such as blog posts

What Next?

This series will not only conceptually cover the components of Nostr, but provide a practical guide for setting up a relay, a client as well as the ability to zap (tip) through the Bitcoin Lightning Network. They will be user guides as well as developer guides and intended to exist as living documents that may evolve as the ecosystem does.

The Nostr Protocol is still very much in it’s infancy, 3 and a half years is very new for an open protocol and thus much of the development and use cases for it can be considered exploratory and experimental. Nevertheless, the community is growing rapidly with more and more clients and innovative applications being built.

Like this post and want to support the series? Tip me some sats on lightning at mikkthemagnificent@getalby.com:

--

--