Merge f1feddac4c08e9408e4544db0f67aa63f300546c into 0619f370bca3485bb9c5870bc2defa03c7c3d10e

This commit is contained in:
hodlbod 2025-03-19 09:08:50 +07:00 committed by GitHub
commit ccd3cca904
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

15
46.md
View File

@ -97,18 +97,25 @@ 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.
Signers MUST revoke delegated sessions when the parent session is invalidated. Signers MUST NOT allow delegated sessions to create nested delegated sessions.
## Response Events `kind:24133`