nostrver-se / nostr-php

PHP helper library for Nostr https://nostr-php.dev
https://nostr-php.dev
MIT License
53 stars 15 forks source link

New method to verify nostr events #17

Closed quentintaranpino closed 11 months ago

quentintaranpino commented 1 year ago

Create a new method to verify if a nostr event is well formed and also of course well signed.

swentel commented 1 year ago

Yes, validation is something that is definitely needed!

We're closing to getting #14 in which reorganizes the (base) classes and interfaces a bit. After that, it should become much easier to add validation (methods) and/or exceptions!

quentintaranpino commented 1 year ago

Ok, thank you!

Sebastix commented 1 year ago

For work later on how it's done in other libs:

https://github.com/nbd-wtf/nostr-tools/blob/5539e5cf896d7aad0849e2ac8b002def6f513750/event.ts#L81 https://github.com/ethicnology/dart-nostr/blob/develop/lib/src/event.dart#L328

quentintaranpino commented 1 year ago

Another resource, it will be compatible?

https://github.com/kornrunner/php-secp256k1

quentintaranpino commented 1 year ago

More information, I've tried to integrate it myself but I don't have enough experience with this.

https://github.com/phpecc/phpecc/blob/master/examples/verify_signature.php