nostr-sdk / nostr-sdk-ios

Nostr SDK for Apple Platforms is a native Swift library that enables developers to quickly and easily build Nostr-based apps for Apple platforms.
https://nostr-sdk.github.io/nostr-sdk-ios/documentation/nostrsdk/
MIT License
24 stars 14 forks source link

Separate / allow for networking only #145

Open alltheseas opened 7 months ago

alltheseas commented 7 months ago

user story

As a nostr app dev who has strong preferences on app specific choices, I would love for nostr SDK to handle networking only, so that I can focus on app specific changes without having to worry about networking and compatibility with other clients & relays.

acceptance criteria

  1. Nostr SDK implements best practice (e.g. outbox model) network connectivity to relays

performance requirements for Damus

@jb55 to provide

builds on

Add outbox to NDK https://github.com/nostr-sdk/nostr-sdk-ios/issues/146

jb55 commented 7 months ago

On Mon, Apr 15, 2024 at 09:46:24AM GMT, alltheseas wrote:

user story

As a nostr app dev who has strong preferences on app specific choices, I would love for nostr SDK to handle networking only, so that I can focus on app specific changes without having to worry about networking and compatibility with other clients & relays.

acceptance criteria

  1. Nostr SDK implements best practice (e.g. outbox model) network connectivity to relays

performance requirements for Damus

@jb55 to provide

yes I think having networking cleanly separated is pretty key.

I want to just hand nostr-sdk a filter and have it know what relays to connect to. The more standardization around how notes are fetched, the better compatibility between clients when it comes to fetching notes.

Obviously this is quite hard, as the SDK must know about the context in which it is pulling the note, and the relay list associated with the outbox request. This is another reason I have yet to implement it, since it is not a simple interface.

In my use case, I really only want the raw data back, unparsed. I admit this is probably out of scope for the sdk as its a unique nostrdb requirement, since nostrdb parses and validates notes very efficiently. I even going as far to only partially parsing the JSON if we already have the note, which can be a big deal on large notes like contact lists.

If this is too much of a requirement, I'm happy just using nostr-sdk for bits of code that I need, such as nip44, etc.