fix P0 issues in NIP-4e gift wrap handling

This commit is contained in:
2026-10-04 12:54:11 +07:00
parent e34f325164
commit c15bd3a82d
3 changed files with 112 additions and 81 deletions
+5
View File
@@ -1,5 +1,10 @@
# NIP-4e Audit Report
> **Update**: The P0 findings (C1, C2, C3) are now fixed — seals are always signed by the
> identity key, `extract_rumor` falls back to the device key, the `DEVICE_GIFTWRAP`
> subscription is created, and trashed wraps are retried on `DeviceEvent::Set`.
> The remaining findings (F1–F8, P2 items, UX bugs) are still open.
**Scope**: `crates/nip4e/src/lib.rs` (key announcement/sync), the send path (`crates/chat/src/room.rs`), the receive path (`crates/chat/src/lib.rs`), UI integration (`crates/workspace`), compared against the [NIP-4e draft](https://github.com/nostr-protocol/nips/blob/per-device-keys/4e.md) and [PsstPsst's implementation](https://github.com/CodyTseng/psstpsst) (`docs/protocols/nip4e.md` + `docs/protocols/nip17-extensions.md`, plus rust-nostr's NIP-59 source to verify crypto mechanics).
## Executive summary