The core differentiator between Nostr and one thing like Mastodon is that, as a substitute of utilizing a username owned by a server operator, every person makes use of a public/personal keypair to deal with that operate as a substitute. That’s one thing {that a} server operator can not merely seize from you or lock you out of. This is among the core constructing blocks on high of which the general Nostr protocol is constructed.
The following is “occasions.” That is the fundamental object/knowledge kind utilized by purchasers and the relay servers that purchasers connect with with the intention to ship and retrieve messages. The final thought of the protocol is that purchasers ship occasions to relay servers, who then in flip retailer and index them, and different purchasers can talk with relay servers to request occasions they’ve acquired and saved. Within the authentic NIP 01 , three totally different occasion varieties are outlined:
0: Sends metadata a couple of person, similar to username, image, a bio, and so forth.
1: Sends textual content messages and primary content material
2: Recommends relay servers for individuals following the occasion creator to connect with
All occasions are structured in a specifically-defined manner. They embody the general public key of the creator, a timestamp of after they have been created, their kind (or sort within the specification), the content material payload and a signature from the occasion creator. In addition they can have tags referencing different occasions or customers, and have an ID worth which is a hash of all the things besides the creator’s signature (much like a TXID for Bitcoin transactions). This allows you to assure {that a} message was really created by the proprietor of the general public key within it by verifying the signature (and the one that owns that key if it is not compromised), and assure that the message wasn’t altered after they signed it. Similar to you’ll be able to’t alter a Bitcoin transaction after it is signed with out voiding it, you’ll be able to’t alter a Nostr occasion after the creator signed it with out it being an apparent fraud.
The occasion sort system was expanded fairly considerably from that authentic NIP. There’s an occasion kind for encrypted direct messages, establishing a shared key by combining the sender’s personal key with the receiver’s public key, which ends up in the identical key you’ll get by combining the sender’s public key with the receiver’s personal key (that is how BIP 47 and Silent Funds work). There are additionally varieties for replaceable occasions and ephemeral occasions. Within the case of a replaceable occasion (clearly), they’re designed in order that the unique creator of the occasion can signal a brand new one to exchange the previous one. Relay servers following the specification will mechanically drop the older occasion from their storage and start serving the newer variations to purchasers upon receipt. Ephemeral occasions are designed in order that they are going to be broadcast to anybody subscribing to their creator when despatched to the relay, however relay servers should not alleged to retailer them. This creates the potential of having messages seen solely by individuals when they’re on-line throughout its broadcast. There’s even an occasion kind to sign a response (similar to likes or emojis) to different individuals’s occasions.
Talking of that final one, occasions can even comprise tags. At the moment there are tag varieties for occasions (to reference an actual Nostr occasion), public keys (to tag or reference different customers) and topics (to emulate performance, similar to e mail topics). All of those can embody tips to particular relay servers from which the the information could be fetched in order that customers can really work together throughout servers, i.e., a person posting their content material to 1 relay server can work together with and reference content material created by one other person posting to a distinct relay server in a manner that enables any person to coherently fetch all the thread of interactions within the correct order and with out huge complexity in determining the place to search out the related knowledge.
Inside the unique NIP, a specification is given for the way purchasers are to work together with relay servers by means of a subscription message/knowledge construction that features filters for what occasions that shopper is all in favour of receiving. These filters can specify customers’ public keys, precise occasions, sorts of occasions and even particular timeframes during which they need them primarily based on the prior standards. You possibly can even submit prefixes of public keys or occasion IDs, similar to “1xjisj….” and obtain any occasion or occasions from a public key that start with that brief string (this may be helpful for hiding from a relay server what you really needed to view).
Total, the protocol is a really naked bones, generalized scheme for passing messages between customers that covers the essential issues, similar to guaranteeing the integrity of messages and who despatched them with using public key identities, whereas additionally facilitating infrastructure on the backend for relay servers that may be extraordinarily centralized or enable a person to run their very own private relay server, all whereas seamlessly interacting with one another and never inflicting huge chaos within the occasion of a person being banned from one relay server. They will transfer to a different one or run their very own and their de-platforming from the prior server doesn’t lose them their digital id or followers as a result of they nonetheless preserve management over their personal key and customers can authenticate that when discovering them elsewhere.
Relay servers can function nevertheless they need as effectively. They will function free of charge, can cost micropayments to publish or obtain messages, and there may be even a NIP for requiring hashcash-style proof of labor to submit a message. They could be a single relay server for internet hosting and serving solely your posts to different customers, or they could be a server working at huge scale similar to Twitter or Reddit (purchasers can show and manage info nevertheless they need, which permits emulating basically any social media platform that exists as we speak). All of this could interoperate seamlessly and with out having the ability to shut out a person. You possibly can stop them from posting content material to your relay server, however finally you’ll be able to’t cease them from viewing content material you host in your relay server or cease different customers from discovering their content material on different servers.
It’s a very simplistic protocol with a big, open design house for individuals to construct, guaranteeing customers can all the time work together with one another no matter what particular person relay server operators select to host or not host. That is concurrently its best energy and best weak point. Whereas it ensures the liberty for builders to construct with out tight constraints by an advanced protocol, there are additionally many issues that it’s going to inherently run into that aren’t dealt with by the protocol itself.
Within the subsequent piece I write, I’ll go into a number of the points I see occurring and potential options, however for now, I will simply say that by way of the simplicity of the design and the probabilities that it opens up for individuals to construct, Nostr has performed an excellent job, contemplating it’s the brainchild of 1 particular person and solely a handful of individuals have actually contributed to the protocol specification itself thus far.