nips/96.md

337 lines
15 KiB
Markdown
Raw Normal View History

NIP-96
======
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
HTTP File Storage Integration
-----------------------------
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-01-08 22:35:41 -05:00
`draft` `optional`
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
## Introduction
This NIP defines a REST API for HTTP file storage servers intended to be used in conjunction with the nostr network.
The API will enable nostr users to upload files and later reference them by url on nostr notes.
The spec DOES NOT use regular nostr events through websockets for
storing, requesting nor retrieving data because, for simplicity, the server
will not have to learn anything about nostr relays.
## Server Adaptation
File storage servers wishing to be accessible by nostr users should opt-in by making available an https route at `/.well-known/nostr/nip96.json` with `api_url`:
2024-09-03 13:11:31 -04:00
```jsonc
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
{
// Required
// File upload and deletion are served from this url
// Also downloads if "download_url" field is absent or empty string
"api_url": "https://your-file-server.example/custom-api-path",
// Optional
// If absent, downloads are served from the api_url
"download_url": "https://a-cdn.example/a-path",
// Optional
// Note: This field is not meant to be set by HTTP Servers.
// Use this if you are a nostr relay using your /.well-known/nostr/nip96.json
// just to redirect to someone else's http file storage server's /.well-known/nostr/nip96.json
// In this case, "api_url" field must be an empty string
"delegated_to_url": "https://your-file-server.example",
// Optional
"supported_nips": [60],
// Optional
"tos_url": "https://your-file-server.example/terms-of-service",
// Optional
"content_types": ["image/jpeg", "video/webm", "audio/*"],
// Optional
"plans": {
// "free" is the only standardized plan key and
// clients may use its presence to learn if server offers free storage
"free": {
"name": "Free Tier",
// Default is true
// All plans MUST support NIP-98 uploads
// but some plans may also allow uploads without it
"is_nip98_required": true,
"url": "https://...", // plan's landing page if there is one
"max_byte_size": 10485760,
// Range in days / 0 for no expiration
// [7, 0] means it may vary from 7 days to unlimited persistence,
// [0, 0] means it has no expiration
// early expiration may be due to low traffic or any other factor
"file_expiration": [14, 90],
"media_transformations": {
"image": [
2024-09-03 13:11:31 -04:00
"resizing"
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
]
}
}
}
}
```
### Relay Hints
Note: This section is not meant to be used by HTTP Servers.
A nostr relay MAY redirect to someone else's HTTP file storage server by
adding a `/.well-known/nostr/nip96.json` with "delegated_to_url" field
pointing to the url where the server hosts its own
`/.well-known/nostr/nip96.json`. In this case, the "api_url" field must
be an empty string and all other fields must be absent.
If the nostr relay is also an HTTP file storage server,
it must use the "api_url" field instead.
### List of Supporting File Storage Servers
2024-03-12 23:46:16 -04:00
See https://github.com/aljazceru/awesome-nostr#nip-96-file-storage-servers.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-20 16:38:36 -04:00
## Auth
2024-05-14 08:59:59 -04:00
When indicated, `clients` must add an [NIP-98](98.md) `Authorization` header (**optionally** with the encoded `payload` tag set to the base64-encoded 256-bit SHA-256 hash of the file - not the hash of the whole request body).
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
## Upload
2024-05-14 08:59:59 -04:00
`POST $api_url` as `multipart/form-data`.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-14 08:59:59 -04:00
**AUTH required**
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-14 08:59:59 -04:00
List of form fields:
2024-05-20 16:38:36 -04:00
2024-05-14 08:59:59 -04:00
- `file`: **REQUIRED** the file to upload
- `caption`: **RECOMMENDED** loose description;
- `expiration`: UNIX timestamp in seconds. Empty string if file should be stored forever. The server isn't required to honor this.
- `size`: File byte size. This is just a value the server can use to reject early if the file size exceeds the server limits.
- `alt`: **RECOMMENDED** strict description text for visibility-impaired users.
- `media_type`: "avatar" or "banner". Informs the server if the file will be used as an avatar or banner. If absent, the server will interpret it as a normal upload, without special treatment.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
- `content_type`: mime type such as "image/jpeg". This is just a value the server can use to reject early if the mime type isn't supported.
- `no_transform`: "true" asks server not to transform the file and serve the uploaded file as is, may be rejected.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
Others custom form data fields may be used depending on specific `server` support.
The `server` isn't required to store any metadata sent by `clients`.
The `filename` embedded in the file may not be honored by the `server`, which could internally store just the SHA-256 hash value as the file name, ignoring extra metadata.
2024-05-14 08:59:59 -04:00
The hash is enough to uniquely identify a file, that's why it will be used on the `download` and `delete` routes.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-14 08:59:59 -04:00
The `server` MUST link the user's `pubkey` string as the owner of the file so to later allow them to delete the file.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
`no_transform` can be used to replicate a file to multiple servers for redundancy, clients can use the [server list](#selecting-a-server) to find alternative servers which might contain the same file. When uploading a file and requesting `no_transform` clients should check that the hash matches in the response in order to detect if the file was modified.
2024-05-14 08:59:59 -04:00
### Response codes
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-14 08:59:59 -04:00
- `200 OK`: File upload exists, but is successful (Existing hash)
- `201 Created`: File upload successful (New hash)
- `202 Accepted`: File upload is awaiting processing, see [Delayed Processing](#delayed-processing) section
- `413 Payload Too Large`: File size exceeds limit
- `400 Bad Request`: Form data is invalid or not supported.
- `403 Forbidden`: User is not allowed to upload or the uploaded file hash didnt match the hash included in the `Authorization` header `payload` tag.
- `402 Payment Required`: Payment is required by the server, **this flow is undefined**.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
The upload response is a json object as follows:
2024-09-03 13:11:31 -04:00
```jsonc
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
{
// "success" if successful or "error" if not
2024-09-03 13:11:31 -04:00
"status": "success",
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
// Free text success, failure or info message
2024-09-03 13:11:31 -04:00
"message": "Upload successful.",
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
// Optional. See "Delayed Processing" section
2024-09-03 13:11:31 -04:00
"processing_url": "...",
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
// This uses the NIP-94 event format but DO NOT need
// to fill some fields like "id", "pubkey", "created_at" and "sig"
//
// This holds the download url ("url"),
// the ORIGINAL file hash before server transformations ("ox")
// and, optionally, all file metadata the server wants to make available
//
// nip94_event field is absent if unsuccessful upload
2024-09-03 16:17:11 -04:00
"nip94_event2": {
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
// Required tags: "url" and "ox"
2024-09-03 13:11:31 -04:00
"tags": [
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
// Can be same from /.well-known/nostr/nip96.json's "download_url" field
// (or "api_url" field if "download_url" is absent or empty) with appended
// original file hash.
//
// Note we appended .png file extension to the `ox` value
// (it is optional but extremely recommended to add the extension as it will help nostr clients
// with detecting the file type by using regular expression)
//
// Could also be any url to download the file
// (using or not using the /.well-known/nostr/nip96.json's "download_url" prefix),
// for load balancing purposes for example.
["url", "https://your-file-server.example/custom-api-path/719171db19525d9d08dd69cb716a18158a249b7b3b3ec4bbdec5698dca104b7b.png"],
// SHA-256 hash of the ORIGINAL file, before transformations.
// The server MUST store it even though it represents the ORIGINAL file because
// users may try to download/delete the transformed file using this value
["ox", "719171db19525d9d08dd69cb716a18158a249b7b3b3ec4bbdec5698dca104b7b"],
// Optional. SHA-256 hash of the saved file after any server transformations.
// The server can but does not need to store this value.
["x", "543244319525d9d08dd69cb716a18158a249b7b3b3ec4bbde5435543acb34443"],
// Optional. Recommended for helping clients to easily know file type before downloading it.
2024-09-03 16:17:11 -04:00
["m", "image/png"],
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
// Optional. Recommended for helping clients to reserve an adequate UI space to show the file before downloading it.
["dim", "800x600"]
// ... other optional NIP-94 tags
],
2024-09-03 13:11:31 -04:00
"content": ""
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
},
// ... other custom fields (please consider adding them to this NIP or to NIP-94 tags)
}
```
Note that if the server didn't apply any transformation to the received file, both `nip94_event.tags.*.ox` and `nip94_event.tags.*.x` fields will have the same value. The server MUST link the saved file to the SHA-256 hash of the **original** file before any server transformations (the `nip94_event.tags.*.ox` tag value). The **original** file's SHA-256 hash will be used to identify the saved file when downloading or deleting it.
2024-05-14 08:59:59 -04:00
`clients` may upload the same file to one or many `servers`.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
After successful upload, the `client` may optionally generate and send to any set of nostr `relays` a [NIP-94](94.md) event by including the missing fields.
Alternatively, instead of using NIP-94, the `client` can share or embed on a nostr note just the above url.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-14 08:59:59 -04:00
`clients` may also use the tags from the `nip94_event` to construct an `imeta` tag
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
### Delayed Processing
Sometimes the server may want to place the uploaded file in a processing queue for deferred file processing.
In that case, the server MUST serve the original file while the processing isn't done, then swap the original file for the processed one when the processing is over. The upload response is the same as usual but some optional metadata like `nip94_event.tags.*.x` and `nip94_event.tags.*.size` won't be available.
The expected resulting metadata that is known in advance should be returned on the response.
For example, if the file processing would change a file from "jpg" to "webp",
use ".webp" extension on the `nip94_event.tags.*.url` field value and set "image/webp" to the `nip94_event.tags.*.m` field.
If some metadata are unknown before processing ends, omit them from the response.
The upload response MAY include a `processing_url` field informing a temporary url that may be used by clients to check if
the file processing is done.
If the processing isn't done, the server should reply at the `processing_url` url with **200 OK** and the following JSON:
2024-09-03 13:11:31 -04:00
```jsonc
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
{
// It should be "processing". If "error" it would mean the processing failed.
2024-09-03 13:11:31 -04:00
"status": "processing",
"message": "Processing. Please check again later for updated status.",
"percentage": 15 // Processing percentage. An integer between 0 and 100.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
}
```
When the processing is over, the server replies at the `processing_url` url with **201 Created** status and a regular successful JSON response already mentioned before (now **without** a `processing_url` field), possibly including optional metadata at `nip94_event.tags.*` fields
that weren't available before processing.
### File compression
File compression and other transformations like metadata stripping can be applied by the server.
However, for all file actions, such as download and deletion, the **original** file SHA-256 hash is what identifies the file in the url string.
## Download
2024-05-14 08:59:59 -04:00
`GET $api_url/<sha256-hash>(.ext)`
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
The primary file download url informed at the upload's response field `nip94_event.tags.*.url`
can be that or not (it can be any non-standard url the server wants).
If not, the server still MUST also respond to downloads at the standard url
mentioned on the previous paragraph, to make it possible for a client
to try downloading a file on any NIP-96 compatible server by knowing just the SHA-256 file hash.
2024-05-14 08:59:59 -04:00
Note that the "\<sha256-hash\>" part is from the **original** file, **not** from the **transformed** file if the uploaded file went through any server transformation.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
Supporting ".ext", meaning "file extension", is required for `servers`. It is optional, although recommended, for `clients` to append it to the path.
When present it may be used by `servers` to know which `Content-Type` header to send (e.g.: "Content-Type": "image/png" for ".png" extension).
The file extension may be absent because the hash is the only needed string to uniquely identify a file.
2024-05-14 08:59:59 -04:00
Example: `$api_url/719171db19525d9d08dd69cb716a18158a249b7b3b3ec4bbdec5698dca104b7b.png`
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
### Media Transformations
2024-05-14 08:59:59 -04:00
`servers` may respond to some media transformation query parameters and ignore those they don't support by serving
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
the original media file without transformations.
#### Image Transformations
##### Resizing
Upon upload, `servers` may create resized image variants, such as thumbnails, respecting the original aspect ratio.
2024-05-14 08:59:59 -04:00
`clients` may use the `w` query parameter to request an image version with the desired pixel width.
`servers` can then serve the variant with the closest width to the parameter value
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
or an image variant generated on the fly.
2024-05-14 08:59:59 -04:00
Example: `$api_url/<sha256-hash>.png?w=32`
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
## Deletion
2024-05-14 08:59:59 -04:00
`DELETE $api_url/<sha256-hash>(.ext)`
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-14 08:59:59 -04:00
**AUTH required**
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-14 08:59:59 -04:00
Note that the `/<sha256-hash>` part is from the **original** file, **not** from the **transformed** file if the uploaded file went through any server transformation.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-14 08:59:59 -04:00
The extension is optional as the file hash is the only needed file identification.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-05-14 08:59:59 -04:00
The `server` should reject deletes from users other than the original uploader with the appropriate http response code (403 Forbidden).
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
It should be noted that more than one user may have uploaded the same file (with the same hash). In this case, a delete must not really delete the file but just remove the user's `pubkey` from the file owners list (considering the server keeps just one copy of the same file, because multiple uploads of the same file results
in the same file hash).
2024-01-17 03:09:50 -05:00
The successful response is a 200 OK one with just basic JSON fields:
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
2024-09-03 13:11:31 -04:00
```json
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
{
2024-09-03 13:11:31 -04:00
"status": "success",
"message": "File deleted."
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
}
```
2024-05-14 08:59:59 -04:00
## Listing files
2024-05-20 16:38:36 -04:00
`GET $api_url?page=x&count=y`
2024-05-14 08:59:59 -04:00
**AUTH required**
Returns a list of files linked to the authenticated users pubkey.
Example Response:
2024-05-20 16:38:36 -04:00
2024-09-03 13:11:31 -04:00
```jsonc
2024-05-29 09:26:00 -04:00
{
"count": 1, // server page size, eg. max(1, min(server_max_page_size, arg_count))
"total": 1, // total number of files
"page": 0, // the current page number
"files": [
{
2024-05-20 16:38:36 -04:00
"tags": [
2024-09-03 13:11:31 -04:00
["ox", "719171db19525d9d08dd69cb716a18158a249b7b3b3ec4bbdec5698dca104b7b"],
["x", "5d2899290e0e69bcd809949ee516a4a1597205390878f780c098707a7f18e3df"],
2024-05-20 16:38:36 -04:00
["size", "123456"],
["alt", "a meme that makes you laugh"],
2024-05-29 09:26:00 -04:00
["expiration", "1715691139"],
2024-05-20 16:38:36 -04:00
// ...other metadata
2024-09-03 13:11:31 -04:00
],
2024-05-29 09:26:00 -04:00
"content": "haha funny meme", // caption
2024-07-22 09:55:51 -04:00
"created_at": 1715691130 // upload timestamp
2024-09-03 13:11:31 -04:00
}
2024-05-29 09:26:00 -04:00
]
}
2024-05-14 08:59:59 -04:00
```
2024-05-29 09:26:00 -04:00
`files` contains an array of NIP-94 events
2024-05-14 08:59:59 -04:00
2024-05-20 16:38:36 -04:00
### Query args
- `page` page number (`offset=page*count`)
- `count` number of items per page
2024-05-14 08:59:59 -04:00
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
## Selecting a Server
Note: HTTP File Storage Server developers may skip this section. This is meant for client developers.
A File Server Preference event is a kind 10096 replaceable event meant to select one or more servers the user wants
to upload files to. Servers are listed as `server` tags:
2024-09-03 13:11:31 -04:00
```json
{.
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
"kind": 10096,
"content": "",
"tags": [
["server", "https://file.server.one"],
["server", "https://file.server.two"]
2024-09-03 13:11:31 -04:00
],
// other fields...
NIP-96 - HTTP File Storage Integration (#547) * Add NIP-95 - File Storage * Add missing response info * Make it clear that is is an HTTP file storage server integration * Add monetization suggestion * Use zap split tags for monetization suggestion * Add resize option * Add Zap Gates Integration * Replace /nip96 convention with /.well-known/nostr.json configuration * Relays can choose to also act as HTTP file storage server * Remove nip96 tag in favor of x tags third element * Fix typo * Remove redirect cooperation * Replaced 422 with 400 status code * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Update 96.md Co-authored-by: Jon Staab <jstaab@protonmail.com> * Make file expiration a range and add terms_of_service * Add optional content_type field * Add plans and tos * Remove monetization * Apply minor fixes * Update 96.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> * Fix after review * Add kind 10096 * Apply suggestions * Add suggestions * Remove duplicate field * Add optional is_nip98_required plan config * Add suggestions * Replace x with ox tag for original file hash * Make minor changes * Remove nip96 namespace response field * Add note about alternative file processing flow * Simplify processing flow * Add nostrcheck to server list * Add audio/* example * Explain what metadata to show before processing is done * Add nostrage to list * Add eta * Add sove to list and replace eta with percentage * Fix status code * Add nostr.build to list * Add sovbit * Add optional extra http servers to ox tag * Add void.cat to list * Small fix * Remove ox third array element --------- Co-authored-by: Jon Staab <jstaab@protonmail.com> Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com>
2024-01-08 12:05:01 -05:00
}
```