Skip to content

Update NIP-56 to handle more detailed content moderation and generic labeling#524

Closed
staab wants to merge 1 commit intonostr-protocol:masterfrom
coracle-social:ratings
Closed

Update NIP-56 to handle more detailed content moderation and generic labeling#524
staab wants to merge 1 commit intonostr-protocol:masterfrom
coracle-social:ratings

Conversation

@staab
Copy link
Copy Markdown
Member

@staab staab commented May 13, 2023

Purpose

Content reporting is a type of labeling. In #459, @Gruruya proposed expanding NIP-56 to encompass labeling.

In #457, @s3x-jay and @rabble proposed a nomenclature and more comprehensive mechanism for content reporting/labeling. The consensus seems to be that a nomenclature is not a good idea, but there were some good ideas to include.

In #522 (comment) I realized that the same labeling mechanism could be used to leave reviews for relays, which I am eager to add to Coracle so people can start to find a better relay selection.

This PR may also render #46 obsolete.

Justification

Maybe this will seem like I'm trying to make a single NIP do too many things. But reviews, labels, and reports all have two things in common: they refer to an object, and are an expression of someone's opinion. In each case, there is a value judgment involved in assigning the label, involving both imprecision and uncertainty. Expressing this opinion using either a mark, or content, or both, allows either a machine or human to make a judgment call as needed.

One nice thing I'd also like to point out about this PR is if clients follow the bi-directional tagging rule, it allows for associating any two entities (e/p/r/t) in nostr, and searching those associations. This gives us the beginning of graph-database-like functionality that can form the basis for both WoT and topical moderation and recommendations.

Confidence/quality may seem like the same thing, but they're two different axes along which to measure certainty. The first is subjective (the label author may not be 100% sure), the second objective (the label may not perfectly fit). This has been suggested in a few places, but was best executed by guide.newfounding.org (unfortunately their site is no longer available).

Compatibility

This PR should be backwards-compatible "enough" with the old version of NIP-56, but if there's disagreement on it, I can re-draft as a separate NIP. I'm particularly interested here in @jb55's feedback since he wrote the original version and is probably the only person who is relying on its implementation.

The only backwards-incompatible change I had to make is that context must now be marked by a context tag. My sense is that the p tag was originally required so that a given event could be located. I don't expect that anyone has implemented any automatic routing based on the p tag, and clients that continue to include a p tag will simply be reporting the pubkey in addition to the event, which seems to be acceptable semantically.

Other minor changes:

  • e tag is now optional
  • The report type (now "label") is now optional, and is no longer required to use a given vocabulary. Tags without labels are allowed, since sometimes it might make sense to only leave a review in content, or if the quality and confidence tags are sufficient.

Implementation

None of this is implemented, but my main motivation of drafting this PR is so I can add relay ratings and reviews to Coracle soon.

@Gruruya
Copy link
Copy Markdown

Gruruya commented May 13, 2023

https://github.com/staab/nips/blob/ratings/56.md

I see you kept quality between 0 to 1, do you want to include a seperate tag like [negative, true/false] that could be better queried?

@mikedilger
Copy link
Copy Markdown
Contributor

The meaning of the fields in a tag has not depended on the event kind before. Here we have an 'e' tag where the meaning of the fields is different then every other e tag in every other kind. This complicates my code lots. So I'm against unless this can be changed.

@Gruruya
Copy link
Copy Markdown

Gruruya commented May 14, 2023

That isn't new, it's how kind 1984 is already described.

nips/56.md

Line 24 in 00491aa

A `report type` string MUST be included as the 3rd entry to the `e` or `p` tag

It may be better to eschew kind 1984 for a different structure, but it's been kept this way for backwards compatability.
I'm starting to think it would be better to just use a new kind and do it right as 1984 seems mostly unimplemented (rightfully so.)

@staab
Copy link
Copy Markdown
Member Author

staab commented May 14, 2023

Yes, the intention was for backwards compatibility, but I agree that the structure used in 1984 is abhorrent. I'll draft a new PR this week with a cleaner implementation.

@staab
Copy link
Copy Markdown
Member Author

staab commented May 14, 2023

I see you kept quality between 0 to 1, do you want to include a seperate tag like [negative, true/false] that could be better queried?

As I was putting this PR together, I came to the conclusion that negation isn't necessary if you think in terms of a venn diagram rather than vectors to/away from a target. In the former metaphor, a negative match makes no sense, since 0 indicates no overlap, IOW a total negation. The latter might indicate toward (+1) or away from (-1) some target or standard, but that metaphor only applies to some concepts (you might be able to justify negative quality, but not negative confidence). So my preference is now a spectrum of 0 to 1, I think it's much cleaner.

Querying the tag is another question, I'll think about how that might be accomplished.

@Gruruya
Copy link
Copy Markdown

Gruruya commented May 15, 2023

Here's what I'm thinking so far; single reference, multiple labels.

{
  kind: ???
  tags: [
    ["p", <pubkey>],
    ["t", "label"],
    ["t", "label2"]
  ]
}

Any tags attached to the event besides tags in the spec like e/p/r could be interpreted as applying to what's referenced.
So you could apply a description tag to a relay for instance, or even an updated relay url to an event.

I see two ways in which l tags extend t tags, namespaces and quality. I say we make namespace the third field and quality the fourth, assuming the default namespace: topic and quality: 1. I think simply extending t tags seems like the right way to go instead of introducing a new, strict superset, tag and it seems you agree. I want to include quality on the label-level so that different labels in the same event can have different qualities.

Keeping confidence as a special tag for labeling events is fine as confidence doesn't make much sense when tagging your own event, and in this case the downside of applying to all labels in the event is acceptable IMO.

Other thoughts:
I think we should keep the context tag you introduced, I like it.
With my described changes, you would lose the ability to specify the quality of a reference without a label, but you could use a blank label to achieve something similar.

@staab
Copy link
Copy Markdown
Member Author

staab commented May 15, 2023

Closed in favor of #532

@staab staab closed this May 15, 2023
@staab
Copy link
Copy Markdown
Member Author

staab commented May 15, 2023

@Gruruya I don't mind any suggestions you made above, but I went a slightly different direction with the new PR. There is a trade-off between being able to apply multiple labels to a single entity vs applying a single label to multiple entities, I went with the latter in the new PR. I removed context, since that was mostly to support NIP 56, which I've decided not to touch for now. I do think namespace is helpful, I'm ambivalent as to whether it should be included in a label, except that defining fewer tags keeps things simple, and a slash is trivial to parse.

@Gruruya
Copy link
Copy Markdown

Gruruya commented May 15, 2023

There is a trade-off between being able to apply multiple labels to a single entity vs applying a single label to multiple entities

I'll write something, I want multiple labels for one reference as I expect to be doing a lot of mass-tagging. It seems two seperate implementations may be necessary.

@staab
Copy link
Copy Markdown
Member Author

staab commented May 15, 2023

Ok, I can take another look. I suppose we could just support multiple labels and multiple targets, with the implication being that all labels are applied to all entities.

@staab staab deleted the ratings branch October 26, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants