diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2024-04-25 18:03:38 -0300 |
|---|---|---|
| committer | fiatjaf_ <fiatjaf@gmail.com> | 2024-04-25 20:07:38 -0300 |
| commit | 243b2865826edff22eebe5ec6e893c711802c7e5 (patch) | |
| tree | 6176e65832b3c6a62a8783cbbe7ffe4720c598e1 /46.md | |
| parent | 6071f3489eabe50eea748a2585a73c02a23d96cf (diff) | |
nip46: signer should fill in pubkey, id and sig on sign_event.
Diffstat (limited to '46.md')
| -rw-r--r-- | 46.md | 29 |
1 files changed, 15 insertions, 14 deletions
| @@ -61,8 +61,9 @@ nostrconnect://<local-keypair-pubkey>?relay=<wss://relay-to-connect-on>&metadata | |||
| 61 | "method": "sign_event", | 61 | "method": "sign_event", |
| 62 | "params": [json_stringified(<{ | 62 | "params": [json_stringified(<{ |
| 63 | content: "Hello, I'm signing remotely", | 63 | content: "Hello, I'm signing remotely", |
| 64 | pubkey: "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52", | 64 | kind: 1, |
| 65 | // ...the rest of the event data | 65 | tags: [], |
| 66 | created_at: 1714078911 | ||
| 66 | }>)] | 67 | }>)] |
| 67 | }), | 68 | }), |
| 68 | "tags": [["p", "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"]], // p-tags the remote user pubkey | 69 | "tags": [["p", "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"]], // p-tags the remote user pubkey |
| @@ -118,21 +119,21 @@ The `content` field is a JSON-RPC-like message that is [NIP-04](https://github.c | |||
| 118 | 119 | ||
| 119 | Each of the following are methods that the client sends to the remote signer. | 120 | Each of the following are methods that the client sends to the remote signer. |
| 120 | 121 | ||
| 121 | | Command | Params | Result | | 122 | | Command | Params | Result | |
| 122 | | ------------------------ | ------------------------------------------------- | ---------------------------------------------------------------------- | | 123 | | ------------------------ | ------------------------------------------------- | ---------------------------------------------------------------------- | |
| 123 | | `connect` | `[<remote_user_pubkey>, <optional_secret>, <optional_requested_permissions>]` | "ack" | | 124 | | `connect` | `[<remote_user_pubkey>, <optional_secret>, <optional_requested_permissions>]` | "ack" | |
| 124 | | `sign_event` | `[<json_stringified_event_to_sign>]` | `json_stringified(<signed_event>)` | | 125 | | `sign_event` | `[<{kind, content, tags, created_at}>]` | `json_stringified(<signed_event>)` | |
| 125 | | `ping` | `[]` | "pong" | | 126 | | `ping` | `[]` | "pong" | |
| 126 | | `get_relays` | `[]` | `json_stringified({<relay_url>: {read: <boolean>, write: <boolean>}})` | | 127 | | `get_relays` | `[]` | `json_stringified({<relay_url>: {read: <boolean>, write: <boolean>}})` | |
| 127 | | `get_public_key` | `[]` | `<hex-pubkey>` | | 128 | | `get_public_key` | `[]` | `<hex-pubkey>` | |
| 128 | | `nip04_encrypt` | `[<third_party_pubkey>, <plaintext_to_encrypt>]` | `<nip04_ciphertext>` | | 129 | | `nip04_encrypt` | `[<third_party_pubkey>, <plaintext_to_encrypt>]` | `<nip04_ciphertext>` | |
| 129 | | `nip04_decrypt` | `[<third_party_pubkey>, <nip04_ciphertext_to_decrypt>]` | `<plaintext>` | | 130 | | `nip04_decrypt` | `[<third_party_pubkey>, <nip04_ciphertext_to_decrypt>]` | `<plaintext>` | |
| 130 | | `nip44_encrypt` | `[<third_party_pubkey>, <plaintext_to_encrypt>]` | `<nip44_ciphertext>` | | 131 | | `nip44_encrypt` | `[<third_party_pubkey>, <plaintext_to_encrypt>]` | `<nip44_ciphertext>` | |
| 131 | | `nip44_decrypt` | `[<third_party_pubkey>, <nip44_ciphertext_to_decrypt>]` | `<plaintext>` | | 132 | | `nip44_decrypt` | `[<third_party_pubkey>, <nip44_ciphertext_to_decrypt>]` | `<plaintext>` | |
| 132 | 133 | ||
| 133 | ### Requested permissions | 134 | ### Requested permissions |
| 134 | 135 | ||
| 135 | 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. | 136 | 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. |
| 136 | 137 | ||
| 137 | ## Response Events `kind:24133` | 138 | ## Response Events `kind:24133` |
| 138 | 139 | ||