Interpreting Nostr: A Censorship-Resistant Decentralized Social Protocol
The method of preserving information for about 100 million years, they emphasized, is the only feasible method known so far, and it is—" Luo Ji raised his crutch above his head, his white hair and long beard fluttering, looking like Moses parting the Red Sea , solemnly shouted, "Carve the words on the stone!"
background
background
How is information passed on? There is the deafening voice in the preface: engrave the words on the stone!
How can information not be blocked? That can be carved in as many stones as possible.
How does the information prove ownership? Based on beautiful functions like elliptic curves, the infinite and unique correspondence in mathematical theory.
This is a week of public key swiping, whether it is in the circle of friends or Twitter Facebook, the key event is the former CEO of Twitter Jack Dorsey tweeted that the social products Damus and Amethyst based on the decentralized social protocol Nostr have been separated. It was launched on the Apple App Store and Google Play Store, and the web site snort.social was also officially opened. Among them, the number of users of Damus has exceeded 72 W in just a few days.
first level title
Why is there a demand scenario for Nostr?
The Internet people who have experienced the anti-monopoly years hate the abuse and infringement of data by centralized institutions, but are unable to break away from the excellent application experience and the non-selective market. In the final analysis, behind the social products are companies as institutions. In operation, the company is obliged to accept supervision and review. All its responsibilities are shareholders and the government of the place of registration. In essence, it pursues commercial success, not the ideal of freedom of speech.
first level title
Nostr Protocol Architecture
In fact, Nostr is very concise and clear, and can be summarized in one sentence:
Let everyone run a client program, and when they want to publish some information, sign the text with their own private key and send it to multiple repeaters. When you want to get information, you ask each repeater. The client verifies the obtained information with the help of its public key to judge the authenticity.

role relationship
There are only two roles in the protocol: repeater and client
Relay, as there can be any number of relays, the mission is to accept and store the information reported by the client, and return the local query results according to the client's request.
client , that is, there can be any number of clients, which are stored in the user's device, and the core to be done is signature and verification.
From such a concise role relationship, it can be seen that the user client does not interact with other user clients, it is not in the form of p2p, and there is no need for interaction between relayers and no information communication between them, which also means There is no question of consensus level.
Generally speaking, it belongs to a structure of strong client and weak server (relay). Multiple servers can replace each other, thereby diluting its importance. This is also the basis of anti-censorship. Users have autonomy over relay The right to choose, which can lead to competition at the repeater level, greater capacity, faster speed, better network incentives, and the ability to filter spam.
account system
Identities in Nostr consist of public and private keys. Therefore, without a password or a unique username (or the public key is the username), it is costless for anyone to create a new public-private key pair, which is essentially an existing relationship.

However, what is significantly different from previous decentralized social products is that it does not go to the chain at all. It can be said that it has nothing to do with the chain itself. It just applies the most conventional public-private key account system on the blockchain.
We can already see the role of public and private keys in many scenarios. For users who can accept the risk of self-controlled private key management, it is an excellent account weapon. There is EOA as the base, MPC as the optimization, and contracts The wallet is the carrier of the current account abstract AA.
Ethereum Account Abstract 4D Research Report: Dismantling 10 Related EIP Proposals and the Seven-Year Road to Breaking the Bottleneck of Tens of Millions of Daily Active UsersEthereum Account Abstract 4D Research Report: Dismantling 10 Related EIP Proposals and the Seven-Year Road to Breaking the Bottleneck of Tens of Millions of Daily Active Users
Secondly, in front of the vast number of NFT players, they often encounter various whitelist Mint, which is also based on public and private key signature and unsignature.
Expandable reading:When Netflix's NFT Forgot Web2's Business Security
Operational behavior
Nostr's NIP is a mechanism similar to the Ethereum EIP proposal, and NIP-01 explains the content of each message.
text
Operation 1. Signature release information: EVENT
When users want to publish information, they use the private key stored in their local client to sign a string of content, and finally generate the following json type data

text
Operation 2. Subscribe to the target event: REQ
As information transmission, there is always a return. The instruction REQ needs to send a random ID as the subscription ID to the repeater, as well as a filter message. The settings currently supported by the protocol are as follows:

From the filter point of view, the basicequates to attentionthis function, neither requires the other party's permissionIt can also pull the information released by the other party (in fact, it is all public in nature), and the filter is just a better definition, who posted the message in what time period
text
Operation 3. End subscription: CLOSE
The last message that the client can send to the repeater is the close command, that is, to close the subscription, so that the client will not continue to obtain the latest event information.
From a technical point of view, this protocol uses the subscription ID mode, which means that the repeater will establish a continuous websocket connection. Once the repeater receives the information of the user being followed, it will actively initiate a subscription to the client of the subscriber. Request to synchronize. Although this mode has a higher load on the repeater, it can also get data such as the number of real-time followers. It is a way to motivate users to publish more valuable information.
first level title
Nostr's dilemma and how to break it
Through the above review of the role relationship, account system, and operational behavior in the Nostr protocol, we can already basically understand the operating principles of such a streamlined and elegant set of transmission protocols.
However, compared to everyone who also had the same questions as the Fourteenth Lord, is it that simple? Yes, the process of sorting out by the author is like doing a programming class homework for beginners in computer networks when I was a freshman, implementing a chat software for a local area network.
The explosion of Nostr is essentially a philosophical success. Only the minimum necessary elements are defined, while letting go of control, any developer, even a computer student in the first or second year, can develop a repeater service. The low access threshold brings a huge experience competition.
It can be seen from the extended link at the end of the article,As of the publication, there have been 228 github open source implementation cases, this time and partly also showed full creativity in exploring commercialization.
text
Dilemma 1. Social privacy issues
The current Nostr repeater is just a dump of simple JSON data. Clients are fetched through filters. This makes nostr a common data sharing platform between clients, so how to solve the scenario where there is a need for private information transmission? After all, even a social forum like Twitter will have the need for private messages.
The current optimal solution is the DH algorithm (Diffie-Hellman key exchangetext
Dilemma 2. Anti-DOS problem
It is the repeater layer that will be attacked. At present, the Nostr protocol does not directly guide and determine how to make the repeater resist DOS attacks and spam, so it is also the focus of many repeater implementations.
Starting from payment, because the relay has a very high autonomy, then he can set the payment conditions, that is, some relay services only allow transactions that complete the payment to be published on it. With financial costs, it is the best spam filtering device.
text
Dilemma 3. High-cost storage and spam screening
Although the repeaters do not need to share any information, but they have a common desire to meet the user's wishes and improve the user experience, then they will be happy to share some blacklists, and communicate with each other to collect more information released by users, so that they can inventory is growing.
at last
at last
Although Nostr is on fire right now, the author still believes that the core problem of creating a decentralized media platform is not a technical problem, but a social dilemma.
Social is the pearl, and it is the category with the deepest moat on the Internet. This is because it has a strong network effect. The oligopoly effect brought by the social graph is particularly obvious. For example, most social applications including Tantan and Momo WeChat’s social terminal is actually WeChat, making it difficult for anyone to leave the social relationship accumulated on WeChat. The network effect and monopoly advantage largely come fromclosed and licensed, After users build their own circles, the cost for users to quit these platforms is very high, because social relationships and graphs cannot be taken away.
What social products are most afraid of is losing contact. Nostr has implemented the anti-censorship repeater logic,but also brings uncertainty, the message has a layer of separation from the publishing end to the receiving end, and the HTTP stable connection establishment condition of 3 handshakes and 4 wave handshakes cannot be manually realized by the user.
Among the demands of social networking, the control demands of most user data may be weaker than the inner needs of users. In the early years, Qzone was all the rage. When it was transferred to the mobile Internet later, the huge difference between it and WeChat Moments was likes and comments. In terms of the two functions, the visibility of acquaintances and the visibility of all employees are distinct, and the follow-up results are obvious to all.
Reference link:
Reference link:
https://github.com/nostr-protocol/nostr
https://github.com/nostr-protocol/nips/blob/master/01.md
https://bips.xyz/340
https://en.wikipedia.org/wiki/Diffie-Hellman Key Exchange
https://github.com/aljazceru/awesome-nostr


