Nostr.Event.Validator (Nostr Lib v0.2.1)

View Source

Internal module for validating Nostr events.

Validation checks:

  1. ID verification - Recomputes SHA256 hash and compares with event ID
  2. Signature verification - Verifies Schnorr signature against pubkey and event ID

Both checks must pass for an event to be considered valid.

Summary

Functions

Validates an event's ID and signature.

Functions

valid?(event)

@spec valid?(Nostr.Event.t()) :: boolean()

Validates an event's ID and signature.

Returns true if both the computed ID matches the event ID and the Schnorr signature is valid for the given pubkey.