NIP-59 gift wraps may be rejected under strict createdAtSecondsPast config #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
NIP-59 (Gift Wrap) instructs clients to randomise
created_atup to 2days in the past for metadata protection (timing-correlation defense).
Our
EventValidator._created_at_in_rangeapplies a singleoperator-configured past-window to all kinds:
Default is
0(unlimited past) so gift wraps work out of the box, butany operator who sets a strict NIP-22 past-window — say "1 hour" to
suppress historical replays — will silently break NIP-17 messaging on
their relay.
Suggested approach
Either:
that bypass the past-window check; default to
[1059].kind == 1059, raise the past-window to atleast 2 days × 1.1 (≈4 hours of slack) regardless of config.
Option 1 is more flexible; option 2 is cheaper to implement and matches
the spirit of NIP-59 without operator effort.
Survey
Surveyed relays don't special-case 1059 timestamps either:
PreventTimestampsInThePast(threshold)policy applies uniformlySo this is a quality-of-life improvement we'd lead on, not a spec gap.
Out of scope
Deferred from #PR-feat-nip17-gift-wrap-support. Not blocking the default
nostrmarket NIP-17 flow because the default config has no past-window.