Production checklist
Run through this list before shipping a Marmot app. Each item links to the page that explains it.
Identity and key packages
- [ ] Persist one
clientIdper account on each install. It must be 32 random bytes in lowercase hex. Never derive it from a device name. Key packages - [ ] Keep a key package published. Call
client.keyPackages.ensurePublished({ relays })at startup, using your NIP-65 write relays. Nobody can invite you without one. Key packages - [ ] Publish a kind 10050 inbox relay list. Pass the same relays to
client.invites.listen(). Welcomes only arrive on inbox relays. Invites
Storage
- [ ] Persist every store, not just the two required ones. Then check
client.ingestPersistence.kind === "durable". Storage - [ ] Protect
keyPackageStorelike a signing key.EncryptedKeyValueStoreis a demo, not at-rest encryption. Storage - [ ] Isolate all stores for each account, and run one client per account. Multi-account
Sync and messaging
- [ ] Use
client.groups.connectAll()to receive group traffic. Don't write your own subscription, becauseconnectAll()handles verification, deduplication and ordering. Messages - [ ] Make your network adapter's
requestreject on failure. A resolved empty array is treated as "no more history", so swallowed errors silently skip messages. Network - [ ] Self-update after joining. Once the group has caught up, call
group.selfUpdate(), then rotate the key package that was used. Invites - [ ] Let convergence settle. Sends are queued while the group resolves concurrent commits. Don't retry them yourself, and use the client's commit APIs rather than editing group state, because commits are published before they are applied. Messages
- [ ] Handle fork retractions. When a result is
invalidated, remove that message from your UI. Messages - [ ] Leave
convergencePolicyat its default. Every member must use the same branch-selection rules.maxRewindCommits: Infinityis only for debugging. Fork history
Relays
- [ ] Choose relays deliberately. Key packages go to your NIP-65 write relays, and Welcomes go to the invitee's kind 10050 inbox relays. Group traffic goes to the group's own relays, which should be several, for redundancy. Key packages
- [ ] Don't treat a relay ack as delivery.
ok: trueonly means a relay accepted the event. Check a group'spendingWelcomesfor invites that haven't been delivered yet. Groups
Lifecycle
- [ ] Clean up. Abort watchers with
signal,unsubscribe()yourconnectAll()andlisten()handles, and unload groups when switching accounts. UI frameworks - [ ] Remove legacy groups. A group that doesn't require the
0x8009account identity proof reportsgroup.profileSupport.kind === "unsupported". It can't send, receive or be joined, so offer todestroy()it. Groups