nostr-mailing-list/README.md

3.3 KiB

Inspiration

Email was once a great decentralized protocol, but it became corrupted over time. As spammers and scammers gained ground, the solution that emerged was centralization. Internet giants took over, deciding what's spam and what isn't.

With Nostr, we no longer need to rely on this outdated approach, which contradicts the principles of self-sovereign, decentralized control of your own data.

The recent Google ban on the Bitcoin Dev mailing list for "unwanted content" was our wake-up call. Something had to be done now, and this hackathon gave us the perfect opportunity to help make email decentralized again.

What it does

My project creates a bridge between Nostr and traditional email protocols (IMAP/SMTP). It's a proxy server that lets you use your favorite email client to interact with mailing lists built on top of Nostr.

Just configure this proxy server in any email client that supports proxies, and you can instantly send and receive messages through Nostr while keeping your familiar email interface. This means you can participate in decentralized, censorship-resistant mailing lists (like a new Bitcoin Dev list) without changing your workflow.

I recommend self-hosting the server, or if you do not, at the very least use a burnable nostr identity, as there wasn't enough time to build proper security.

How we built it

I built a dual-protocol server that:

  1. Implements IMAP for reading messages from Nostr relays
  2. Implements SMTP for sending messages to Nostr relays
  3. Handles translation between email formats and Nostr events
  4. Maps email-specific concepts (folders, flags, etc.) to Nostr constructs

I used TypeScript with Deno for development.

Challenges we ran into

  • Bridging different paradigms: Email and Nostr have fundamentally different models for message storage and addressing
  • Building a compliant IMAP/SMTP server from scratch was more complex than anticipated (especially considering I had never written anything to interact with IMAP before)
  • Handling the different threading models between email and Nostr events
  • Mapping between email concepts like "folders" and Nostr filters

Accomplishments that we're proud of

  • Creating a functional bridge that lets people use familiar email tools for Nostr
  • Implementing working IMAP and SMTP servers that speak Nostr on the backend
  • Building a solution that can help keep important communities like Bitcoin Dev free from censorship
  • Demonstrating that decentralization doesn't have to mean abandoning familiar interfaces
  • Delivering a working prototype during a hackathon timeframe (especially considering I started coding this on saturday, when the hackathon was already midway through)

What we learned

  • The intricacies of the IMAP and SMTP protocols and their implementation details
  • The complexity of making new protocols accessible to existing tooling

What's next for Nostr via Email

  • Hosting a Bitcoin Dev mailing list on Nostr to ensure it's never censored again
  • Adding support for more email features (attachments, advanced filtering)
  • Browser based view
  • Implementing NIP-05 identifiers to make email addresses map cleanly to Nostr identities
  • Loading user profiles, so mail clients don't listen stray npubs
  • Letting the world build something better on top of what I wrote while I focus on building Closed Community Networks