-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from nostr-jp/sync
Sync with upstream
- Loading branch information
Showing
8 changed files
with
261 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
NIP-68 | ||
====== | ||
|
||
Picture-first feeds | ||
------------------- | ||
|
||
`draft` `optional` | ||
|
||
This NIP defines event kind `20` for picture-first clients. Images must be self-contained. They are hosted externally and referenced using `imeta` tags. | ||
|
||
The idea is for this type of event to cater to Nostr clients resembling platforms like Instagram, Flickr, Snapchat, or 9GAG, where the picture itself takes center stage in the user experience. | ||
|
||
## Picture Events | ||
|
||
Picture events contain a `title` tag and description in the `.content`. | ||
|
||
They may contain multiple images to be displayed as a single post. | ||
|
||
```jsonc | ||
{ | ||
"id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, | ||
"pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, | ||
"created_at": <Unix timestamp in seconds>, | ||
"kind": 20, | ||
"content": "<description of post>", | ||
"tags": [ | ||
["title", "<short title of post>"], | ||
|
||
// Picture Data | ||
[ | ||
"imeta", | ||
"url https://nostr.build/i/my-image.jpg", | ||
"m image/jpeg", | ||
"blurhash eVF$^OI:${M{o#*0-nNFxakD-?xVM}WEWB%iNKxvR-oetmo#R-aen$", | ||
"dim 3024x4032", | ||
"alt A scenic photo overlooking the coast of Costa Rica", | ||
"x <sha256 hash as specified in NIP 94>", | ||
"fallback https://nostrcheck.me/alt1.jpg", | ||
"fallback https://void.cat/alt1.jpg" | ||
], | ||
[ | ||
"imeta", | ||
"url https://nostr.build/i/my-image2.jpg", | ||
"m image/jpeg", | ||
"blurhash eVF$^OI:${M{o#*0-nNFxakD-?xVM}WEWB%iNKxvR-oetmo#R-aen$", | ||
"dim 3024x4032", | ||
"alt Another scenic photo overlooking the coast of Costa Rica", | ||
"x <sha256 hash as specified in NIP 94>", | ||
"fallback https://nostrcheck.me/alt2.jpg", | ||
"fallback https://void.cat/alt2.jpg", | ||
|
||
"annotate-user <32-bytes hex of a pubkey>:<posX>:<posY>" // Tag users in specific locations in the picture | ||
], | ||
|
||
["content-warning", "<reason>"], // if NSFW | ||
|
||
// Tagged users | ||
["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"], | ||
["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"], | ||
|
||
// Specify the media type for filters to allow clients to filter by supported kinds | ||
["m", "image/jpeg"], | ||
|
||
// Hashes of each image to make them queryable | ||
["x", "<sha256>"] | ||
|
||
// Hashtags | ||
["t", "<tag>"], | ||
["t", "<tag>"], | ||
|
||
// location | ||
["location", "<location>"], // city name, state, country | ||
["g", "<geohash>"], | ||
|
||
// When text is written in the image, add the tag to represent the language | ||
["L", "ISO-639-1"], | ||
["l", "en", "ISO-639-1"] | ||
] | ||
} | ||
``` | ||
|
||
The `imeta` tag `annotate-user` places a user link in the specific position in the image. | ||
|
||
Only the following media types are accepted: | ||
- `image/apng`: Animated Portable Network Graphics (APNG) | ||
- `image/avif`: AV1 Image File Format (AVIF) | ||
- `image/gif`: Graphics Interchange Format (GIF) | ||
- `image/jpeg`: Joint Photographic Expert Group image (JPEG) | ||
- `image/png`: Portable Network Graphics (PNG) | ||
- `image/webp`: Web Picture format (WEBP) | ||
|
||
Picture events might be used with [NIP-71](71.md)'s kind `34236` to display short vertical videos in the same feed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
NIP-86 | ||
====== | ||
|
||
Relay Management API | ||
-------------------- | ||
|
||
`draft` `optional` | ||
|
||
Relays may provide an API for performing management tasks. This is made available as a JSON-RPC-like request-response protocol over HTTP, on the same URI as the relay's websocket. | ||
|
||
When a relay receives an HTTP(s) request with a `Content-Type` header of `application/nostr+json+rpc` to a URI supporting WebSocket upgrades, it should parse the request as a JSON document with the following fields: | ||
|
||
```json | ||
{ | ||
"method": "<method-name>", | ||
"params": ["<array>", "<of>", "<parameters>"] | ||
} | ||
``` | ||
|
||
Then it should return a response in the format | ||
|
||
```json | ||
{ | ||
"result": {"<arbitrary>": "<value>"}, | ||
"error": "<optional error message, if the call has errored>" | ||
} | ||
``` | ||
|
||
This is the list of **methods** that may be supported: | ||
|
||
* `supportedmethods`: | ||
- params: `[]` | ||
- result: `["<method-name>", "<method-name>", ...]` (an array with the names of all the other supported methods) | ||
* `banpubkey`: | ||
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `listbannedpubkeys`: | ||
- params: `[]` | ||
- result: `[{"pubkey": "<32-byte-hex>", "reason": "<optional-reason>"}, ...]`, an array of objects | ||
* `allowpubkey`: | ||
- params: `["<32-byte-hex-public-key>", "<optional-reason>"]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `listallowedpubkeys`: | ||
- params: `[]` | ||
- result: `[{"pubkey": "<32-byte-hex>", "reason": "<optional-reason>"}, ...]`, an array of objects | ||
* `listeventsneedingmoderation`: | ||
- params: `[]` | ||
- result: `[{"id": "<32-byte-hex>", "reason": "<optional-reason>"}]`, an array of objects | ||
* `allowevent`: | ||
- params: `["<32-byte-hex-event-id>", "<optional-reason>"]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `banevent`: | ||
- params: `["<32-byte-hex-event-id>", "<optional-reason>"]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `listbannedevents`: | ||
- params: `[]` | ||
- result: `[{"id": "<32-byte hex>", "reason": "<optional-reason>"}, ...]`, an array of objects | ||
* `changerelayname`: | ||
- params: `["<new-name>"]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `changerelaydescription`: | ||
- params: `["<new-description>"]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `changerelayicon`: | ||
- params: `["<new-icon-url>"]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `allowkind`: | ||
- params: `[<kind-number>]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `disallowkind`: | ||
- params: `[<kind-number>]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `listallowedkinds`: | ||
- params: `[]` | ||
- result: `[<kind-number>, ...]`, an array of numbers | ||
* `blockip`: | ||
- params: `["<ip-address>", "<optional-reason>"]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `unblockip`: | ||
- params: `["<ip-address>"]` | ||
- result: `true` (a boolean always set to `true`) | ||
* `listblockedips`: | ||
- params: `[]` | ||
- result: `[{"ip": "<ip-address>", "reason": "<optional-reason>"}, ...]`, an array of objects | ||
|
||
### Authorization | ||
|
||
The request must contain an `Authorization` header with a valid [NIP-98](./98.md) event, except the `payload` tag is required. The `u` tag is the relay URL. | ||
|
||
If `Authorization` is not provided or is invalid, the endpoint should return a 401 response. |
Oops, something went wrong.