Some thoughts *before* I read the draft NIP.
I think we should propose an #MLS cipher suite that uses secp256k1 and reserve an identifier for it. That way we it can use libsecp256k1.
The secp256k1 curve can be used for both key exchange (xonly?) and (BIP340 schnorr) signatures. This curve is not yet listed under the recommended MLS Cipher Suites.
By carefully picking the other parameters it may be easier for Bitcoin signing devices to keep your chats ultra secure. And if a nostr client is already using some Bitcoin related library, then it's great if it already has the required ciphers.
Meanwhile rfc9420 has a mandatory-to-implement cipher suite MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519. This is useful for interoperability with other social networks, but that seems low priority to me compared to being simple to implement. And with respect to not adding more dependencies and not increasing the attack surface of cryptographic implementation errors.
MLS supports switching ciphers for existing groups, so we can always add compatibility later. Or secp256k1-pill the other networks :-)
For the hash function sha256 makes the most sense.
For AEAD ChaCha20Poly1305 is used in BIP324 (encrypted p2p transport) as well as the Stratum v2 noise protocol.
Not sure what to pick for the Key Encapsulation Mechanism (KEM), or maybe that's already covered by ChaCha20Poly1305?
So CipherSuite name MLS_256_???_CHACHA20POLY1305_SHA256_Secp256k1.
rfc-editor.org/rfc/rfc9420.htmlRFC 9420: The Messaging Layer Security (MLS) ProtocolMessaging applications are increasingly making use of end-to-end security mechanisms to ensure that messages are only accessible to the communicating endpoints, and not to any servers involved in…Sjors Provoost
sjors@sprovoost.nl
It looks like nostr might really be stealing some bitcoin talent and attention
The French government annoyed me into reading the spec :-)
Glad you're involved with both protocols 🤙
I do not agree with this zero sum attitude towards developer attention. How do you steal something that is given freely? Nostr and bitcoin are built on voluntarist principles. Naturally, some of the same people take an interest in both networks. Ensuring private, secure, and free speech is not less important than private, secure, free money.
Agreed. Sarcasm doesn't always come across so great
It looks like @JeffG's current NIP proposal doesn't go into detail yet about the choice of ciphersuites. It does consider many other aspects of how to integratate this with Nostr. So that's next on my reading list.
Hey @sjors! Thanks for taking the time to write this up. I was thinking the exact same thing. I have been in touch with various MLS folks (both those working on the spec but also those working on the OpenMLS implementation). They are open to the idea and suggested that we create it as a custom ciphersuite so we don't have to wait on IANA to give us an identifier.
For now, I'm more concerned with getting the rest of the NIP finalized and implementing it with the default ciphersuite to make sure that we have a working solution. As you say, we can deal with the custom ciphersuite later and upgrade groups.
I suppose that for a prototype the default-mandatory ciphersuite is fine. But I would hold off on finalizing the NIP until we have custom ciphersuite. Otherwise every Nostr client out there starts pulling in random dependencies from all over the internet.
... (well that might happen anyway, because you can't stop people as soon as a prototype works)
Let's get that IANA request done as soon as possible. It's simple paperwork, but it takes time to go through (months).
You have any experience with that @Vitor Pamplona?
Not personally, but close colleagues did a few of those. 4-5 months to get a response.
As soon as possible, but not before the cipher is well chosen. And that should depend on actual implementation experience.
I also don't think there's much of a rush. Once there's an "official" number assigned, we recommend that clients use it. But until then the private usage number is just fine.
What is most useful I think is to have more eyes on it, which the application process should achieve. And it's nice to have things buttoned up eventually.
I've spent like 9 months building github.com/VnUgE/noscrypt mostly around nip44, so I'm really hoping y'all can get us a spec that doesn't require another couple years of development for library devs :)
Does my list above, or the RFC, have anything that looks particularly attractive or terrible?
ChaCha20Poly1305 is a great choice on mobile due to lack of AES hardware acceleration. It’s also available natively in Apple’s CryptoKit as well as Google’s BoringSSL. I used it for Photon’s encrypted cloud backup for these reasons.
Bookmarked