Why Nostr? What is Njump?
2023-08-03 21:05:05

jb55 on Nostr: Hey guys, I've been quiet lately... I've been working on something big. In the past 2 ...

Hey guys,

I’ve been quiet lately… I’ve been working on something big. In the past 2 weeks there have been 9539 new lines of code added to damus, 2928 removed, 279 files changed. I’ve rewritten much of the codebase in preparation for the nostrdb integration.

nostrdb

What is nostrdb? nostrdb is an integrated relay within damus, with the same design as strfry, but slightly different to support embedding into nostr apps. This will be the heart of Damus apps going forward, including notedeck and other future microapps. Think of it as a kind of development kit but with an embedded database and query capabilities. I didn’t want to have to recreate all of the same querying, caching, and parsing code when building new apps, nostrdb will solve all of the painful and slow parts. nostr seems simple but if you want a fully working app it is pretty complicated, especially if you want it to be fast and sync efficiently.

Goals

  • be the best and most efficient at querying, syncing and storing nostr notes
  • enable direct mapping of notes into application code without any serialization overhead
  • provide advanced syncing capabilities such as negentropy, which allows us to only query stuff we don’t have
  • be as portable as possible. nostrdb is a C library that you can embed into basically anything.
  • full relay filter support
  • full text search

Benefits

  • full note verification
  • more efficient de-duplication before we begin processing events off the wire
  • set-reconciliation based syncing (negentropy) drastically reduces bandwidth usage and latency
  • iteration on future nostr apps will be quicker (android, desktop, etc)
  • features like ghost mode, account switching, etc will be much more efficient as you will be able to quickly switch between notes that are cached locally
  • much smaller memory footprint due to optimized in-memory note format, which in turn improves cpu-cache efficiency
  • much better profile and note searching

So that’s what I’ve been working on in the past two weeks. On to what else is new in this release:

Multi reactions!

Suhail did an amazing job at adding multiple reaction support. All you need to do is long-press the Shaka button to show different options. You can customize these in settings as well

New onboarding features

Damus will now suggest people to follow when you first enter the app, this is the first of many onboarding improvements coming soon. Thank Klabo for this one!

That’s all for now! Please test thoroughly and let me know if you run into any issues. You likely will since the entire codebase has been changed, and I probably broke something.

Until next time 🫡

Author Public Key
npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s