From a1d41da92a9b171efa2c80772a8faae70034ba2f Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Mon, 9 Sep 2024 14:25:24 -0500 Subject: [PATCH] add document for returning nip94 tags --- buds/08.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 buds/08.md diff --git a/buds/08.md b/buds/08.md new file mode 100644 index 0000000..0b79e8d --- /dev/null +++ b/buds/08.md @@ -0,0 +1,33 @@ +# Nostr File Metadata Tags + +`draft` `optional` + +Describes how a server could return nostr [NIP-94 File Metadata](https://github.com/nostr-protocol/nips/blob/master/94.md) tags from the `/upload` and `/mirror` endpoints + +## Returning tags + +As described in [BUD-02](./02.md#blob-descriptor) servers MAY add any additional fields to a blob descriptor + +Servers MAY return an additional `nip94` field in the [blob descriptor](./02.md#blob-descriptor) from the `/upload` or `/mirror` endpoints + +The `nip94` field should contain a JSON object with the keys being the tag names defined in [NIP-94](https://github.com/nostr-protocol/nips/blob/master/94.md) + +An example response would look like: + +```json +{ + "url": "https://cdn.example.com/b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553.pdf", + "sha256": "b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553", + "size": 184292, + "type": "application/pdf", + "uploaded": 1725909682, + "nip94": { + "url": "https://cdn.example.com/b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553.pdf", + "m": "application/pdf", + "x": "b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553", + "size": 184292, + "magnet": "magnet:?xt=urn:btih:9804c5286a3fb07b2244c968b39bc3cc814313bc&dn=bitcoin.pdf", + "i": "9804c5286a3fb07b2244c968b39bc3cc814313bc" + } +} +```