feat: use MIP-00 KeyPackage Relay List for publish/fetch + seed default

- publishMarmotKeyPackage / publishMarmotKeyPackages now target the
  relays advertised in the user's kind:10051 KeyPackage Relay List
  (MIP-00), falling back to outbox relays when the list is empty.
- fetchKeyPackageAndAddMember looks up the invitee's kind:10051
  before falling back to their NIP-65 outbox.
- Add kind:10051 to user metadata + account info subscription filters
  so invitees' KeyPackage relay lists are cached in time for invites.
- Seed a default kind:10051 on signup from the default NIP-65 relay set
  and publish it alongside other account bootstrap events.
- Warn the user when creating a Marmot group without a kind:10051 list
  and offer to create one from their current outbox relays.
- Sync overload for KeyPackageRelayListEvent.create to support the
  signup-time temp signer.

https://claude.ai/code/session_01B7kTUFAPvWarWd6fvQKNBy
This commit is contained in:
Claude
2026-04-17 19:19:11 +00:00
parent c7a3c5c4a3
commit a3ca22e175
8 changed files with 166 additions and 43 deletions
@@ -27,6 +27,7 @@ import com.vitorpamplona.quartz.nip01Core.core.HexKey
import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl
import com.vitorpamplona.quartz.nip01Core.relay.normalizer.isLocalHost
import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner
import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerSync
import com.vitorpamplona.quartz.nip31Alts.AltTag
import com.vitorpamplona.quartz.utils.TimeUtils
@@ -70,6 +71,12 @@ class KeyPackageRelayListEvent(
createdAt: Long = TimeUtils.now(),
): KeyPackageRelayListEvent = signer.sign(createdAt, KIND, createTagArray(relays), "")
fun create(
relays: List<NormalizedRelayUrl>,
signer: NostrSignerSync,
createdAt: Long = TimeUtils.now(),
): KeyPackageRelayListEvent = signer.sign(createdAt, KIND, createTagArray(relays), "")
suspend fun updateRelayList(
earlierVersion: KeyPackageRelayListEvent,
relays: List<NormalizedRelayUrl>,