# Stop wiping profiles: merge semantics for replaceable events

**Status:** Researching · **Opened:** 2026-07-10

Profiles (kind 0) and contact lists (kind 3) are replaceable events: last write wins, whole event. A client that publishes its own partial view of a profile silently erases every field it doesn't understand — for everyone, everywhere. The protocol's own tracker has documented this since 2023 (issue #261), and it bites real users: Damus's "Balaji's bug" was a profile wiped by exactly this mechanism. Relays can't fix it — for each pubkey and kind, only the latest event is stored. Only clients can.

## The gap

There is no stated rule that a client publishing a replaceable event should first merge against the latest known state and preserve fields it doesn't recognize. Every client that gets this right does so by folklore; every new client gets a chance to wipe your lightning address.

## What we're sketching

A small SHOULD: before publishing a replaceable kind, fetch the latest known event, deep-merge your changes into it, and preserve unknown fields verbatim. Alongside the prose, the part we think matters more: a conformance fixture set — event pairs where a correct merge has one right answer — and a reference implementation as an MKStack skill/hook, so scaffolded apps get safe publishing without reading a spec. Open question we're researching: whether unknown-field preservation can be specified tightly enough to test without freezing legitimate field deletion.

## Why us

We're shipping apps on the scaffold this failure class lives in, and "your app quietly destroyed my profile" is the kind of trust failure a civic tool can't survive.

## Receipts

- [nostr-protocol/nips issue #261](https://github.com/nostr-protocol/nips/issues/261) — the field-overwrite failure class, documented and open
- [Damus issue #1994 — "Profile is wiped (Balaji's bug)"](https://github.com/damus-io/damus/issues/1994)
- [Damus issue #2264 — bookmarks wiped](https://github.com/damus-io/damus/issues/2264) — same lesson, different surface
