-
@ armstrys
2023-07-07 00:17:30A few months ago I made a simple post that deserves a longer explanation: nostr:note1fdu9uu2rjjd0zusgpkpyv8c6qvjpx78z974qkhj7v3mwlac2st3sxywf8h
What I really mean
Python has been wildly successful over the last 13 years. Check out its rise in usage shown by this chart from a Medium article by Vahid Vaezian.
https://miro.medium.com/v2/resize:fit:4800/format:webp/1*XBOqPd5_4tKF2hf8iAV0vQ.png
Obviously Nostr isn’t literally Python. Nostr is a language-agnostic protocol and Python is a programming language. However, Nostr and Python embody a similar spirit and a similar culture that I think is bound to lead to the long-term success of Nostr in the same way we have seen Python explode over the last two decades. What makes me say this?
3 key traits of Python (and Nostr)
Before continuing: If you are familiar with Python, but new to Nostr consider reading the nostr.how - What is Nostr and nostr.how - The Nostr Protocol for a relatively quick introduction to the protocol.
1. Open by default and adaptable
Both Nostr and Python are open by default.
Python is a completely open-source language and many of the most powerful packages built within the ecosystem are open-source, even when development is funded by large companies. Like many programming languages, the download and usage of Python is not permissioned.
Nostr is a protocol. Additions to the protocol are openly debated and decided upon by the community on the Nostr GitHub repository. What constitutes the definition of the protocol is entirely determined by the community and their usage.
The protocol needs to be cohesive enough so that the bulk of clients and relays can reliably interact, but there is room for flexibility and varied implementation within the ecosystem. In a few instances, there have been disagreements on different implementations of Nostr Improvement Proposals (NIPs). Because usage of the protocol is open and does not require consensus, clients and relays are free to implement contentious additions. This type of fluid consensus and openness to change is something that cannot exist in other decentralized systems that require rigid consensus between nodes (e.g. Bitcoin).
2. Built to be flexible via composability
Both Python and Nostr are designed with flexibility in mind.
Python’s design choices allow it to excel in a wide variety of use-cases from data science to web development. The diversity of the community and availability of new packages makes using Python even more desireable as you can do nearly everything (including running code from other languages when needed). Over time the Python ecosystem has become a robust set of classes within the standard library and coutless other packages that can be composed by users into a variety of programming styles and projects.
Nostr is often mistaken as only a social media “platform” which couldn’t be further from the truth. The “os” in Nostr, which stands for ”other stuff” is a key distinction between the Nostr protocol and many of its counterparts. Over its first couple years of existence the “other stuff” has been mostly metadata related to Twitter-like platforms, but more more we are starting to see new kinds of events being transmitted over the Nostr protocol. A few notable examples include zaps, highlights, location data, marketplace data, and ephemeral encrypted data.
Nothing about the Nostr spec dictates how a client will piece together these types of events to create a user experience. The earliest example of Nostr client implementations have primarily mimicked existing social media platforms because of the simplicity of the medium - a twitter-clone only requires short text notes and follow lists to be functional. Similarities to Twitter have driven the mainstream narrative, but the Nostr ecosystem is beginning to explode.
Community-based approaches (like Reddit) are beginning to take off, spurred on by Reddit’s failures to meet developer and user needs. Even more interesting applications that don’t exist in the centralized landscape are coming to bear as well. Projects like stemstr, Highlighter, and Nostrocket show some of the different formulations of tools that can be built on the Nostr spec. These are all new formulations of how we share information socially.
The new project nsecBunker by Pablo uses Nostr in a completely different way to build a new sort of “password management” system for cryptographic signatures in Nostr. This is not a social application, but a completely new security model achieved by composing existing metadata events in a new workflow that clients can adopt.
Just as the flexibility of Python and the diversity of Python packages leads to even more diversity, the flexibility of composition allowed by Nostr events and the dumb relay, smart client model are going to lead to an explosion of Nostr client implementation styles.
3. Accessibility over performance
Nostr and Python both favor developer accessibility over raw performance.
One of the best compliments a Python developer can receive is to have their code referred to as “Pythonic”. Executing
import this
in a python interpreter returns the core of what it means for code to be pythonic:python ''' The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! '''
These principles are almost certainly a key part of why Python has remained one of the most accessible languages to aspiring coders (including myself) and has experienced such a rapid growth over the past decade. What Python lacks in raw computational efficiency it has made up for by remaining simple, readable, beautiful, and practical. This brought in bringing in a vast community of people who are passionate about solving problems and are willing to learn new tools and experiment to do so.
I see very similar qualities in the Nostr development community. Though the Nostr specification does get more complicated with the addition new NIPs, it cannot change the core properties of the protocol that make it easy to understand. I think Will (nostr:npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s) said it best when he tweeted
nostr is just schnorr-signed json blobs of different kinds (profile, contact list, post, like, retweet) that you can store locally
https://twitter.com/jb55/status/1594000865568129025?s=46
Fundamentally, Nostr is just entities (clients and relays) passing around these JSON blobs a websocket, which you can think of as effectively just a bidirectional pipe of data between two entities.
The composition of these JSON blobs and their formulation by clients can range in complexity, but the simplest implementation truly is quite simple and easy to understand. Compare this to the specifications for a product like BlueSky (which doesn’t extend beyond being a twitter clone) and it is not hard to understand why they don't have a trove of would-be developers knocking on their door as Jack (nostr:npub1sg6plzptd64u62a878hep2kev88swjh3tw00gjsfl8f237lmu63q0uf63m) lamented i a now infamous post:
nostr:nevent1qqsgxtjp8yftcqvx69e2dgk0mk4lmafskpn8wn7lqwpdw5jr07ylsdca2qxrl
Why you should care
The success of Python is not a fluke - the three characteristics listed above have been key drivers in the massive adoption rate of Python by new programmers. Other programming languages like Rust and Julia have attempted to solve some of the performance limitations inherent with Python, but will always struggle to gain the same level of attraction due to the vast network effect of the Python package ecosystem. This is not to say languages like Rust won’t be successful - in many cases, Rust may be the better choice for certain projects in 2023. However, Python’s dominance shows the power and impact of new developers consistently entering the ecosystem due to the ecosystem’s broad utility.
Just within the past few months a new project, Mojo has garnered lots of excitement because it promises to massively improve on Python’s performance while also being able to capitalize on the network effects associated with Python since it is a superset of Python and should ultimately be able to run any existing Python code. Will Mojo overtake Python? I don’t know, but I believe the only way it has a chance is if it maintains all of the above characteristics of Python and it delivers in terms of increased performance.
Nostr is positioned similarly to Python in relation to competing protocols. Until another decentralized data protocol comes around that is open, flexible, accessible, and more efficient, Nostr is bound to win.