GM! ☕

E2EE event storing on nostr

Expectations:

- Encrypted data and metadata: Relay shall not know the metadata, nor the content stored

- Each event has "unique" owner: Relay shall not be able to group data per owner

- Each event encrypted with a unique key: Leaking an event encryption key shall not allow to decrypt all events stored

- Event compromise: Leaking account privatekey shall not compromise event

- Key offline policy: Event encryption keys shall not be stored on the internet

- Owner exclusivity: Only owners shall be able to query their own encrypted notes

What else is missing? Please give me a different view.

#asknostr

Reply to this note

Please Login to reply.

Discussion

Lemme think...

My simple model is that keys, data and code can be stored independently and brought together to be instantiated as a computational component. Apart, keys, data and code are useless, but together, they work.

Do you operate in an untrusted environment?

That’s the starting assumption.

To let the user be able to assemble his keys, data and code, he needs to store this logic somewhere right? But then if you store this encrypted with the users nsec, then an nsec leak leads to total leak. So how do you make sure, the users nsec leak does not lead to full compromise?

Every component has its own self-generated nsec. No relation to the users nsec. It’s the job of whatever client to protect the nsecs. I don’t want to store any user data, especially the user’s nsec. If the component nsec is compromised, burn the data asap to another self-generated nsec.

And who stores the component nsec?

That's the job of the controlling app to determine.

# ☕⚡🇧🇷GM

The side effect is that you cannot switch DM clients without losing all your messages. Since it's not linked to the nsec and the other keys are not saved online, now you key backup must include the extra info to load your DMs into other clients. Which breaks nostr's default interoperability. And if you have a second backup, that backup can then leak and reveal all your DMs to others. If you want your DMs in other clients, the risk of leaking your DM key is the same as leaking your nsec.

I was thinking more in the direction of general data like health records, or so.

But you are right, the above does not mention or solve multi device use. If your device is lost, how is this solved? Or how to sync between devices.

If you want instant online sync, you need your keys online. Yes. You are right. But that is less safe. And if you store your keys encrypted with your nsec, your not in a better position as you mentioned either.

I would differentiate between 2 solutions:

- Generally the data is local, you "just" sync between devices. Basically SyncThing.

- Generally the data is online, and you can access it from anywhere around the world. Basically NextCloud, OwnCloud, etc.

I think, Signal protocol and MLS in general deals with sending information in an encrypted manner with ephemeral keys, that are only used for one message, and then thrown away. So DMs are handled as local approach. It is encrypted in transit with a throwaway key, then locally it can store it with a different key again. How the history sharing is done, I am not sure, but probably done like SyncThing, and has to be only done once, because new messages are already sent to the new device.

I was thinking in the direction of the data online scenario.

What if, we combine my outlined expectations with MLS.

1. You have a main device, that encrypts data, every event with a different key, and stores it on relays. Keys stay only local.

2. When introducing a new device, you setup a double ratchet with other device, and send every generated new key to the other device.

Then encryption keys stored on relays will have the properties of MLS.

So basically your data is online approach, your encryption keys are local approach.