mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-09 22:09:06 -05:00
changes private to protected.
This commit is contained in:
parent
e456646675
commit
1853f186bb
8
42.md
8
42.md
|
@ -6,7 +6,7 @@ Authentication of clients to relays
|
|||
|
||||
`draft` `optional`
|
||||
|
||||
This NIP defines a way for clients to authenticate to relays by signing an ephemeral event and a way to specify which events and private and MUST require authentication to be served.
|
||||
This NIP defines a way for clients to authenticate to relays by signing an ephemeral event and a way to specify which events are protected and MUST require authentication to be served.
|
||||
|
||||
## Motivation
|
||||
|
||||
|
@ -18,7 +18,7 @@ A relay may want to require clients to authenticate to access restricted resourc
|
|||
|
||||
## Definitions
|
||||
|
||||
### New field to identify private events
|
||||
### New field to identify protected events
|
||||
|
||||
Clients that want to force an authentication in any event can add a `requires_auth_by` with array of authorized pubkeys to the base event object.
|
||||
|
||||
|
@ -28,7 +28,7 @@ Relays MUST authenticate connections with at least one of the pubkeys listed in
|
|||
{
|
||||
"id": <32-bytes lowercase hex-encoded sha256 of the serialized event data>,
|
||||
"pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
|
||||
"requires_auth_by" [<32-bytes lowercase hex-encoded public key>, ... ]
|
||||
"requires_auth_by" [<32-bytes lowercase hex-encoded public key>, /* ... */ ],
|
||||
"created_at": <unix timestamp in seconds>,
|
||||
"kind": <integer between 0 and 65535>,
|
||||
"tags": [
|
||||
|
@ -40,7 +40,7 @@ Relays MUST authenticate connections with at least one of the pubkeys listed in
|
|||
}
|
||||
```
|
||||
|
||||
NIP-42 supporting relays must then include the `requires_auth_by` field as the 7th position in the serialization of the event. This guarantees that relays and clients that do not support this NIP cannot validate private events and will never be able to receive them, avoiding leaking the event structure to a public relay.
|
||||
NIP-42 supporting relays must then include the `requires_auth_by` field as the 7th position in the serialization of the event. This guarantees that relays and clients that do not support this NIP cannot validate protected events and will never be able to receive them, avoiding leaking the event structure to a public relay.
|
||||
|
||||
```js
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue
Block a user