Nostr: An Open Protocol for Censorship-Resistant Applications and Decentralized Communication

Nostr: An Open Protocol for Censorship-Resistant Applications and Decentralized Communication
This article is available in Arabic اقرأ بالعربية

The Problem with Centralized Platforms

In an era dominated by centralized social media platforms, users pay a heavy price for the free service: their data, their privacy, and their freedom of expression. Algorithms control what they see, their accounts can be deleted at any moment without warning, and the larger the platform grows, the more power it has to impose its rules and policies.

These issues have driven a search for alternatives, but most simply reproduced the same centralized model. This is where Nostr comes in.

🔗 Official Protocol Repository: github.com/nostr-protocol/nostr 🔗 NIPs Repository: github.com/nostr-protocol/nips

What Is Nostr?

Nostr is an open, simple, censorship-resistant protocol designed to be a decentralized alternative to social networks, without relying on any trusted central server . It uses public-key cryptography to ensure content integrity and non-repudiation.

The core idea of Nostr is surprisingly simple. Anyone publishes their notes to several relays, which are simple servers. Followers can connect to these relays to retrieve notes. The protocol only defines the messages that can be exchanged between clients and relays to publish and fetch content.

Core Components

Events and Keys

The basic unit in Nostr is the “Event,” a JSON object containing the following fields:

id: A unique SHA-256 hash identifier for the event. pubkey: The user’s public key (32 bytes in hex format). created_at: A Unix timestamp. kind: The event type (an integer), which determines how the content is interpreted. tags: An array of tags (e.g., referencing another event or user). content: The event content (free text). sig: A 64-byte hex signature proving ownership of the event.

The id is calculated by taking the SHA-256 of a JSON representation of the event, and it is signed using the Schnorr signature algorithm on the secp256k1 curve, which is the same curve used by Bitcoin.

Relays

Relays are WebSocket servers that receive events from clients, store them, and send them to other subscribed clients. Anyone can run their own relay, and each relay has its own internal policies. Relays do not need to trust each other or coordinate with each other .

Clients

These are the applications users use to interact with the network. Clients manage user keys, create and sign events, connect to relays, and display content. Clients do not need to trust relays, as signatures are verified locally.

How It Works

  1. The user generates a key pair on a client.
  2. The client signs events with the user’s private key.
  3. The client publishes the signed event to one or more chosen relays.
  4. The relay verifies the signature, stores the event, and sends it to any other client that has subscribed to that type of event.
  5. To follow another user, you only need to follow their public key. The client will fetch events from the relays that user publishes to.

The user’s private key never leaves their device, granting them full ownership of their identity. No relay or platform can suspend their account.

Protocol Extensions (NIPs)

Nostr evolves through a set of proposals called NIPs (Nostr Implementation Possibilities), which document implementable features and additions. Some of the most important extensions include:

NIP-01: Defines the basic protocol flow. NIP-05: Maps public keys to DNS addresses for easy identification (e.g., @username@example.com). NIP-19: Provides human-readable encoding for entities (e.g., npub1... and nsec1...). NIP-44: Provides updated payload encryption. NIP-57: Adds support for Lightning Network micropayments (Zaps). NIP-59: Introduces the “Gift Wrap” concept to hide metadata of encrypted messages, enhancing privacy. NIP-17: Defines a system for encrypted private messages.

Platforms and Applications Built on Nostr

There is a growing ecosystem of applications and platforms using Nostr. Among the most prominent are:

Ditto

An open-source, highly customizable social platform launched by Soapbox. It allows users to follow and interact with users from Nostr, Bluesky, and Mastodon networks from a single interface.

GNUTUX

Ditto Features:

  • Full customization: Users can change themes, colors, fonts, and layouts, reviving the creative spirit of profile design from the MySpace era.
  • Identity ownership: Based on Nostr, users own their cryptographic keys, and no platform can suspend or confiscate their identity.
  • Built-in payments: Supports sending Lightning Zaps directly to creators.
  • Entertainment features: Includes encrypted letters and virtual pets.
  • Available on: Web, Android, and iOS (coming soon).

Other Platforms and Services

Primal: A web and mobile client focused on performance and user experience. Coracle: A web client focused on simplicity and privacy. Damus: An iOS client (one of the first). Amethyst: An Android client. Nostr Wallet Connect (NWC): A protocol for linking wallets to Nostr applications.

Summary

Nostr represents a paradigm shift in the concept of social communication, giving users complete control over their identity and data. By adopting a decentralized architecture based on independent relays and cryptographic keys, Nostr offers a genuine, censorship-resistant alternative to traditional centralized platforms. With the growing number of clients and relays, and the diversity of applications built on it, Nostr appears to be a strong candidate to become the foundation of the next generation of an open internet.

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

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

https://nostr.net

https://ditto.pub

Published in the Free and Open Source Software section – Protocols and Communication

Reactions & Comments

Sign in with GitHub to leave a comment or react. Powered by Giscus (stored in GitHub Discussions)

AR