opening some space.

This commit is contained in:
Vitor Pamplona 2024-01-03 12:21:46 -05:00
parent 3fa03a1aea
commit 8dfb59c70a

30
01.md
View File

@ -49,13 +49,13 @@ To obtain the hash `.id`, we `sha256` the UTF-8 byte array of a JSON-serialized
The JSON serialization MUST follow this rules:
- Minified: No whitespace, line breaks, or other unnecessary formatting used
- Escape Set: ONLY the following characters MUST be escaped:
- line break: `0x0A` -> `\n`
- double quote: `0x22` -> `\"`
- backslash: `0x5C` -> `\\`
- carriage return: `0x0D` -> `\r`
- tab character: `0x09` -> `\t`
- backspace: `0x08` -> `\b`
- form feed: `0x0C` -> `\f`
- line break: `0x0A` to `\n`
- double quote: `0x22` to `\"`
- backslash: `0x5C` to `\\`
- carriage return: `0x0D` to `\r`
- tab character: `0x09` to `\t`
- backspace: `0x08` to `\b`
- form feed: `0x0C` to `\f`
## Verifying
@ -102,13 +102,23 @@ This NIP defines the format of 3 standard tags: `e`, `p`, and `a`. `e`, `p` can
# Relay Protocol
Nostr has two main components: Clients & Relays. Users run a client to fetch/subscribe to events from one or more Relays via WebSockets. Relays are not expected to communicate with one another. It's the Client's responsibility to discover which relay has the event set their user wants to see. Both sides SHOULD verify the hash and the signature of each event upon receipt.
Nostr has two main components: Clients & Relays.
Clients SHOULD open a single WebSocket connection to each relay and use it for all their subscriptions. Relays MAY limit the number of connections from specific IP/client/etc. All messages are defined as JSON arrays.
Users run a client to fetch/subscribe to events from one or more Relays via WebSockets.
Relays are not expected to communicate with one another. It's the Client's responsibility to discover which relay has the event set their user wants to see.
Both sides SHOULD verify the hash and the signature of each event upon receipt.
Clients SHOULD open a single WebSocket connection to each relay and use it for all their subscriptions. Relays MAY limit the number of connections from specific IP/client/etc.
All messages are defined as JSON arrays.
## Subscriptions
Clients send a **subscription** message with one or more filters. The Relay MUST query its database, return all events that match the filter, and keep applying the filter to all connections, returning new events as they arrive. Subscriptions stay indefinitely open until either side closes the subscription or the connection.
Clients send a **subscription** message with one or more filters. The Relay MUST query its database, return all events that match the filter, and keep applying the filter to all connections, returning new events as they arrive.
Subscriptions stay indefinitely open until either side closes the subscription or the connection.
### Subscription Requests