Implement NIP-62 Request to Vanish support#180
Open
alltheseas wants to merge 3 commits intohoytech:masterfrom
Open
Implement NIP-62 Request to Vanish support#180alltheseas wants to merge 3 commits intohoytech:masterfrom
alltheseas wants to merge 3 commits intohoytech:masterfrom
Conversation
Two-phase approach: writer thread sets a VanishPubkey marker instantly (blocking re-storage), cron thread sweeps and deletes events in batches every 30s to avoid long write locks. Deletes all authored events up to the vanish timestamp plus kind 1059 gift wraps addressed via p-tag. Kind 62 events are preserved for bookkeeping and protected from kind 5 deletion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests vanish marker blocking, cross-pubkey isolation, kind 5 protection of kind 62, max-timestamp semantics, and boundary conditions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38 tests covering the full NIP-62 Request to Vanish lifecycle over websocket against a live strfry relay: event submission, cron-based deletion sweep (polled), re-broadcast prevention, relay tag validation (matching, non-matching, missing), kind 5 protection of kind 62 in both orderings, deletion tombstone bypass via import path, gift wrap cleanup and blocking (ALL_RELAYS and specific serviceUrl), NIP-09 deletion event sweep, cross-pubkey isolation, timestamp boundary semantics, persistence across restart, NIP-11 advertisement, and feature flag behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d71086c to
c1edf2f
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VanishPubkeymarker instantly (blocking re-storage), cron thread sweeps and deletes events in batches every 30s to avoid long write locks. Deletes all authored events up to the vanish timestamp plus kind 1059 gift wraps addressed via p-tag. Kind 62 events are preserved for bookkeeping and protected from kind 5 deletion.cfg().relay__nip62__enabledguard inwriteEvents()so non-websocket paths (import, sync, router) respect the feature flag. Skip deletion index (tombstone) check for kind 62 events per spec: "Kind 5 deletion of a kind 62 event has no effect."NIP-62 spec coverage
.pubkeyuntil.created_attest_vanish_all_relaysrelayvaluetest_vanish_no_relay_tag_rejectedtest_vanish_specific_relaytest_gift_wrap_deletiontest_vanish_all_relays,test_vanish_persists_after_restarttest_kind5_cannot_delete_kind62,test_kind5_tombstone_does_not_block_kind62["relay", "ALL_RELAYS"]test_nip09_deletion_events_sweptTest plan
make test-subid— unit tests passperl test/writeTest.pl— 36 tests pass (30 existing + 6 NIP-62)python3 test/nip62_e2e_test.py— 39 E2E tests pass (requirespip install secp256k1 websockets)Closes #179
🤖 Generated with Claude Code