- commit
- 3363cbfe86f65173c29dab9e8cfffae31741e0f8
- parent
- 317c75b6635da3d04bbdbde3ec0173633deac495
- author
- Dami <dami.etoile@gmail.com>
| M | docs/ | 4 | ++++ |
| M | docs/ | 4 | ++-- |
| M | docs/ | 3 | ++- |
| M | src/ | 6 | ++++-- |
@@ -80,6 +80,10 @@ The relay has a profile of its own, made from the name, description and icon on
8080 8181 Your relay stores images and files too. Clients that support Blossom upload to `https://<name>.bind.ws` and get a link by hash. A client can ask first whether an upload would be accepted, and can have the relay copy a file from another server by URL instead of uploading it again. Set the maximum upload size on the Rules tab.8282 83+Clients that speak NIP-96 instead find the same store through `/.well-known/nostr/nip96.json`. The two doors share one bucket and one file list, so a file uploaded through either is served, listed and deleted through both, and every answer carries the file's NIP-94 tags.84+85+To report a file, send a signed NIP-56 report that names its hash to `PUT /report`. It lands in the owner's reports queue next to reported events. Deleting a reported file also blocks its hash, so it cannot be uploaded again.86+8387 ## Scripts8488 8589 If you write scripts, the relay has an HTTP door. Sign a request with your key (NIP-98) and post to `/events`, `/query` or `/count`. No websocket needed.@@ -41,7 +41,7 @@ SQLite tables: `events`, `tags` (single-letter tags only), an FTS5 `search` tabl
4141 4242 Only kinds that carry prose go into the search index: profiles, notes, threads, comments, highlights, articles and wiki pages.4343 44-Blobs live in R2 under `<name>/<sha256>`. Their descriptors live in the relay's database, so they count toward storage and appear in the console.44+Blobs live in R2 under `<name>/<sha256>`. Their descriptors live in the relay's database, so they count toward storage and appear in the console. Two doors lead to the same bucket and table: Blossom (`blossom.ts`) and NIP-96 (`nip96.ts`), a thin adapter that reuses the Blossom store, gate and URLs. Descriptors and NIP-96 answers carry the NIP-94 tags the relay can vouch for without decoding the file: `url`, `m`, `x`, `ox` and `size`. Blob reports (BUD-09) go into the `reports` table with the sha256 in `target_event` and the uploader in `target_pubkey`; resolving one with delete removes the blob and puts its hash on the banned id list, which every upload door checks.4545 4646 ## Alarm4747 @@ -86,4 +86,4 @@ Moderators cannot act on the owner or on each other; only the owner appoints or
8686 8787 ## Protocol surface8888 89-NIP-01, 09, 11, 13, 17/59 private kinds, 29, 40, 42, 45 with HLL, 50, 56, 62, 67, 70, 77, 86, 98, plus NIP-05, NIP-43, NIP-57 and Blossom BUD-01/02/04/06. `test/conformance` is a black-box suite that runs against any relay URL.89+NIP-01, 09, 11, 13, 17/59 private kinds, 29, 40, 42, 45 with HLL, 50, 56, 62, 67, 70, 77, 86, 98, plus NIP-05, NIP-43, NIP-57, NIP-96 with NIP-94, and Blossom BUD-01/02/04/06/08/09. `test/conformance` is a black-box suite that runs against any relay URL.@@ -20,7 +20,8 @@ src/
2020 manage.ts NIP-86 methods over NIP-982121 fuel.ts meters, prices, receipts, LNURL2222 identity.ts relay keypair and NIP-43 roster23- blossom.ts BUD-01/02 on R223+ blossom.ts BUD-01/02/04/06/08/09 on R224+ nip96.ts NIP-96 door to the same bucket and table2425 bridge.ts HTTP bridge2526 invites.ts invite codes and the invite page2627 nip05.ts names@@ -92,7 +92,8 @@ const PROTOCOL: [string, string][] = [
9292 ["05", "Members with a name are you@name.bind.ws."],9393 ["43", "The relay signs and publishes its member list."],9494 ["57", "Zaps to the relay add fuel. The receipt is stored on the relay."],95- ["Blossom", "Upload and fetch files by hash on the same host. Check an upload before sending it, or mirror a file from a URL."],95+ ["Blossom", "Upload and fetch files by hash on the same host. Check an upload before sending it, mirror a file from a URL, report one by hash."],96+ ["94, 96", "The same files through the NIP-96 door, with NIP-94 metadata in every answer."],9697 ];9798 9899 function table(heads: string[], rows: string[][], right: number[] = []): string {@@ -114,7 +115,8 @@ export function landing(req: Request, env: Env): Response {
114115 ["POST /", "NIP-86", "NIP-98, owner", "claim and the management methods"],115116 ["POST /lease", "lease", "optional NIP-98", `A temporary relay for ${leaseDays(env)} days. A signature reserves the claim for that key.`],116117 ["POST /events /query /count", "HTTP bridge", "NIP-98", "The signer has the same access as an authenticated socket."],117- ["PUT /upload, GET /<sha256>", "Blossom", "kind 24242", "Stored in R2. Counted as files. HEAD /upload checks first; PUT /mirror copies from a URL."],118+ ["PUT /upload, GET /<sha256>", "Blossom", "kind 24242", "Stored in R2. Counted as files. HEAD /upload checks first; PUT /mirror copies from a URL; PUT /report files a report."],119+ ["POST /nip96, GET /.well-known/nostr/nip96.json", "NIP-96", "NIP-98", "Same bucket and file list as Blossom. NIP-94 tags in every answer."],118120 ["GET /.well-known/nostr.json", "NIP-05", "none", "Members that have a name."],119121 ["GET /fuel, POST /fuel/invoice", "NIP-57", "none", "Gauges are public. The invoice comes from a signed zap request."],120122 ]);