feat: NIP-17 gift-wrapped check-in DM on confirmation (#5) #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/checkin-dm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #5. On settlement, the guest receives their private check-in details as a NIP-17 gift-wrapped DM.
How it's built — zero vendored crypto
nostr/giftwrap.pybuilds the NIP-59 three-layer wrap from LNbits core primitives:nip44_encrypt+sign_event, local — no bunker round-trip); only public metadata is the recipientp-tag. Seal + wrapcreated_atrandomised into the past per NIP-59.service.send_checkin_dmcomposes the message (room.checkin_instructions+ settings times/policy) and publishes via nostrclient (_publish_signed, extracted from_sign_and_publish).tasks.on_invoice_paidcalls it best-effort — a DM failure never undoes a confirmed, paid booking.Schema
New
Room.checkin_instructions(private access details — address, gate code) + migrationm002. Sent only in the encrypted DM, never in the public listing.Encryption constraint (aligned with ADR-0001, lnbits)
The seal requires the operator to
nip44_encrypt, which aLocalSignercan't do. Per the just-merged ADR-0001 (LNbits sunsets LocalSigner; identity is bunker/client-side), the trigger for these encrypted paths is a bunker-backed operator account — not LocalSigner ever gaining encryption. Until then the DM soft-fails cleanly (logged,None). The ephemeral wrap layer always works — proven by the round-trip test.Tests — 22 pass
p-tagged to the guest, authored by an ephemeral key (≠ operator), no plaintext leak.nip44_decrypt→ recover the operator-authored seal (kind 13). Proves the ephemeral NIP-44 v2 layer is real + interoperable, not just structural.build_dmreturnsNone, no crash.dev(0fd33f16, post on-chain + ADR merges); extension imports clean against updated core; branch is a clean fast-forward onmain(no rebase needed).(Correction: an earlier revision of this body + the
test:commit message said "24 pass" — the actual count is 22.)Not tested live
End-to-end delivery needs an onboarded operator with a bunker-backed signer + nostrclient enabled — a manual step, and the seal is bunker-gated in dev.
Why PR
Money-adjacent extension → PR category. Handing off merge to you via the Forgejo UI.
🤖 Generated with Claude Code