Skip to content

Commit

Permalink
Add delegation to nip 46
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Staab committed Feb 19, 2025
1 parent 0b6b69b commit 15a1836
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions 46.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,23 @@ Each of the following are methods that the _client_ sends to the _remote-signer_

| Command | Params | Result |
| ------------------------ | ------------------------------------------------- | ---------------------------------------------------------------------- |
| `connect` | `[<remote-signer-pubkey>, <optional_secret>, <optional_requested_permissions>]` | "ack" OR `<required-secret-value>` |
| `connect` | `[<remote-signer-pubkey>, <optional_secret>, <optional_perms>]` | "ack" (deprecated) OR `<required-secret-value>` |
| `delegate` | `[<perms>]` | `<bunker-url>` |
| `sign_event` | `[<{kind, content, tags, created_at}>]` | `json_stringified(<signed_event>)` |
| `ping` | `[]` | "pong" |
| `get_public_key` | `[]` | `<user-pubkey>` |
| `get_public_key` | `[]` | `<user-pubkey>` |
| `nip04_encrypt` | `[<third_party_pubkey>, <plaintext_to_encrypt>]` | `<nip04_ciphertext>` |
| `nip04_decrypt` | `[<third_party_pubkey>, <nip04_ciphertext_to_decrypt>]` | `<plaintext>` |
| `nip44_encrypt` | `[<third_party_pubkey>, <plaintext_to_encrypt>]` | `<nip44_ciphertext>` |
| `nip44_decrypt` | `[<third_party_pubkey>, <nip44_ciphertext_to_decrypt>]` | `<plaintext>` |

### Requested permissions
### 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. `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.
`perms` is 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.

### Delegation

The `delegate` method MUST provide a comma-separated list of allowed permissions and return a bunker url representing a fresh session. The bunker MUST NOT allow this session to request additional permissions, returning an error message for any requests that are not allowed by the initial `perms` string.

## Response Events `kind:24133`

Expand Down

0 comments on commit 15a1836

Please sign in to comment.