Skip to content

feat: verify Schnorr signatures on incoming relay events#401

Merged
barrydeen merged 1 commit intomainfrom
feat/signature-verification
Apr 1, 2026
Merged

feat: verify Schnorr signatures on incoming relay events#401
barrydeen merged 1 commit intomainfrom
feat/signature-verification

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Adds Keys.verifySchnorr() and NostrEvent.verifySignature() to verify event ID integrity and Schnorr signatures using secp256k1-kmp
  • Verifies every incoming event asynchronously in RelayPool after emission — zero latency added to the relay pipeline
  • Events that fail verification are retracted from the feed and event cache via EventRepository.removeEvent()

Test plan

  • Install on device and browse feeds — verify no valid events are incorrectly removed
  • Check logcat for RelayPool: Invalid signature warnings to confirm verification is running
  • Verify feed loading performance is unchanged (no perceptible delay)

Adds async signature verification to the relay pipeline. Events are
emitted immediately to keep the UI responsive, then verified on a
background coroutine. Events with invalid signatures are retracted
from the feed and event cache.
@barrydeen barrydeen merged commit 77e3d43 into main Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant