Consumie Dev Notes

Subscribe
Archives
November 14, 2024

Social Network #1: Nostr

Pretty much everything about Nostr is deeply offputting. It’s endorsed by Jack Dorsey. It talks about bitcoin way too much. It talks about being anti-censorship way too much. Nothing about it leads me to trust it.

That said, it offers a couple fairly easy libraries for setting up a Java-based relay, so let’s give it a try.

First off, have to update to Java 22. Java updates are always at least a little painful, but fine. Done. Upgrade Maven to the beta version, which is weird, but sure. Fine. Whatever.

I installed nostr-java (https://github.com/tcheeric/nostr-java) which went fine, but Superconductor (https://github.com/avlo/superconductor) was more of a jerk. I’m not actually clear on why I needed to have nostr-java running, since I also needed to grab it in my pom file (which required a little work to successfully get it from JitPack). Superconductor also uses h2 out of the box, so I updated it to use my Postgres server instead so I could see what it’s actually doing there.

So, now I theoretically have a relay set up and could point a client at it. I tried grabbing a few different ones, all of which had a lot of other default relays baked in, but none of them could connect to my new one UNTIL I figured out that it was rejecting all requests from anything but itself and needed a tweak to the WebSocket.

Here’s where Nostr really started to lose me. To create an event, the client has to provide both the public key and a signature created with the private key. So far so good. As far as I can tell, though, the server doesn’t care at all. I’ll have to check some of the other implementations, but Superconductor creates events even with totally made up signatures. This seems extremely weird to me, but I guess I could probably go in and figure out how to add that. I’ll mess with this some more tomorrow.

Don't miss what's next. Subscribe to Consumie Dev Notes:
Powered by Buttondown, the easiest way to start and grow your newsletter.