Replying to Avatar JeffG

GM Nostr 🌞

🆘 I need feedback on an idea related to private group messages.

I'm working on the format for sending group messages via relays and had an idea on how to encrypt messages in a way that saves a lot of work for both relays and clients. But it has some tradeoffs. Here's how it works:

1. Imagine you have a group of n people. The group has an ID value (random string) and each group has shared context that means they will know how to decrypt messages but if you're not in the group, you won't be able to decrypt. This shared context rotates regularly, ensuring forward and PCS security.

2. To avoid having to send each participant a gift-wrapped message, we encrypt the message content using shared group secrets and put that in the content of a Nostr event. This is an encrypted blob that is NOT using NIP-04 or NIP-44 encryption, instead it will be using MLS native encryption which has information about the sender as well as the message content itself. This event is published to group relays using a disposable identity, not the user's main nostr identity.

3. We put the Group ID value in cleartext in an indexable tag on the Nostr event.

This last point is important. Let's break it down:

– Clients only have to publish a single event to send a message to all participants (nice) ,

– It's trivial for members of a group to watch for messages they care about via a tag filter (very nice) and ;

– (the tradeoff) Observers can see how many messages are being sent within a group and when they're being sent but they can't tell who is in the group or who is sending the messages.

I think that this is a fairly reasonable tradeoff. I'd love to hear thoughts or — even better — suggestions on how to improve this.

Sorry, I'm just Doug and this is beyond me. But I'm sure others with more brain cells will be able to weigh in on your innovative thought. Gonna go rip some bongs and try not to cry about being so foolish

Reply to this note

Please Login to reply.

Discussion

It's ok Doug. Remember, both sides of the curve win. While I think I'm on the same side as you, I'm sure neither of us are in the middle. 🫂

I know and agree...

To give you my thoughts... It seems the tradeoff is worth it. One thing worth asking from my perspective is : how necessary is it to actually save the work for clients and relays? Are they already, or presumably will be taxed for resources?

I think it is important. Less for relays and more for clients. Using gift wraps means that you're open to the possibility of getting DDOS'ed which messages that you have to decrypt to see if you're even interested in the content.

Having to send messages to many users (fanout) defeats one of the main reasons for using MLS in the first place. We want big groups to scale really well and be easy and fast for clients to update. In this way, they pull down only the events that they care about (for the groups that they're in) and only have to do a single decryption to get all the data they need to properly process the message content.