upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiatjaf <fiatjaf@gmail.com>2025-10-08 09:52:21 +0000
committerfiatjaf <fiatjaf@gmail.com>2025-10-08 09:52:21 +0000
commit5de76542c345475a05d31aca40d608e3070cb6ad (patch)
tree62e1032b349457d6ce919e6fc1e79d22bc8ae947
parentdb85e13a58594a66d9084ddeb24e196263d24744 (diff)
grammar.
-rw-r--r--4e.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/4e.md b/4e.md
index 548d9a6..67f2021 100644
--- a/4e.md
+++ b/4e.md
@@ -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
435. 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` 435. 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`
446. Because Alice knows `e` Alice can decrypt Bob's message doing `ecdh(e, B) = S` and all is good 446. Because Alice knows `e`, she can decrypt Bob's message doing `ecdh(e, B) = S` and all is good
457. 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. 457. 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.
468. **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): 468. **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
599. **Tortilla** cannot proceed without known the secret key `e`, so it has to tell the user to turn **Cope** on. 599. **Tortilla** cannot proceed without knowing the secret key `e`, so it has to tell the user to turn **Cope** on.
6010. 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`: 6010. 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
7412. 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. 7411. 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