nostr:npub1utx00neqgqln72j22kej3ux7803c2k986henvvha4thuwfkper4s7r50e8 you may actually be interested in this. It's a small PHP binding to libsecp256k1 specifically tailored to validate Nostr events. Will publish soon.

Reply to this note

Please Login to reply.

Discussion

Please! I am using schnoor signatures and manually formatting events and hashes right now and it's really annoying

Honestly it's still a bit annoying to parse, though it flies compared to simplito/elliptic-php.

But you just made me realize I could write a nostr_validate(event) native function that takes the json and simply returns true/false 👀

I need an easy function to send a signed event and validate the signature is valid

Just like validateSignature($event)

For now I have these. They all use libsecp256k1 under the hood, so they run as fast as possible.

nostr_derive_pubkey(string $privateKey): string

nostr_sign(string $privateKey, string $message): string

nostr_verify(string $publicKey, string $message, string $signature): bool

Nostr_verify baby! Pls publish!