Introducing NIP-101, a standard way of doing HTTP Requests with Relays for data.
Discussion
Hmm đ§ But nostr is over websockets, mixing HTTP into the mix seems a bit out of whack? nostr:npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6
Relay is simply a data store with some basic realtime features, why not have http as an option for more static apps?
If you need an API to publish or receive events over WebSockets from the command line, you can use this one (there is also a prototype HTTP client and server that sends/receives #nostr events) https://github.com/pedro-vicente/nostr_client_relay
This is cool, but I would rather be able to use curl and in some nostr apps (like nblog) I would prefer to just be able to make a one off http request on the server rather than opening a websocket connection.
That doesn't justify making the protocol a much more complicated thing for everybody. WebSockets are simple, simpler than HTTP and REST, to be fully honest. If you don't like them that means you're just not used to them. You can use a Nostr library that abstracts that for you.
If you want a curl-like experience on the CLI, use https://github.com/fiatjaf/nak
Yes, that was kind of what my point was âif it ain't broke, don't fix itâ. As #nostr devs, we shouldnât have to deal with the underlying transport, we just use libraries that abstract that from us. I believe most languages have a WebSockets library. In my case, when I started with Nostr, it took me a week to find a good C++ library that I was happy with, but now I just use it and donât care what happens under the hood. And because there was no Nostr C++ API, I made one. Check it out https://pedro-vicente.net/nostr/nostr.html
We should strive to have just one way of doing things.
This would also be a fantastic stepping stone for implementing "file relays", where images could be stored in binary formats instead of text
I am all for that. But we should just go there directly, not mixing events in the middle.
Let's make another protocol that is just that, give it a different name, and write different software for it.
?cid=586b07f0p84sl86mxc6ven49zchbckk1arhfwo6i5k9j4ph3&ep=v1_gifs_search&rid=200w.gif&ct=g
there already is file sharing protocols like torrent, ipfs
we could probably build a simple hash addressed file relay system, but torrent like p2p would relieve a lot of the burden
zapping for priority service could help fund it, incentivize nodes
They both kind of suck
whats the bad points off the top of your head?
When I was trying to bootstrap dpm's codebase, I wanted to use webtorrents as a way to download files as this would be very decentralized. I couldn't even get it to download a single mb from various different servers. Same with IPFS, simply did not work.
Did you use trackers?
Was that in NodeJS? You probably just couldn't connect to the other node that had the file. No one promised automatic holepunching.
Yes. I tried uploading the file to a remote tracking service and my local qbittorrent couldn't find anything. I tried doing it on the same local network it node seeding it, qbittorrent seeding it instead, etc etc. would not work.
hypercore had really good holepunching which not surprisingly became holepunch.to
ipfs had poor holepunching but a year or so ago libp2p used by ipfs improved it quite a lot
IPFS sucks, torrents don't.