• Stars
    star
    676
  • Rank 66,790 (Top 2 %)
  • Language
  • Created about 4 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a truly censorship-resistant alternative to Twitter that has a chance of working

nostr - Notes and Other Stuff Transmitted by Relays

The simplest open protocol that is able to create a censorship-resistant global "social" network once and for all.

It doesn't rely on any trusted central server, hence it is resilient; it is based on cryptographic keys and signatures, so it is tamperproof; it does not rely on P2P techniques, and therefore it works.

This is a work in progress. Join the Telegram group!

Very short summary of how it works, if you don't plan to read anything else:

Everybody runs a client. It can be a native client, a web client, etc. To publish something, you write a post, sign it with your key and send it to multiple relays (servers hosted by someone else, or yourself). To get updates from other people, you ask multiple relays if they know anything about these other people. Anyone can run a relay. A relay is very simple and dumb. It does nothing besides accepting posts from some people and forwarding to others. Relays don't have to be trusted. Signatures are verified on the client side.

How to start using Nostr

Nostr client feature comparison

List of projects built on Nostr

This is needed because other solutions are broken:

The problem with Twitter

  • Twitter has ads;
  • Twitter uses bizarre techniques to keep you addicted;
  • Twitter doesn't show an actual historical feed from people you follow;
  • Twitter bans people;
  • Twitter shadowbans people;
  • Twitter has a lot of spam.

The problem with Mastodon and similar programs

  • User identities are attached to domain names controlled by third-parties;
  • Server owners can ban you, just like Twitter; Server owners can also block other servers;
  • Migration between servers is an afterthought and can only be accomplished if servers cooperate. It doesn't work in an adversarial environment (all followers are lost);
  • There are no clear incentives to run servers, therefore, they tend to be run by enthusiasts and people who want to have their name attached to a cool domain. Then, users are subject to the despotism of a single person, which is often worse than that of a big company like Twitter, and they can't migrate out;
  • Since servers tend to be run amateurishly, they are often abandoned after a while — which is effectively the same as banning everybody;
  • It doesn't make sense to have a ton of servers if updates from every server will have to be painfully pushed (and saved!) to a ton of other servers. This point is exacerbated by the fact that servers tend to exist in huge numbers, therefore more data has to be passed to more places more often;
  • For the specific example of video sharing, ActivityPub enthusiasts realized it would be completely impossible to transmit video from server to server the way text notes are, so they decided to keep the video hosted only from the single instance where it was posted to, which is similar to the Nostr approach.

The problem with SSB (Secure Scuttlebutt)

  • It doesn't have many problems. I think it's great. I was going to use it as a basis for this, but
  • its protocol is too complicated because it wasn't thought about being an open protocol at all. It was just written in JavaScript in probably a quick way to solve a specific problem and grew from that, therefore it has weird and unnecessary quirks like signing a JSON string which must strictly follow the rules of ECMA-262 6th Edition;
  • It insists on having a chain of updates from a single user, which feels unnecessary to me and something that adds bloat and rigidity to the thing — each server/user needs to store all the chain of posts to be sure the new one is valid. Why? (Maybe they have a good reason);
  • It is not as simple as Nostr, as it was primarily made for P2P syncing, with "pubs" being an afterthought;
  • Still, it may be worth considering using SSB instead of this custom protocol and just adapting it to the client-relay server model, because reusing a standard is always better than trying to get people in a new one.

The problem with other solutions that require everybody to run their own server

  • They require everybody to run their own server;
  • Sometimes people can still be censored in these because domain names can be censored.

How does Nostr work?

  • There are two components: clients and relays. Each user runs a client. Anyone can run a relay.
  • Every user is identified by a public key. Every post is signed. Every client validates these signatures.
  • Clients fetch data from relays of their choice and publish data to other relays of their choice. A relay doesn't talk to another relay, only directly to users.
  • For example, to "follow" someone a user just instructs their client to query the relays it knows for posts from that public key.
  • On startup, a client queries data from all relays it knows for all users it follows (for example, all updates from the last day), then displays that data to the user chronologically.
  • A "post" can contain any kind of structured data, but the most used ones are going to find their way into the standard so all clients and relays can handle them seamlessly.

How does it solve the problems the networks above can't?

  • Users getting banned and servers being closed

    • A relay can block a user from publishing anything there, but that has no effect on them as they can still publish to other relays. Since users are identified by a public key, they don't lose their identities and their follower base when they get banned.
    • Instead of requiring users to manually type new relay addresses (although this should also be supported), whenever someone you're following posts a server recommendation, the client should automatically add that to the list of relays it will query.
    • If someone is using a relay to publish their data but wants to migrate to another one, they can publish a server recommendation to that previous relay and go;
    • If someone gets banned from many relays such that they can't get their server recommendations broadcasted, they may still let some close friends know through other means with which relay they are publishing now. Then, these close friends can publish server recommendations to that new server, and slowly, the old follower base of the banned user will begin finding their posts again from the new relay.
    • All of the above is valid too for when a relay ceases its operations.
  • Censorship-resistance

    • Each user can publish their updates to any number of relays.
    • A relay can charge a fee (the negotiation of that fee is outside of the protocol for now) from users to publish there, which ensures censorship-resistance (there will always be some Russian server willing to take your money in exchange for serving your posts).
  • Spam

    • If spam is a concern for a relay, it can require payment for publication or some other form of authentication, such as an email address or phone, and associate these internally with a pubkey that then gets to publish to that relay — or other anti-spam techniques, like hashcash or captchas. If a relay is being used as a spam vector, it can easily be unlisted by clients, which can continue to fetch updates from other relays.
  • Data storage

    • For the network to stay healthy, there is no need for hundreds of active relays. In fact, it can work just fine with just a handful, given the fact that new relays can be created and spread through the network easily in case the existing relays start misbehaving. Therefore, the amount of data storage required, in general, is relatively less than Mastodon or similar software.
    • Or considering a different outcome: one in which there exist hundreds of niche relays run by amateurs, each relaying updates from a small group of users. The architecture scales just as well: data is sent from users to a single server, and from that server directly to the users who will consume that. It doesn't have to be stored by anyone else. In this situation, it is not a big burden for any single server to process updates from others, and having amateur servers is not a problem.
  • Video and other heavy content

    • It's easy for a relay to reject large content, or to charge for accepting and hosting large content. When information and incentives are clear, it's easy for the market forces to solve the problem.
  • Techniques to trick the user

    • Each client can decide how to best show posts to users, so there is always the option of just consuming what you want in the manner you want — from using an AI to decide the order of the updates you'll see to just reading them in chronological order.

FAQ

  • This is very simple. Why hasn't anyone done it before?

    I don't know, but I imagine it has to do with the fact that people making social networks are either companies wanting to make money or P2P activists who want to make a thing completely without servers. They both fail to see the specific mix of both worlds that Nostr uses.

  • How do I find people to follow?

    First, you must know them and get their public key somehow, either by asking or by seeing it referenced somewhere. Once you're inside a Nostr social network you'll be able to see them interacting with other people and then you can also start following and interacting with these others.

  • How do I find relays? What happens if I'm not connected to the same relays someone else is?

    You won't be able to communicate with that person. But there are hints on events that can be used so that your client software (or you, manually) knows how to connect to the other person's relay and interact with them. There are other ideas on how to solve this too in the future but we can't ever promise perfect reachability, no protocol can.

  • Can I know how many people are following me?

    No, but you can get some estimates if relays cooperate in an extra-protocol way.

  • What incentive is there for people to run relays?

    The question is misleading. It assumes that relays are free dumb pipes that exist such that people can move data around through them. In this case yes, the incentives would not exist. This in fact could be said of DHT nodes in all other p2p network stacks: what incentive is there for people to run DHT nodes?

  • Nostr enables you to move between server relays or use multiple relays but if these relays are just on AWS or Azure what’s the difference?

    There are literally thousands of VPS providers scattered all around the globe today, there is not only AWS or Azure. AWS or Azure are exactly the providers used by single centralized service providers that need a lot of scale, and even then not just these two. For smaller relay servers any VPS will do the job very well.

Protocol specification

See the NIPs and especially NIP-01 for a reasonably-detailed explanation of the protocol spec (hint: it is very short and simple).

Software

There is a list of most software being built using Nostr on https://github.com/aljazceru/awesome-nostr that seemed to be almost complete last time I looked.

License

Public domain.

More Repositories

1

awesome-loginless

an awesome list of internet services that don't require logins or registrations
1,499
star
2

awesome-jq

A curated list of awesome jq tools and resources.
778
star
3

jqview

simplest possible native GUI for inspecting JSON objects with jq
Go
364
star
4

coisas

a client-side CMS for editing GitHub Markdown (and other) files
JavaScript
315
star
5

jq-web

jq in the browser with emscripten.
JavaScript
303
star
6

noscl

Command line client for Nostr.
Go
270
star
7

module-linker

browse modules by clicking directly on "import" statements on GitHub
JavaScript
246
star
8

relayer

A Nostr relay server framework.
Go
230
star
9

nos2x

nostr signer extension
JavaScript
173
star
10

ipfs-dropzone

Dropzone.js that uploads to IPFS instead of to an URL
JavaScript
155
star
11

glua

Maybe you should use https://github.com/fiatjaf/flua instead of this
Go
138
star
12

node-dependencies-view

node dependency trees as a service.
JavaScript
126
star
13

branle

A Twitter-like Nostr client made with Quasar
Vue
113
star
14

lntxbot

Go
104
star
15

nocomment

See a demo at https://fiatjaf.com/nostr.html
JavaScript
93
star
16

trelew

An interactive shell for Trello.
JavaScript
86
star
17

pgjson

use Postgres as a zero-config NoSQL database.
JavaScript
86
star
18

summadb

A hierarchical database that stores computed values.
Go
75
star
19

trello-webhooks

What data comes in when you get a Trello webhook.
64
star
20

nostr-gateway

https://nostr.guru
JavaScript
58
star
21

rel

command line tool for managing personal graphs of anything and writing them to dot
Go
55
star
22

search-comparison

visualize { fast-fuzzy, fuzzyset, sifter, lunr, fuse, fuzzy } results at the same time
JavaScript
51
star
23

sitio

imperative static site generator powered by React and browserify
JavaScript
49
star
24

lightningd-gjson-rpc

Talk with a lightningd/c-lightning with minimal overhead and gjson responses.
Go
44
star
25

nostr-relay-registry

a dynamic registry of nostr relays
JavaScript
43
star
26

sparko

c-lightning RPC over HTTP with fine-grained permissions, SSE and spark-wallet support
Go
36
star
27

bridgeaddr

Go
35
star
28

localchat

Instant loginless chats with people that share an IP with you.
Go
35
star
29

classless

The same HTML, multiple CSS themes.
CSS
34
star
30

tempreites

One-file semantic DSL-free templates direto da roça for the browser and server.
JavaScript
33
star
31

kwh

webln browser extension for lightningd/eclair/ptarmigan
JavaScript
32
star
32

trackingco.de

minimal and loginless web analytics
JavaScript
32
star
33

filemap.xyz

upload files to a geographic point. never memorize a link again.
JavaScript
31
star
34

microanalytics

Personal hackable web-analytics as a CouchApp.
JavaScript
26
star
35

go-lnurl

helpers for writing lnurl stuff in wallets and services
Go
24
star
36

reactive-couch

A design document template for React-based CouchApps that render HTML on list/show functions and update them on the client
CoffeeScript
23
star
37

lnchannels

lightning network browser with history and some stupid heuristics
HTML
23
star
38

ijq

interactive jq, a REPL
Go
22
star
39

tiddlywiki-remotestorage

a syncadaptor plugin that saves tiddlers on custom remoteStorage directories
JavaScript
21
star
40

wen

web enhancer extension based on nostr
JavaScript
21
star
41

ght

Share GitHub repository traffic statistics in your README
Go
18
star
42

requestbin

an HTTP server that does nothing but log requests you send to it
Go
18
star
43

side-rosetta

Code powering https://rosetta.fiatjaf.com
HTML
18
star
44

pf

a framework for turning written sentences into structured data with simple parsers.
JavaScript
18
star
45

classless-hexo

The Classless templates and themes implemented in Hexo
EJS
17
star
46

trello-exporter

A command line Trello backup tool that outputs friendly and readable files
Shell
17
star
47

lnurlpos-app

A phone app that works as an offline lnurl-based point-of-sale.
Dart
16
star
48

washer

A whoosh-based CLI indexer and searcher for your files.
Python
16
star
49

nak

a command line tool and a web app for dealing with nostr entities
Scala
15
star
50

etleneum

the centralized smart contract platform
Go
14
star
51

jq-finder

multicolumnar JSON explorer with jq in the browser
Elm
14
star
52

bech32

Pieter Wuille's reference implementation for Bech32 and segwit addresses
Python
14
star
53

makeinvoice

Makes a Lightning invoice
Go
14
star
54

awesome-lan

Awesome resources for cozy networks where you know everybody.
14
star
55

easy-nostr

Batteries-included Nostr client library
TypeScript
13
star
56

hledger-web

hledger on the web with remoteStorage.
Haskell
13
star
57

cycle-graphql-driver

A simple, Apollo-based, GraphQL driver to be used with Cycle's most-run
JavaScript
13
star
58

jekmentions

no-javascript webmentions for GitHub pages Jekyll blogs
Python
12
star
59

thing-store

an app for storing and calculating with arbitrary structures of values.
Elm
11
star
60

expensive-relay

a nostr relay that requires a single registration payment per pubkey
Go
11
star
61

lesspass-remotestorage

LessPass WebExtension that saves profiles to remoteStorage.
JavaScript
11
star
62

jiq-web

like https://github.com/fiatjaf/jiq, but in a web page.
HTML
10
star
63

went

webmention endpoint tools
Python
10
star
64

lunatico

Go stuff to Lua and back: helper functions for github.com/aarzilli/golua
Go
10
star
65

anyprevout.xyz

a website promoting bip118
HTML
9
star
66

templates

Mix YAML/JSON data with Markdown/HTML templates. Useful for printing stuff.
Elm
8
star
67

firefox-pinboard

A very minimal Google Chrome Extention for Pinboard that doesn't use API keys, instead just opens Pinboard windows
JavaScript
8
star
68

lightningd-webhook

A lightningd plugin that emits webhooks for each notification events.
Go
8
star
69

nwiki

CLI tool for interacting with Nostr-based wikis
Go
8
star
70

sbt-esbuild

transpile and bundle scala-js packages with esbuild
Scala
7
star
71

mcldsp

Migrate a c-lightning database from SQLite to Postgres!
Go
7
star
72

levelup

a leveldb-inspired common interface for database drivers.
Go
7
star
73

dotfiles

all my passwords are here, please do not read.
Shell
7
star
74

debtmoney.xyz

an interface for people-powering money through self-issued IOUs on Stellar
Elm
7
star
75

rsslay

A Nostr relay that creates profiles from RSS or Atom feeds and emits items as Nostr events
Go
7
star
76

flua

wanna run some Lua? move fast with fengari on the web.
JavaScript
7
star
77

khatru

Go
6
star
78

seed-auth

an username/password translator to lnurl-auth
HTML
6
star
79

bisu

Go
6
star
80

stack-forum

A forum that displays messages in stacks.
JavaScript
6
star
81

refbot

GitHub Issues-style backreferences for your Trello cards.
CoffeeScript
6
star
82

no-fed

nostr-activitypubthings bridge
Go
6
star
83

classless-hugo

The Classless templates and themes implemented in Hugo
HTML
6
star
84

react-microspreadsheet

the embeddable sheet powering http://sheets.alhur.es/
CoffeeScript
6
star
85

accountd.xyz

unified accounts database
Python
5
star
86

stellar-navigator

an interactive browser for the Stellar ledgerchain
Elm
5
star
87

howoldis

how old a website is? wayback-machine powered cli program.
Go
5
star
88

piln

loginless pin to ipfs with lightning network payments
JavaScript
5
star
89

gravity

IPFS centralized index protocol and tooling
Go
5
star
90

cbor

A command line tool that turns CBOR into JSON or JSON into CBOR
Go
5
star
91

derived

CouchDB-style synchronous derived indexes for Javascript objects
JavaScript
5
star
92

awesome-small-web-tools

A list of useful simple tools distributed as web apps
5
star
93

nostr-relay-poc

Proof-of-concept Nostr relay implementation
Go
5
star
94

infinity-modules

A collection of useful and useless LNbits Infinity modules
Lua
4
star
95

socialcreditsbot

A Telegram bot that keeps track of social credits based on the Pooh stickers
Go
4
star
96

trustlines

decentralized mutual-credit payment system
4
star
97

webvatar.com

Code powering http://webvatar.com/
Go
4
star
98

trello-web

Promised and browserify-compatible CORS Trello client.
JavaScript
4
star
99

microanalytics-cli

A client to the Microanalytics web-analytics CouchApp.
Python
4
star
100

hyperscript-go

the simplest html generator you'll find in the goniverse
Go
4
star