From 18bd7c46c586904ec9296812822de4cce0e8f3bd Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 19 May 2024 14:54:04 -0300 Subject: [PATCH] nip46: abandon nip04 entirely and just use nip44. --- 46.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/46.md b/46.md index 1528116..d10790f 100644 --- a/46.md +++ b/46.md @@ -56,7 +56,7 @@ nostrconnect://?relay=&metadata { "kind": 24133, "pubkey": "eff37350d839ce3707332348af4549a96051bd695d3223af4aabce4993531d86", - "content": nip04({ + "content": nip44({ "id": , "method": "sign_event", "params": [json_stringified(<{ @@ -76,7 +76,7 @@ nostrconnect://?relay=&metadata { "kind": 24133, "pubkey": "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52", - "content": nip04({ + "content": nip44({ "id": , "result": json_stringified() }), @@ -95,13 +95,13 @@ nostrconnect://?relay=&metadata "id": , "kind": 24133, "pubkey": , - "content": )>, + "content": )>, "tags": [["p", ]], // NB: in the `create_account` event, the remote signer pubkey should be `p` tagged. "created_at": } ``` -The `content` field is a JSON-RPC-like message that is [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) encrypted and has the following structure: +The `content` field is a JSON-RPC-like message that is [NIP-44](https://github.com/nostr-protocol/nips/blob/master/44.md) encrypted and has the following structure: ```json { @@ -126,14 +126,12 @@ Each of the following are methods that the client sends to the remote signer. | `ping` | `[]` | "pong" | | `get_relays` | `[]` | `json_stringified({: {read: , write: }})` | | `get_public_key` | `[]` | `` | -| `nip04_encrypt` | `[, ]` | `` | -| `nip04_decrypt` | `[, ]` | `` | | `nip44_encrypt` | `[<third_party_pubkey>, <plaintext_to_encrypt>]` | `<nip44_ciphertext>` | | `nip44_decrypt` | `[<third_party_pubkey>, <nip44_ciphertext_to_decrypt>]` | `<plaintext>` | ### Requested permissions -The `connect` method may be provided with `optional_requested_permissions` for user convenience. The permissions are a comma-separated list of `method[:params]`, i.e. `nip04_encrypt,sign_event:4` meaning permissions to call `nip04_encrypt` and to call `sign_event` with `kind:4`. Optional parameter for `sign_event` is the kind number, parameters for other methods are to be defined later. +The `connect` method may be provided with `optional_requested_permissions` for user convenience. The permissions are a comma-separated list of `method[:params]`, i.e. `nip44_encrypt,sign_event:14` meaning permissions to call `nip44_encrypt` and to call `sign_event` with `kind:14`. Optional parameter for `sign_event` is the kind number, parameters for other methods are to be defined later. ## Response Events `kind:24133` @@ -142,13 +140,13 @@ The `connect` method may be provided with `optional_requested_permissions` for u "id": <id>, "kind": 24133, "pubkey": <remote_signer_pubkey>, - "content": <nip04(<response>)>, + "content": <nip44(<response>)>, "tags": [["p", <local_keypair_pubkey>]], "created_at": <unix timestamp in seconds> } ``` -The `content` field is a JSON-RPC-like message that is [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) encrypted and has the following structure: +The `content` field is a JSON-RPC-like message that is [NIP-44](https://github.com/nostr-protocol/nips/blob/master/44.md) encrypted and has the following structure: ```json { @@ -224,4 +222,4 @@ Coming soon... ## References -- [NIP-04 - Encryption](https://github.com/nostr-protocol/nips/blob/master/04.md) +- [NIP-44 - Encryption](https://github.com/nostr-protocol/nips/blob/master/44.md)