-
Notifications
You must be signed in to change notification settings - Fork 631
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-17 - Event Metadata #605
base: master
Are you sure you want to change the base?
Conversation
I like this and I've suggested this approach to people many times, but every time I did it wasn't well-received, so I don't know. |
For a fast user experience it is better showing counters faster with metadata from one of the relays instead of counting events from many relays for each counter. In fact, a client can choose to start showing the estimates while it gathers the right numbers on the background. |
NACK; this would be a hard-fork. If there's interest in this idea relays should send a new/separate command along with the I would probably still Concept NACK this idea, but at least this way it would not be hard-forking. I think this idea could be very centralizing, but I would want to hear @cameri and others' opinions. |
Why a hard-fork? These fields are not covered by the hashing or signature, they will be ignored by any parser that doesn't know about them. on the other hand we already have |
Isn't the idea that this would be embedded by the relay inside the event object? So to verify the signature, the client would need to strip this |
@pablof7z serialization for signatures is defined in NIP 01 using a list of event keys, ignoring any additional key attached by whomever, this won't cause any problems with that. |
I must be misunderstanding something, if the client generates the event, serializes (obviously without that I guess you guys must have in mind that this nip17 path is not injected into the event json but is delivered somewhere else? Where? To be clear, this 👇 would be hardfork but I guess this refers to something different? {
"content": "",
"created_at": 1683463120,
"id": "",
"kind": 1,
"pubkey": "",
"sig": "",
"tags": [],
"nip17": {
// stuff inserted by the relay that a client needs to strip out before checking
}
} |
I retire the hard-fork comment still don't think this is a good idea, it increases costs on relays, relays that adopt this will get beneficial treatment, etc etc, etc, [insert-reasons-why-BSV-is-stupid-here] |
I don't know how relays would handle the extra field, probably depends on implementation. Coracle at least would just ignore it. I think 1. we need something like this, and 2. this is probably not the solution. I'm still of the opinion that "extensions" should be handled by dedicated services and relays should have a mechanism for routing clients to those services based on functionality and data locality per this post (and I'm still waiting for your comment on #259 @pablof7z 😂). Should I go ahead and write a NIP to get the ball actually rolling? |
The increased relay cost of updating the numbers is worth it (well.. each relay can decide that) if you consider some clients may stop requesting a great number of reactions, reposts and so on, which is better($) for relays. I don't think it is a strong centralizing force cause I don't expect clients to stop connecting to non-supporting relays specially because of how NIP-65 works. |
@staab If I got it right, your routing functionality needs "extensions" that interoperate: so they need NIPs to say how things work. Your NIP-11 extensions PR seems compatible with this like: I still see no harm with some relays adding |
@arthurfranca that's correct, but of course this is all the hallucinations of a deranged mind at this point. But I think it would work. So what we need is 1. optional nips (like this one) that extension relays can implement, but much more importantly 2. a routing protocol to help clients get connected with relays that implement the functionality they need. Case in point, I currently hardcode nostr.band, purplepage.es, and some other things in Coracle. It would be much better to 1. look at the user's relay selections (or event hints and whatnot), 2. ask those relays who they recommend for various nips using the relay metadata document (they could recommend themselves) 3. use those recommendations to fulfill COUNT, search, etc. |
Counts are mostly irrelevant because, ideally, clients should not rely on a single relay to download information from. And if Clients get two counts from separate relays, it's impossible to know what was included in each count. If relay A brings a post with 7 likes, and relay B brings it with 9, what do you do? Assume B knows all 7 in A + 2 additional likes? Assume they are all different and move the count to 16? It's a mess. Other than that, the metadata is not verifiable. Clients will have to trust relays which is... not ideal. |
Yes, but recommended extensions can potentially fix this. I.e., you ask your 10 relays what nip 45 relay to ask for counts, and 6 of them recommend relay x, 4 relay y. So the client then asks x and y, reducing the overlap, or just relay x if it wants to be conservative. |
@vitorpamplona These numbers are simple estimates. The client just For an user browsing a feed, just knowing a note has "some" likes and replies may be enough for him to get interested, click the note and check out the replies. So the idea is that even estimates can be beneficial and avoid extra requests. The client decides if it wants accuracy or speed. Clients already won't choose 100% accuracy, which would need data from all relays. |
I am not against adding this. I just don't think it's that useful and it might lead to centralization in single relays. It's like the COUNT filter. People try to use it but invariably always go back to downloading everything because people complain about mismatches in the UI. It's more visible in reactions. If Amethyst shows 4 replies but loads 5 when clicked, there will be people in my neck complaining about it. But If somebody is actually using this (I suppose single-relay workspaces could use it), so be it. |
Should we delete the |
I wrote that NIP specifically to provoke conversations like this one. |
Is anyone using it? |
I think no one is using it, not even @staab. |
In fact I am |
I've proposed a potential solution to this problem a few times since February, but no one has seemed interested in talking about it, and I haven't had time to really build anything for it. #259 if you want to take the conversation over there. |
What if the metadata generation was done client-side?Clients could implement the aggregation of the data they receive, sign it and send back to the relay. Other clients could initially request the metadata, maybe even filter for a metadata generated by a specific trusted user. I think this could be achieved in two ways:
I think first option is ideal since it just adds new kinds and doesn't break with expected To demonstrate
|
@leoperegrino very creative solution. This could be implemented with a new event kind. These would become stale very quickly, so queries for the metadata would include a restrictive |
@staab thank you for the reply. I think the A few comments/suggestions:
|
to be precise, I think you meant:
When, and IF, we use this idea for a NIP, the term metadata would be just the aggregation of the original data. |
Small things, "NIP-17" already used in #324. |
@AsaiToshiya no problem I can update the PR if the #324 PR gets merged first. |
@leoperegrino creative indeed, it would be an additional option for clients to fetch such counter events from friends. Could be a new event kind with the same fields from NIP-17. However flooding relays with thousands of conflicting metadata counter events from thousands of users may not be a good idea. Maybe making the |
What about using an array of event ids instead of a count? It would enable clients to combine responses across subscribed relays. a shortened version of the event id could be used to save space. This could potentially be very short, trading off the occasional inaccuracy due to collisions against space usage. This would be more expensive for the relays to maintain, but potentially worth it for client performance? |
@DanConwayDev List of id suffixes (cause prefix may have "0" PoW chars) could work. Don't know the ideal char length though. Also don't know if relays would be willing to store this extra data, let's see what others say. Maybe limit the set length to a max like 200(?) which would still be useful to the less popular notes (majority of notes) to save disk space even more? Above that client can pick the higher regular int counter or the counter from the relay it trusts more. What about view count by ip? I suppose not all counters would use your set approach. |
I think this NIP, the way it is right now, is increasing relay responsibilities. It does not comply with the principle to keep relays dumb and adds a state management to them. However, self-signed metadata is very simple to implement in the client. I don't think it will flood the network since the application can aggregate and send metadata only when entering a particular event/thread. When in a feed, such as a global one, you are not expected to request all replies right away, so you just consume others metadata and don't produce them. As I suggested before, UIs can just indicate to the user that they have an estimate, not real data. And for server side, the relay can just set a threshold of many of the same event will be kept. This avoids increasing relay CPU usage with aggregation, solves the million queries problem and let relays focus only on event throughput. |
To be fair, we could have both: relay generated and self-signed metada. Each with its NIP. It could be announced by the relay which one is supported. But I guess the protocol should focus on scaling without server requirements, which should lead to greater decentralization. |
As the relay would be already storing extra metadata. I've made it searchable with NIP extensions. For now just language and country. This should help a lot with better global/featured feeds. |
Added some filters as optional NIP extensions to help clients find trending events. For example: If you think this is too much I could keep atleast the language one that is very helpfull. |
Simplified NIP text. Now there are just 3 fields and 3 filters that must be supported by relays. |
NIP text here