Add queryable x tags to kind 360 place photo events #129

Merged
raucao merged 2 commits from feature/nostr-x-tag into master 2026-11-27 15:49:41 +00:00
Owner

Closes #122.

Adds top-level x tags carrying the SHA-256 of the files a kind 360 event references, so Blossom blob stores and UIs can associate uploads with place-photo events.

The NIP draft now documents one x tag per referenced file — the primary media and its thumbnail — with the primary hash also inside imeta to anchor which of the hashes is primary. The hashes are queryable via #x, and clients may use the full set for blob indexing and lifecycle (for example, thumbnail blobs no longer look orphaned).

Marco emits both hashes from the values returned by blossom.upload and parses them back, so photo deletion now uses the event's x hashes instead of scraping Blossom URLs, keeping URL extraction only as a fallback for legacy events without x.

Tests: pnpm test passes (481 tests) and pnpm lint is clean.

Not included in this PR: checking via #x that a blob is no longer referenced by another event before deleting it (documented as a SHOULD in the NIP).

Closes #122. Adds top-level `x` tags carrying the SHA-256 of the files a kind 360 event references, so Blossom blob stores and UIs can associate uploads with place-photo events. The NIP draft now documents one `x` tag per referenced file — the primary media and its thumbnail — with the primary hash also inside `imeta` to anchor which of the hashes is primary. The hashes are queryable via `#x`, and clients may use the full set for blob indexing and lifecycle (for example, thumbnail blobs no longer look orphaned). Marco emits both hashes from the values returned by `blossom.upload` and parses them back, so photo deletion now uses the event's `x` hashes instead of scraping Blossom URLs, keeping URL extraction only as a fallback for legacy events without `x`. Tests: `pnpm test` passes (481 tests) and `pnpm lint` is clean. Not included in this PR: checking via `#x` that a blob is no longer referenced by another event before deleting it (documented as a SHOULD in the NIP).
raucao added 2 commits 2026-11-27 15:26:05 +00:00
Add top-level x tags carrying the SHA-256 of the primary media and thumbnail, following NIP-68's queryable-hash pattern. The imeta x anchors which hash is primary; parsing, deletion, querying and examples are covered.
Publish and consume x tags on kind 360 place photos
CI / Lint (pull_request) Successful in 59s
CI / Test (pull_request) Successful in 1m24s
Release Drafter / Update release notes draft (pull_request) Successful in 16s
748bc626a8
Emit top-level x tags for the primary media and thumbnail SHA-256 hashes (with the primary also inside imeta) when publishing. Parsed photos expose the hash set, and photo deletion prefers it over extracting hashes from Blossom URLs, keeping URL extraction as a fallback for legacy events.
raucao added the docsenhancementnostr labels 2026-11-27 15:27:51 +00:00
raucao merged commit 0247930e3b into master 2026-11-27 15:49:41 +00:00
raucao deleted branch feature/nostr-x-tag 2026-11-27 15:49:41 +00:00
Sign in to join this conversation.