How could Drupal adopt Nostr?

zaterdag 30 december 2023 - 933 woorden, 5 min read

For me this is quite a challenging topic to point out in this blog. In this blog I'm writing some stuff out loud.

💜 - In case you missed it, when the founder of Drupal Dries Buytaert discovered Nostr, it was love on first sight (blog).

Nostr & Drupal

Nostr is a protocol used for sending notes and other stuff to relays. All events containing those data are signed on behalf of an entity with public-key cryptography.
Drupal is a state-of-the-art, free and open source content management system for building websites and applications.

These following questions I’m trying to answer without going deep into each topic.

  • What type of data and information would we like to syndicate with Drupal?
  • What Nostr features can we implement in Drupal?

Open web manifesto of Drupal

Let’s have a look at the recent published open web manifesto of Drupal where I would like to point out the following points:

It’s built on freedom: You don’t need permission to learn, build, or advance open web technology. Anyone, anywhere can contribute to making it better.

It’s defined by decentralization: No single person or entity controls the open web.

To live up to that definition, an open web must not be built on proprietary technology.
..It must be designed to protect (not exploit) personal data and public discourse.
..It must enable the next generation of innovators and entrepreneurs to compete effectively.
..It must be resilient to a changing world and not controlled by a select few.

Nostr embodies this all! Just like Nostr, Drupal is freedom technology.

Authentication (NIP-05 + NIP-07 + NIP-46)

Register / login / authenticate on a Drupal powered website with your Nostr identity keys. Use Drupal as a custodial solution platform (key bunker) for managing Nostr keys. When connected, Drupal can be used an app for signing your events. Additional, also an internet identifier can be set for the user (see this module).

This authentication layer is needed to fully enable the Nostr experience with Drupal.

Long-form content (NIP-23)

Publish blog content to your Nostr network by integrating NIP-23 in Drupal. In this way your (Markdown formatted) content can also be read on clients which support NIP-23 like Yakihonne, and See this module which I’m working on how this could work with Drupal.

Drupal as relay management system (RMS)

With Drupal you’re able to connect to multiple and different types of databases for retrieving data. Most relay implementations are using a database which can be connected to Drupal. When connected, you can use Drupal as a UI for managing the content stored on the relay.

Run a relay with Drupal

Drupal is written in PHP, so technically it could act as a relay. As far as I know, there is only one (very basic) relay implementation written in PHP yet: yar.

Chat / messaging (NIP-44)

For Drupal there are many contrib chat modules:

I’m aware there is a lot of buzz around doing chat and messaging on Nostr because it’s not fully private. With NIP-44 recently merged, I expect a growth of clients broadcasting more private data.

File and media storage (NIP-94 + NIP-98)

Use Drupal as a file and media storage backend where you can upload your files to. Many Nostr clients have the option to use your favorite media upload service for sharing media files among your notes and events.

Groups / communities (NIP-72)

The Drupal module groups is a widely used module for creating groups with users (12.000+ sites using it) to let them access specific content. With Drupal Groups + Nostr you have a very robust base for starting an online community platform around content.

Tagging content (NIP-32)

Within Drupal you can use taxonomies to classify content with tags. Those tags can be mapped with Nostr labels. This integration could be used with other modules (for short text notes, long-form content etc) when you publish to Nostr from Drupal.

Commerce (NIP-15)

When you create an e-commerce website with Drupal, NIP-15 could be integrated to syndicate your commerce products content to the Nostr network. In this way, your products will also show up in Nostr marketplace clients like Nostr Market (LNbits extension) and Plebeian Market.

Other stuff

In 2022 I was inspired by, and HackerNews building with Drupal. It’s an online community for Honda car enthusiasts and an Instagram profile link aggregator.
Soon after I published the first version, I’ve learned that Nostr could be the social layer on this platform and replace the site-only account registrations and interactions (rating and commenting).

With Drupal you could get a fullstack platform for building a Nostr client. These are some other ideas for clients copy-catting other existing platforms:

  • A Calendly alternative for appointment scheduling
  • A UserVoice alternative for collecting user feedback on your product
  • Todoist alternative for your to-do list
  • A Strava alternative where you share your sport activities
  • Drupal module for unlocking content with a zap
  • Drupal module for liking content with zaps
  • Drupal module providing a block with a zap me button

For bridging the gap between Drupal and Nostr, you need to write custom middleware solutions in the backend (PHP) and frontend (JavaScript / Twig). That’s why I’m building and maintaining the nostr-php helper library and the Drupal modules Nostr Simple Publish, Nostr internet identifier NIP-05 and Nostr long-form content NIP-23.


Sebastian Hagens @Sebastix
I work as creative webdeveloper & tech consultant and care about digital freedoms. Follow me:
or visit my contact page