diff --git a/relay/event.py b/relay/event.py index dc23234..ed9054f 100644 --- a/relay/event.py +++ b/relay/event.py @@ -26,10 +26,17 @@ class NostrEvent(BaseModel): size: int = 0 def nostr_dict(self) -> dict: - _nostr_dict = dict(self) - _nostr_dict.pop("relay_id") - _nostr_dict.pop("publisher") - return _nostr_dict + # Only the NIP-01 fields go on the wire; storage columns such as + # relay_id, publisher and size must not leak into EVENT responses. + return { + "id": self.id, + "pubkey": self.pubkey, + "created_at": self.created_at, + "kind": self.kind, + "tags": self.tags, + "content": self.content, + "sig": self.sig, + } def serialize(self) -> list: return [0, self.pubkey, self.created_at, self.kind, self.tags, self.content]