Surface ticket buyer npub (nostr_identifier) in the event stats endpoint #25

Open
opened 2026-06-17 17:12:37 +00:00 by padreug · 0 comments
Owner

For the webapp's hoster scan list, which should show the buyer's npub/username (aiolabs/webapp#117).

Context

name is not the username — the model treats name+email and user_id as mutually-exclusive alternatives (CreateTicket.validate_identifiers): app purchases send user_id (and name is null), guests send name+email. So the hoster list has no reliable buyer identity today.

The good news: tickets already store the buyer's nostr identity as extra.nostr_identifier — a pubkey or nip-05, normalized in views_api.py (normalize_public_key), used for notifications. It's just not returned by the stats endpoint, whose per-ticket payload is only { id, name, registered, registered_at }.

Proposed change

Include the buyer's nostr_identifier (the pubkey/nip-05) — and ideally an npub-encoded form — in the GET /tickets/event/{id}/stats per-ticket payload. From the pubkey the webapp can:

  • show the npub directly,
  • resolve nip-05 / kind-0 display name (a username) via the relays.

Optionally also resolve and include the LNbits username for user_id-based tickets.

Webapp follow-up

aiolabs/webapp#117 — add pubkey/npub to EventTicket and render username + npub in the scan list.

From the 2026-06-17 webapp design review.

For the webapp's hoster scan list, which should show the buyer's npub/username (aiolabs/webapp#117). ## Context `name` is **not** the username — the model treats `name`+`email` and `user_id` as mutually-exclusive alternatives (`CreateTicket.validate_identifiers`): app purchases send `user_id` (and `name` is null), guests send `name`+`email`. So the hoster list has no reliable buyer identity today. The good news: tickets already store the buyer's nostr identity as **`extra.nostr_identifier`** — a pubkey or nip-05, normalized in `views_api.py` (`normalize_public_key`), used for notifications. It's just not returned by the stats endpoint, whose per-ticket payload is only `{ id, name, registered, registered_at }`. ## Proposed change Include the buyer's `nostr_identifier` (the pubkey/nip-05) — and ideally an npub-encoded form — in the `GET /tickets/event/{id}/stats` per-ticket payload. From the pubkey the webapp can: - show the **npub** directly, - resolve **nip-05 / kind-0 display name** (a username) via the relays. Optionally also resolve and include the LNbits **username** for `user_id`-based tickets. ## Webapp follow-up aiolabs/webapp#117 — add `pubkey`/`npub` to `EventTicket` and render username + npub in the scan list. _From the 2026-06-17 webapp design review._
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/events#25
No description provided.