From 64eb1a81e806a3e5ca4732ed23d76cf56b024413 Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Tue, 20 Feb 2024 19:06:38 +0000 Subject: [PATCH] basic explanation --- Nostr.md | 23 +++++++++++++++++++++++ README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ Server.md | 11 +++++++++++ 3 files changed, 76 insertions(+) create mode 100644 Nostr.md create mode 100644 README.md create mode 100644 Server.md diff --git a/Nostr.md b/Nostr.md new file mode 100644 index 0000000..3fb2513 --- /dev/null +++ b/Nostr.md @@ -0,0 +1,23 @@ +# Blossom nostr integration + +Blossom uses nostr for public / private key identities. Users are expected to sign "Client Authentication" events to prove their identity when uploading or deleting blobs + +## User Server Discovery + +Users can publish a kind `10063` event with a list of `r` tags indicating where other users should look to find their published blobs + +### Example + +```json +{ + "kind": 10063, + "content": "", + "tags": [ + ["r", "https://cdn.self.hosted"], + ["r", "https://cdn.satellite.earth"] + ], + "created_at": 1708454797, + "id": "...", + "sig": "..." +} +``` diff --git a/README.md b/README.md new file mode 100644 index 0000000..74dd68e --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# 🌸 Blossom + +Blobs stored simply on mediaservers + +## What is it? + +Blossom is a spec of http endpoints for storing blobs on publicly accessible servers + +## How dose it work? + +Blobs are packs of binary data addressed by their sha256 hash + +Blossom Servers expose four endpoints for managing blobs + +- `GET /` (optional file `.ext`) +- `PUT /upload` +- `GET /list` +- `DELETE /` + +## Blob Descriptor + +A blob descriptor is a JSON object containing `url`, `sha256`, `size`, `type`, and `created` fields + +- `url` A public facing url this blob can retrieved from +- `sha256` The sha256 hash of the blob +- `size` The size of the blob in bytes +- `type` (optional) The MIME type of the blob +- `created` The unix timestamp of when the blob was uploaded to the server + +Servers may include additional fields in the descriptor like `magnet`, `infohash`, or `ipfs` depending on other protocols they support + +## Nostr Identities + +Blossom uses nostr public / private keys for identities. Users are expected to sign "Client Authentication" events to prove their identity when uploading or deleting blobs + +## Server Implementation + +See [Server](./Server.md) + +## Client Implementation + +Example Implementation: [blossom-client](https://github.com/hzrd149/blossom-client) (TypeScript) diff --git a/Server.md b/Server.md new file mode 100644 index 0000000..4b434bc --- /dev/null +++ b/Server.md @@ -0,0 +1,11 @@ +# Blossom Server Implementation + +## Endpoints + +### GET / - Get Blob + +### GET /list + +### PUT /upload + +### DELETE /