diff --git a/46.md b/46.md index 15281162..863bab23 100644 --- a/46.md +++ b/46.md @@ -56,7 +56,7 @@ nostrconnect://?relay=&metadata { "kind": 24133, "pubkey": "eff37350d839ce3707332348af4549a96051bd695d3223af4aabce4993531d86", - "content": nip04({ + "content": encrypt({ "id": , "method": "sign_event", "params": [json_stringified(<{ @@ -66,7 +66,10 @@ nostrconnect://?relay=&metadata created_at: 1714078911 }>)] }), - "tags": [["p", "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"]], // p-tags the remote user pubkey + "tags": [ + ["p", "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"], // p-tags the remote user pubkey + ["encrypted", "nip04"] // specifies the encryption used + ], } ``` @@ -76,14 +79,33 @@ nostrconnect://?relay=&metadata { "kind": 24133, "pubkey": "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52", - "content": nip04({ + "content": encrypt({ "id": , "result": json_stringified() }), - "tags": [["p", "eff37350d839ce3707332348af4549a96051bd695d3223af4aabce4993531d86"]], // p-tags the local keypair pubkey + "tags": [ + ["p", "eff37350d839ce3707332348af4549a96051bd695d3223af4aabce4993531d86"], // p-tags the local keypair pubkey + ["encrypted", "nip04"], // specifies the encryption used + ] } ``` +#### Encryption + +An `encrypted` tag MAY be included in kind 24133 events to specify the encryption method used. +The tag is in the form: + +``` +["encrypted", ""] +``` + +Where encryption is one of: + +- `nip04` - NIP-04 encryption +- `nip44` - NIP-44 encryption + +If the tag is not included, the encryption method is assumed to be NIP-04 for backwards-compatibility. + #### Diagram ![signing-example](https://i.nostr.build/P3gW.png) @@ -95,8 +117,11 @@ nostrconnect://?relay=&metadata "id": , "kind": 24133, "pubkey": , - "content": )>, - "tags": [["p", ]], // NB: in the `create_account` event, the remote signer pubkey should be `p` tagged. + "content": )>, + "tags": [ + ["p", ], // NB: in the `create_account` event, the remote signer pubkey should be `p` tagged. + ["encrypted", "nip04"] + ], "created_at": } ``` @@ -142,8 +167,8 @@ The `connect` method may be provided with `optional_requested_permissions` for u "id": , "kind": 24133, "pubkey": , - "content": )>, - "tags": [["p", ]], + "content": )>, + "tags": [["p", ], ["encrypted", "nip04"]], "created_at": } ```