diff options
| author | Francisco Calderón <fjcalderon@gmail.com> | 2024-11-04 15:39:21 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-04 15:39:21 -0300 |
| commit | 03f3bc39678262ecbd5d870c9da44723023557ff (patch) | |
| tree | e75ecf32d3bc906a8b26314488a1ae90996169c1 /59.md | |
| parent | f72a2f69ed93cf442e83bf9e7e16f6c06da40384 (diff) | |
| parent | 6bcd89c097e97e65dbc95e7c6b7b8348e8dd6b5c (diff) | |
Merge branch 'master' into p2p-nip
Diffstat (limited to '59.md')
| -rw-r--r-- | 59.md | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -41,7 +41,7 @@ A `seal` is a `kind:13` event that wraps a `rumor` with the sender's regular key | |||
| 41 | to a receiver's pubkey but there is no `p` tag pointing to the receiver. There is no way to know who the rumor is for | 41 | to a receiver's pubkey but there is no `p` tag pointing to the receiver. There is no way to know who the rumor is for |
| 42 | without the receiver's or the sender's private key. The only public information in this event is who is signing it. | 42 | without the receiver's or the sender's private key. The only public information in this event is who is signing it. |
| 43 | 43 | ||
| 44 | ```js | 44 | ```json |
| 45 | { | 45 | { |
| 46 | "id": "<id>", | 46 | "id": "<id>", |
| 47 | "pubkey": "<real author's pubkey>", | 47 | "pubkey": "<real author's pubkey>", |
| @@ -60,7 +60,7 @@ Tags MUST must always be empty in a `kind:13`. The inner event MUST always be un | |||
| 60 | A `gift wrap` event is a `kind:1059` event that wraps any other event. `tags` SHOULD include any information | 60 | A `gift wrap` event is a `kind:1059` event that wraps any other event. `tags` SHOULD include any information |
| 61 | needed to route the event to its intended recipient, including the recipient's `p` tag or [NIP-13](13.md) proof of work. | 61 | needed to route the event to its intended recipient, including the recipient's `p` tag or [NIP-13](13.md) proof of work. |
| 62 | 62 | ||
| 63 | ```js | 63 | ```json |
| 64 | { | 64 | { |
| 65 | "id": "<id>", | 65 | "id": "<id>", |
| 66 | "pubkey": "<random, one-time-use pubkey>", | 66 | "pubkey": "<random, one-time-use pubkey>", |
| @@ -245,7 +245,7 @@ const rumor = createRumor( | |||
| 245 | const seal = createSeal(rumor, senderPrivateKey, recipientPublicKey) | 245 | const seal = createSeal(rumor, senderPrivateKey, recipientPublicKey) |
| 246 | const wrap = createWrap(seal, recipientPublicKey) | 246 | const wrap = createWrap(seal, recipientPublicKey) |
| 247 | 247 | ||
| 248 | // Recipient unwraps with his/her private key. | 248 | // Recipient unwraps with their private key. |
| 249 | 249 | ||
| 250 | const unwrappedSeal = nip44Decrypt(wrap, recipientPrivateKey) | 250 | const unwrappedSeal = nip44Decrypt(wrap, recipientPrivateKey) |
| 251 | const unsealedRumor = nip44Decrypt(unwrappedSeal, recipientPrivateKey) | 251 | const unsealedRumor = nip44Decrypt(unwrappedSeal, recipientPrivateKey) |