upleb.uk

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

summaryrefslogtreecommitdiff
path: root/46.md
diff options
context:
space:
mode:
authorfiatjaf <fiatjaf@gmail.com>2024-12-05 16:59:18 -0300
committerfiatjaf_ <fiatjaf@gmail.com>2024-12-05 20:14:02 -0300
commit6d16019e9e98807b23b7ae1faf5edeead7ddee7a (patch)
treeb96b07f473160d3ab0a80b8e5e3475ba3b7a3546 /46.md
parent2ac43aa3f115170c25b3181cdedf4f6a5d6e310b (diff)
nip46: abandon nip04 entirely and just use nip44.
Diffstat (limited to '46.md')
-rw-r--r--46.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/46.md b/46.md
index 7f8859f..d170628 100644
--- a/46.md
+++ b/46.md
@@ -72,12 +72,12 @@ _user_ passes this token to _remote-signer_, which then sends `connect` *respons
72{ 72{
73 "kind": 24133, 73 "kind": 24133,
74 "pubkey": <local_keypair_pubkey>, 74 "pubkey": <local_keypair_pubkey>,
75 "content": <nip04(<request>)>, 75 "content": <nip44(<request>)>,
76 "tags": [["p", <remote-signer-pubkey>]], 76 "tags": [["p", <remote-signer-pubkey>]],
77} 77}
78``` 78```
79 79
80The `content` field is a JSON-RPC-like message that is [NIP-04](04.md) encrypted and has the following structure: 80The `content` field is a JSON-RPC-like message that is [NIP-44](44.md) encrypted and has the following structure:
81 81
82```jsonc 82```jsonc
83{ 83{
@@ -109,7 +109,7 @@ Each of the following are methods that the _client_ sends to the _remote-signer_
109 109
110### Requested permissions 110### Requested permissions
111 111
112The `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. Same permission format may be used for `perms` field of `metadata` in `nostrconnect://` string. 112The `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:4` meaning permissions to call `nip44_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. Same permission format may be used for `perms` field of `metadata` in `nostrconnect://` string.
113 113
114## Response Events `kind:24133` 114## Response Events `kind:24133`
115 115
@@ -118,13 +118,13 @@ The `connect` method may be provided with `optional_requested_permissions` for u
118 "id": <id>, 118 "id": <id>,
119 "kind": 24133, 119 "kind": 24133,
120 "pubkey": <remote-signer-pubkey>, 120 "pubkey": <remote-signer-pubkey>,
121 "content": <nip04(<response>)>, 121 "content": <nip44(<response>)>,
122 "tags": [["p", <client-pubkey>]], 122 "tags": [["p", <client-pubkey>]],
123 "created_at": <unix timestamp in seconds> 123 "created_at": <unix timestamp in seconds>
124} 124}
125``` 125```
126 126
127The `content` field is a JSON-RPC-like message that is [NIP-04](04.md) encrypted and has the following structure: 127The `content` field is a JSON-RPC-like message that is [NIP-44](44.md) encrypted and has the following structure:
128 128
129```json 129```json
130{ 130{
@@ -150,7 +150,7 @@ The `content` field is a JSON-RPC-like message that is [NIP-04](04.md) encrypted
150{ 150{
151 "kind": 24133, 151 "kind": 24133,
152 "pubkey": "eff37350d839ce3707332348af4549a96051bd695d3223af4aabce4993531d86", 152 "pubkey": "eff37350d839ce3707332348af4549a96051bd695d3223af4aabce4993531d86",
153 "content": nip04({ 153 "content": nip44({
154 "id": <random_string>, 154 "id": <random_string>,
155 "method": "sign_event", 155 "method": "sign_event",
156 "params": [json_stringified(<{ 156 "params": [json_stringified(<{
@@ -170,7 +170,7 @@ The `content` field is a JSON-RPC-like message that is [NIP-04](04.md) encrypted
170{ 170{
171 "kind": 24133, 171 "kind": 24133,
172 "pubkey": "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52", 172 "pubkey": "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52",
173 "content": nip04({ 173 "content": nip44({
174 "id": <random_string>, 174 "id": <random_string>,
175 "result": json_stringified(<signed-event>) 175 "result": json_stringified(<signed-event>)
176 }), 176 }),
@@ -224,4 +224,4 @@ The `<remote-signer-app-pubkey>` MAY be used to verify the domain from _remote-s
224 224
225_remote-signer_ MAY publish a NIP-89 `kind: 31990` event with `k` tag of `24133`, which MAY also include one or more `relay` tags and MAY include `nostrconnect_url` tag. The semantics of `relay` and `nostrconnect_url` tags are the same as in the section above. 225_remote-signer_ MAY publish a NIP-89 `kind: 31990` event with `k` tag of `24133`, which MAY also include one or more `relay` tags and MAY include `nostrconnect_url` tag. The semantics of `relay` and `nostrconnect_url` tags are the same as in the section above.
226 226
227_client_ MAY improve UX by discovering _remote-signers_ using their `kind: 31990` events. _client_ MAY then pre-generate `nostrconnect://` strings for the _remote-signers_, and SHOULD in that case verify that `kind: 31990` event's author is mentioned in signer's `nostr.json?name=_` file as `<remote-signer-app-pubkey>`. 227_client_ MAY improve UX by discovering _remote-signers_ using their `kind: 31990` events. _client_ MAY then pre-generate `nostrconnect://` strings for the _remote-signers_, and SHOULD in that case verify that `kind: 31990` event's author is mentioned in signer's `nostr.json?name=_` file as `<remote-signer-app-pubkey>`.