Skip to content
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

User Labels/Petnames #44

Closed
vicariousdrama opened this issue Mar 29, 2024 · 1 comment
Closed

User Labels/Petnames #44

vicariousdrama opened this issue Mar 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@vicariousdrama
Copy link
Owner

Add support to Corny Chat to load all pet names authored by the user (filter: {authors: [userpubkey], kind: [1985,30382]}) and cache in the session storage.

Reference the session storage of these labels when rendering the names of the following places

  • avatars in the room (speaker array, audience array)
  • room settings: speakers
  • room settings: moderators
  • room settings: owners
  • profile of a user

Allow a user of Corny Chat to assign a label by viewing the profile of a user and inputting a petname.


NIP-32: Labeling
https://github.com/nostr-protocol/nips/blob/master/32.md

If using NIP-32, its kind 1985. The namespace L used is com.cornychat. The label l can be petname with the content field reflecting the petname given

Note that NIP-32 ends with this

A good heuristic for whether a use case fits this NIP is whether labels would ever be unique. For example, many events might be labeled with a particular place, topic, or pubkey, but labels with specific values like "John Doe" or "3.18743" are not labels, they are values, and should be handled in some other way.

Another weakness is that these are long lived, non-temporal labels.


Alternative NIP-81: Relationship Status
https://github.com/vitorpamplona/nips/blob/relationship-status/81.md

This approach uses a replaceable kind 30382, where the d tag is the targeted pubkey being associated, and n tags for theoretical lists. A petname can be used for assigning the label that the user should see in place of the target's self identified name per kind0. The following example optionally encrypts the petname and a summary tag, both of which can be plaintext tags

{
  "kind": 30382,
  "tags": [
    ["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"],
    ["n", "Follows"],
    ["n", "Bitcoiners"],
    ["n", "6064460175057025"]
  ],
  "content": nip44Encrypt(JSON.stringify([
    ["petname", "NVK (Coldcard)"],
    ["summary", "Owes me a beer"]
  ])),
  // ...other fields
}

As a replaceable, special care must be taken when creating and editing the petname of a user to check for existing definitions, and ONLY update the relevant field (e.g. the petname) while keeping the lists (n tags) and others intact.

@vicariousdrama vicariousdrama added the enhancement New feature or request label Apr 3, 2024
vicariousdrama pushed a commit that referenced this issue May 5, 2024
@vicariousdrama
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant