diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2025-10-08 09:52:21 +0000 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2025-10-08 09:52:21 +0000 |
| commit | 5de76542c345475a05d31aca40d608e3070cb6ad (patch) | |
| tree | 62e1032b349457d6ce919e6fc1e79d22bc8ae947 | |
| parent | db85e13a58594a66d9084ddeb24e196263d24744 (diff) | |
grammar.
| -rw-r--r-- | 4e.md | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -40,9 +40,9 @@ There are probably other advantages to not tying the user's identity to the keys | |||
| 40 | } | 40 | } |
| 41 | ``` | 41 | ``` |
| 42 | 42 | ||
| 43 | 5. Now **Bob** (keypairs `(b, B)`) will send a DM to **Alice**. Because Bob's client fetched Alice's `kind:10044` event, instead of computing the conversation key with `ecdh(b, A)` he does `ecdh(b, E) = S` | 43 | 5. Now **Bob** (keypair `(b, B)`) will send a DM to **Alice**. Because Bob's client fetched Alice's `kind:10044` event, instead of computing the conversation key with `ecdh(b, A)` he does `ecdh(b, E) = S` |
| 44 | 6. Because Alice knows `e` Alice can decrypt Bob's message doing `ecdh(e, B) = S` and all is good | 44 | 6. Because Alice knows `e`, she can decrypt Bob's message doing `ecdh(e, B) = S` and all is good |
| 45 | 7. Now the fun part starts: Alice has decided to use a client called **Tortilla** to chat on her phone, and **Tortilla* wants to do encryption stuff. | 45 | 7. Now the fun part starts: Alice has decided to use a client called **Tortilla** to chat on her phone, and **Tortilla** wants to do encryption stuff. |
| 46 | 8. **Tortilla** sees that Alice has a `kind:10044` published, which means **Tortilla** won't create a new key, **Tortilla** will have to ask for **Cope** to share that key securely. So **Tortilla** generates a local keypair `(t, T)` that won't be shown or leave the device ever, and **Tortilla** publishes an announcement (`kind:4454`) for that local key (signed by Alice): | 46 | 8. **Tortilla** sees that Alice has a `kind:10044` published, which means **Tortilla** won't create a new key, **Tortilla** will have to ask for **Cope** to share that key securely. So **Tortilla** generates a local keypair `(t, T)` that won't be shown or leave the device ever, and **Tortilla** publishes an announcement (`kind:4454`) for that local key (signed by Alice): |
| 47 | 47 | ||
| 48 | ```jsonc | 48 | ```jsonc |
| @@ -56,22 +56,22 @@ There are probably other advantages to not tying the user's identity to the keys | |||
| 56 | } | 56 | } |
| 57 | ``` | 57 | ``` |
| 58 | 58 | ||
| 59 | 9. **Tortilla** cannot proceed without known the secret key `e`, so it has to tell the user to turn **Cope** on. | 59 | 9. **Tortilla** cannot proceed without knowing the secret key `e`, so it has to tell the user to turn **Cope** on. |
| 60 | 10. Alice opens up **Cope** and **Cope** immediately looks for all `kind:4454` events from Alice, and sees that there is this app called "Tortilla on Android" signed by Alice herself, so **Cope** publishes the secret key `e` nip44-encrypted to `ecdh(c, T)` -- in which `c` is the secret key of a keypair that **Cope** has just generated locally. **Cope** does that using a new event, `kind:4455`: | 60 | 10. Alice opens up **Cope** and **Cope** immediately looks for all `kind:4454` events from Alice, and sees that there is this app called "Tortilla on Android" signed by Alice herself, so **Cope** publishes the secret key `e` nip44-encrypted to `ecdh(c, T)` -- in which `c` is the secret key of a keypair that **Cope** has just generated locally. **Cope** does that using a new event, `kind:4455`: |
| 61 | 61 | ||
| 62 | ```jsonc | 62 | ```jsonc |
| 63 | { | 63 | { |
| 64 | "kind": 4455, | 64 | "kind": 4455, |
| 65 | "pubkey": "<A>" | 65 | "pubkey": "<A>", |
| 66 | "tags": [ | 66 | "tags": [ |
| 67 | ["P", "<C>"] | 67 | ["P", "<C>"], |
| 68 | ["p", "<T>"] | 68 | ["p", "<T>"] |
| 69 | ], | 69 | ], |
| 70 | "content": "<nip44(content=e, conversationkey=get_conversation_key(c, T))>" | 70 | "content": "<nip44(content=e, conversationkey=get_conversation_key(c, T))>" |
| 71 | } | 71 | } |
| 72 | ``` | 72 | ``` |
| 73 | 73 | ||
| 74 | 12. Immediately **Tortilla** wakes up and sees the `kind:4455` that had just been published by **Cope**, decrypts the content using `ecdh(t, C)` and now **Tortilla** also knows the secret key `e`. **Tortilla** can now decrypt and encrypt the same things **Cope** could before. | 74 | 11. Immediately **Tortilla** wakes up and sees the `kind:4455` that has just been published by **Cope**, decrypts the content using `ecdh(t, C)` and now **Tortilla** also knows the secret key `e`. **Tortilla** can now decrypt and encrypt the same things **Cope** could before. |
| 75 | 75 | ||
| 76 | ### The protocol flow again, now in a colorful infographic | 76 | ### The protocol flow again, now in a colorful infographic |
| 77 | 77 | ||