fix(nutzaps): default kind:10019 relay tags to inbox list, drop dm

The advertised `relay` tags in our own kind:10019 now copy the NIP-65
inbox relay list only, rather than inbox + DM. Inbox relays are the
canonical "where others reach me" set, so they are the natural default
for "where to send me nutzaps". DM relays stay in the wallet's inbound
subscription as a safety net, but don't belong in the public kind:10019.

The publish destination of the kind:10019 event itself is unchanged — it
still broadcasts to our outbox via sendLiterallyEverywhere; only the relay
tags inside the event changed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHcZ2gv8ro9Q2bEiTSiHD8
This commit is contained in:
Claude
2026-06-22 09:38:31 -04:00
committed by Vitor Pamplona
parent 33fdd34cf0
commit cd14994859
2 changed files with 10 additions and 8 deletions
@@ -895,10 +895,11 @@ class CashuWalletState(
ops.publishWalletEvents(
mints = currentMints,
p2pkPrivkeyHex = manualPrivkeyHex?.takeIf { it.isNotBlank() },
// Advertise our inbox + DM relays as the nutzap relays (NIP-65
// Advertise our NIP-65 inbox relays as the nutzap relays (NIP-65
// outbox model): senders publish kind:9321 where we read inbound
// events, matching the wallet's inbound-nutzap subscription set.
nutzapRelays = (inboxRelaysFlow.value + dmRelaysFlow.value).toList(),
// events. We listen on a wider set (inbox + DM + these tags), but
// the kind:10019 default copies the inbox relay list, not outbox.
nutzapRelays = inboxRelaysFlow.value.toList(),
)
// The NUT-13 seed (derived from the P2PK key) is invalidated by
// applyEvents when the new kind:17375 round-trips in, so it re-derives
@@ -500,12 +500,13 @@ class CashuWalletViewModel : ViewModel() {
ops.publishWalletEvents(
mints = mints,
p2pkPrivkeyHex = privkey,
// Advertise our inbox + DM relays as the nutzap relays, so
// senders publish kind:9321 where we read incoming events
// (NIP-65 outbox model). Mirrors the relay set the wallet
// subscribes to for inbound nutzaps.
// Advertise our NIP-65 inbox relays as the nutzap relays,
// so senders publish kind:9321 where we read incoming
// events (NIP-65 outbox model). The kind:10019 default
// copies the inbox relay list, not outbox; the wallet
// still subscribes to a wider inbox + DM + tags set.
nutzapRelays =
(acc.notificationRelays.flow.value + acc.dmRelays.flow.value)
acc.notificationRelays.flow.value
.toList(),
)
_createState.value = CashuWalletCreateState.Success