Skip to content

nchat#1448

Open
v0l wants to merge 1 commit into
masterfrom
nchat
Open

nchat#1448
v0l wants to merge 1 commit into
masterfrom
nchat

Conversation

@v0l
Copy link
Copy Markdown
Member

@v0l v0l commented Aug 27, 2024

To make it possible to create a link to a DM chat with another user we should add a new TLV HRP for chats

Copy link
Copy Markdown
Collaborator

@vitorpamplona vitorpamplona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

Comment thread 17.md

## NIP-19 entity
To create an `nchat` link:
- `kind`: `17`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct kind is 14

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind is NIP number not event kind

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use the NIP number instead of just the chat kind?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea maybe it makes more sense to use the kind number, originally i had the HRP as nchat17 and nchat28 but decided to change it last minute to use the kind entry.

Comment thread 17.md
## NIP-19 entity
To create an `nchat` link:
- `kind`: `17`
- `special`: one or more pubkeys concatenated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not concatenate but add all pubkey hexes in a TLV list (which is already been used for relays).

May need to note that the order of keys doesn't matter.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have multiple special entries but idk if thats a problem for some clients

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May need to note that the order of keys doesn't matter.

Wouldn't that mean that there would be multiple equivalent entities for a single chat? That would be fine for some use cases, but it would be nice to have a unique ID for chats for use cases like this one

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's going to be hard to trust people do this correctly, but we can request the list to be in ascending order by pubkeys.

But I would parse and resort it myself before doing anything with it.

Comment thread 28.md
## NIP-19 entity
To create an `nchat` link:
- `kind`: `28`
- `special`: `id` from `kind: 40`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need nchat for public chats? I just use nevents as usual.

@fiatjaf
Copy link
Copy Markdown
Member

fiatjaf commented Aug 27, 2024

What is the point of this? Can't you chat with someone just from their npub or nprofile?

@vitorpamplona
Copy link
Copy Markdown
Collaborator

What is the point of this?

It creates a link that apps can parse and send the user straight into a DM chat with a group of users. Very useful.

@v0l
Copy link
Copy Markdown
Member Author

v0l commented Aug 28, 2024

What is the point of this? Can't you chat with someone just from their npub or nprofile?

Can also be used for NIP-29 chats with relay and g tag

@fiatjaf
Copy link
Copy Markdown
Member

fiatjaf commented Aug 28, 2024

I didn't know you were doing chats with groups of users. How do you do that? Maybe write that on the NIP then, because if it's with a single user only I don't see the point.

NIP-29 chats can be referred to with an naddr very easily, I don't think this is necessary -- but I guess it can be used instead if it gets adopted.

@vitorpamplona
Copy link
Copy Markdown
Collaborator

How do you do that?

NIP-17 allows you to p-tag many people and send individual wraps to each of them. They define a group. It's like an email with many to's :)

@v0l
Copy link
Copy Markdown
Member Author

v0l commented Aug 29, 2024

NIP-29 chats can be referred to with an naddr very easily, I don't think this is necessary

Its probably less important for web apps, but for native apps who want to link to nostr dms you cant really do it with npub because it would just go to profile, nostr:npub vs nostr:nchat

I use something like nchat on snort already and though i would be useful for others: https://snort.social/messages/nchat171qgsyvrp9u6p0mfur9dfdru3d853tx9mdjuhkphxuxgfwmryja7zsvhq854tnh

Comment thread 17.md
The main limitation of this approach is having to send a separate encrypted event to each receiver. Group chats with more than 100 participants should find a more suitable messaging scheme.

## NIP-19 entity
To create an `nchat` link:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A blank line is needed between 126 and 127 for expected rendering.

Comment thread 28.md
```

## NIP-19 entity
To create an `nchat` link:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A blank line is needed between 136 and 137 for expected rendering.

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.

5 participants