-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIP-114: ids_only filter #99
base: master
Are you sure you want to change the base?
Conversation
We might want a |
Added |
Thanks for this! I'm looking into it. My first impression is that negentropy would be a more optimal solution. |
Negentropy is better for past data, but doesn't work for ongoing subscriptions. Both can be used, but this is a lot easier to implement in all clients. |
I think this is a pretty good idea. Did you try starting a discussion on this in the NIPs repo? I'm a bit hesitant to add non-standard protocol extensions unless there is some consensus. |
Found it: nostr-protocol/nips#1027 Yes I agree, this solves an issue that negentropy does not, and is in fact complementary to it. You could do an initial sync with negentropy and then stream new IDs down as they come in, without duplicating the download of full events. In fact, this may be quite useful for a nostr multiplexer I am working on. Let me think about this a bit more, but I'm leaning towards merging this. Thank you! |
I left some comments in the NIP above. In short, I think the I also think |
Thank you, good points. I can help if needed, but you're more familiar with the code and can probably implement it better. |
When a subscription has a filter with
ids_only: true
, the relay responds with[HAVE, subId, eventID]
messages. The client can then request the full event from only one relay instead of receiving it from all subscribed relays. If the event is already in a local database, the full event request can be skipped altogether.I have not implemented this for the
stream
command yet, but this could save a lot of bandwidth if you're connecting to many other relays and subscribing to everything.