Happy to have inspired 😀 Having a real DB that juggles between memory and disk and saves the indexes sure makes sense.
I could try and see if nostr-social-graph could use indexeddb and not have to load everything into memory on app start. For native, I've made a social graph pull request to nostrdb: https://github.com/mmalmi/nostrdb
That's pretty cool! I'll do some testing around your nostrdb fork. However, due to the requirements of the project, I'll continue with DuckDB as it has a good set of features to better handle resources in resource-constrained environments. It's also an OLAP DB, which makes sense for social graph operations, and to cross that with other data in the same db. I've also discovered the pgq extension of DuckDB, which is pretty interesting but is not yet supported in the current latest version. It could also help for this
Soon, just finishing the refactoring of relatr which will be powered by nsd 👌

I'm excited to introduce Nostr Social Duck, or just NSD, a library I've been crafting over the last two weekends that brings sophisticated social graph analysis, even to hardware that doesn't have the luxury of abundant memory. This library leverages DuckDB to perform graph operations over Nostr social graphs built from Contact List events (kind 3), and it's designed to run on all sorts of hardware, from low-end devices to powerful servers.
The inspiration came from limitations I encountered with nostr:npub1g53mukxnjkcmr94fhryzkqutdz2ukq4ks0gvy5af25rgmwsl4ngq43drvk excellent nostr-social-graph library. While powerful, loading entire social graphs into memory becomes challenging, specially on resource constrained devices like older computers, mobile devices, Raspberry Pis, and similar environments. Once the graph grows, memory constraints can cause performance issues or outright failures.
The recent launch of Relatr and its inclusion in the Umbrel community store (thanks to nostr:npub1ye5ptcxfyyxl5vjvdjar2ua3f0hynkjzpx552mu5snj3qmx5pzjscpknpr ) got us thinking: how could we enable anyone to run this without being constrained by their hardware? Since disk storage is cheaper than memory, how we can balance the tradeoffs 🤔... That's when DuckDB emerged as the perfect solution
DuckDB is quite a cool piece of software that's been around for some time with an amazing team committed to open source. It's an embedded, in-process database designed to run on all sorts of hardware. What makes DuckDB particularly compelling for our use case are its advanced memory management capabilities. When complex queries require more memory than available, DuckDB automatically spills to disk, ensuring queries complete even if there is not enough memory, rather than crash. No memory, no problem.
This feature alone makes DuckDB a strong choice, but there's more. Its advanced analytic SQL capabilities make graph analysis operations possible and performant. NSD already provides methods to get the shortest distance between pubkeys, along with a complementary method to find the shortest path that returns both the path and distance. You can define a root pubkey which creates a temporary table with all distances precomputed, making subsequent queries much faster.
The library also includes methods for social graph analysis, like, get the degree of a pubkey, how many inbound and outbound connections it has, which helps determine the weight of a pubkey in the graph. There are convenient methods to check if one pubkey follows another or if two pubkeys are mutual follows. As well thanks to DuckDB in the future we could use parquet files to distribute social graph data. You can find all the details in the repo.
We're currently refactoring Relatr to use NSD, and the results are impressive. By replacing the previous combination of nostr-social-graph library and SQLite database with DuckDB and NSD, we've eliminated the inefficiencies of having separate data sources. Complex queries like profile search now benefit from analytical SQL directly in the search algorithm, reducing data transfer between the program and database and returning more relevant results efficiently.
I did some naive benchmarking to understand how it performs compared to the nostr-social-graph library, and it behaves pretty well. Both libraries are pretty close in performance when there's a root pubkey set in NSD.
This effort aligns with the ongoing #WoTathon organized by nostr:npub1healthsx3swcgtknff7zwpg8aj2q7h49zecul5rz490f6z2zp59qnfvp8p , as we believe NSD provides fundamental primitives for performing graph operations on everyone's hardware without sacrificing simplicity of use and deployment.
The library is available now and can be integrated into any js project:
```bash
bun add nostr-social-duck
# or
npm install nostr-social-duck
```
As we finalize the Relatr refactor, we'll share detailed insights about the improvements and performance gains. The combination of Nostr's decentralized social protocol with DuckDB's efficient analytics creates a powerful foundation for the next generation of social applications.
The library's repository: https://github.com/gzuuus/nostr-social-duck
Related DuckDD's blog posts:
- https://duckdb.org/2025/01/17/raspberryi-pi-tpch
- https://duckdb.org/2024/03/29/external-aggregation
- https://duckdb.org/2024/12/06/duckdb-tpch-sf100-on-mobile
If you like the project please consider supporting our work by zapping, or contribute to it's development
Time to build 💪
⚡️🎙️ NEW - Marijuana contributes to Brain Damage: “It’s a Weapon of Mass Destruction,” Says Dr. Daniel Amen
Dr. Daniel Amen, a psychiatrist and brain-imaging specialist, warns that marijuana use causes visible damage on brain scans, which he describes as producing a “toxic-looking brain.”
He specifically highlights the cerebellum — the area at the back-bottom of the brain that contains about 50% of the brain’s total neurons despite taking up only 10% of its volume.
➥ Just as heavy alcohol use is notoriously toxic to the cerebellum, Dr. Amen states that marijuana is similarly damaging to this region.
➥ The cerebellum was once thought to be mainly responsible for physical coordination and balance.
➥ Modern research shows it also plays a critical role in thought coordination — how quickly and efficiently you process, integrate, and retrieve information.
Because marijuana impairs cerebellar function, it literally slows down your thinking — making mental processing less sharp, less fluid, and slower overall.
In Dr. Amen’s words, marijuana acts like a “weapon of mass destruction” to the brain.
https://blossom.primal.net/81e6b6e0be997ae52ae5d480ebe57ac870ff203ba2f8d46c9373df1294e9e39f.mov
This is worse https://psycnet.apa.org/fulltext/2026-89350-001.html
GM 🌞
GM🌞
Yes, I agree. That's the reason behind the concept of 'common schemas' for CVM, so different servers can adhere to the same canonical schema. When integrating it with a client, if we use CVM, the user would only need to provide the public key of the server they want to use, or fall back to a default instance, that's it, we could use nprofiles to provide relay hints.
The current methods of the Relatr API are basically two: one is a pubkey lookup, which takes a target public key as a parameter, and the other is a search, which takes a query as a parameter. These methods have other optional parameters, but there is no need to define them unless you want to tweak.
On the other hand, I was thinking about using trust assertions in Relatr and publish scores once they are computed. In this case, a client could choose to simply fetch the trust assertion. However, this approach would be limited if it cannot find specific public keys. In that case, a call to a server would be required to get the score for the missing trust assertion
How are you doing this? I feel curious, I've already done some testing on streams over CVM, and it works out of the box using MCP notifications or resource subscription, as well as with the possibility of bidirectional communications between the server and client
Hey! Not exactly. Nothing is computed client side, the client simply makes a call to a Relatr server. The server computes the trust score based on social graph distance and custom validations. So yes, the scores are calculated by the service provider independently of clients . As we discussed a few days ago, we are considering adding trusted assertions to the mix. This way, a client can choose to either fetch published trusted assertions, call the server, or do both depending on it's needs
I meant to reply to this note. Do you know what caused your vps to get suspended? nostr:nevent1qqsdq9zrk4kusk8fjmjpszh0u0xvl8lnjh9g99zetj33pre2hzur8nql22qh9
The reason they gave me was a violation of their terms when I attempted to use Netplan to apply some DNS configuration that was corrupted after an OS upgrade. I don't know why the DNS configuration was corrupted after the OS upgrade. I lost access to the VPS as it was suspended. I opened a ticket, but they just reiterated over the violation of their terms and conditions
That's already possible, it's the whole idea behind CVM and Relatr. You can easily integrate it into any Nostr client without needing a service website. All you have to do is call the service using its pubkey and perform a search or look up an individual pubkey. So, if a Nostr client integrates this feature, users could specify their own instance for a personalized Web of Trust computation, or use the default Relatr service, or any other public instance. The only difference is the pubkey of the service. I've already heard from people who are implementing it in their clients.
NOO NOO Totally unrelated... blink blink Not just people breaking up with human partners and marrying an LLM, but also people using them for psychological treatment, echo chamber reinforcement, you'reabsolutelyrightooors, hallucinating mechines. None of that is related to people just feeling more and more distant from reality...
Just jumping in. Currently search results that exactly match the query get a slight boost to balance things out. But remember that relatr is about the point of view of the source pubkey, so for the same query, you can obtain different rankings depending on the source pubkey used for the measurement
GM🌞
GM🌞
GM🌞
Gm 🌞
Sharing things with Hypernotes? nostr:npub1p4kg8zxukpym3h20erfa3samj00rm2gt4q5wfuyu3tg0x3jg3gesvncxf8
Hype*notes
Lnvps, nymbox, orangewebsites, namecheap as well, https://bitcoin-vps.com/
The payload is signed by the author therefore if you trust the author you trust the payload
Hahaha i mean, im optimistic in that I'll be able to mitigate these vectors. Regular people are cooked
es, I agree, but 'being smart' is something that needs to be developed. XSS still exists and is used as an attack method, but for the majority of users, it doesn't represent a significant problem since developers typically follow best practices. These best practices are a compendium of knowledge and experience. I believe the same will happen with LLMs, even though it currently seems difficult and 'impossible' to solve. Common prompt injection patterns and methodologies could be mitigated. We will, of course, have more sophisticated attacks, but that also makes them more expensive since they would need to be highly personalized and subtle to bypass guardrails or whatever security methods we have in the future. However, this is just about prompt injection and not other LLM based attacks, such as impersonation, etc. In summary, we are still in the early
I agree, as well XSS isn't 'solvable,' but it can be mitigated. I think there are similarities here. Also, things can be very different in a few years, so I try not to speculate too much
Yes, definitely it's something unsolved in this rushed race to adopt AI recklessly
Yo we're at the beginning of this AI stuff, new tech new exploits, be mindful of this, act accordingly. BTW the whole interview worth it
Freedom hardware would be a good follow-up, but it won't be enough. The last frontier to free is the human mind
GM 🌞
Yes, that's cool(r) xD but messages are in plain text, just tested, so i can just subscribe and read the messages from everyone, which is cool if communication are not meant to be private


