Hi, All.

I recently developed a WebSocket server.

I plan to embed this WebSocket server into a future Nostr relay that I will develop, with enhanced documentation, comments, and testing.

https://github.com/Hakkadaikon/websocket/tree/main

By the way, there's something I've been thinking about lately.

Nostr runs on top of WebSockets, And WebSockets run on top of TCP/IP.

In the case of TCP/IP, data cannot be received in bulk using a system call, so we believe there is a problem in that it is difficult to improve performance beyond a certain level.

I believe that if Nostr were run over a UDP protocol such as WebTransport, RUDP, etc..., Nostr relay could operate even faster.

For a plain Nostr relay delivering text events, probably won't need to go this far.

However, I think this Nostr relay can be useful for delivering volatile, streaming, real-time data.

In the future, I plan to create a PoC that runs Nostr on the UDP protocol.

What do you think?

Comments, positive or negative, are welcome.

#nostr #grownostr

WebSocket is firmly established as the communication protocol for Nostr, at this point, and to break from that entirely would be to break compatibility with the larger network.

That said, I don't see a problem with relays offering different transport options for the same events. If every relay offers WebSocket, some may additionally offer protocol extensions to alternately use WebTransport or HTTP, for instance.

A client should be able to connect to any relay using WebSocket, but specialized relays offering additional communication protocol options may have a place.

Reply to this note

Please Login to reply.

Discussion

Thank you!

I will try to verify whether I can successfully implement the RUDP or WebTransport protocol stack as an extension protocol in the WebSocket server.

I will also check the nips issue (1671).

I don't think it should be an extension _to_ WebSocket, just that relays need some way of advertising "I can use RUDP!" or "I can use WebTransport!" so clients know which relays they can try to connect to using those protocols.

Definitely look into the NIP-91 proposal, like you mentioned; it may be a good fit for this.