GM!

Working on this issue: https://github.com/swentel/nostr-php/issues/42 of #nostr-php

#NostrDev #PHP

Reply to this note

Please Login to reply.

Discussion

Nice, I didnt know there was a nostr PHP. Be careful with the stringify function too, because different languages do it in different ways. This really needs to be standardized in future with test vectors, for nostr to interopate at scale in multiple langauges.

Which stringify function? The lib is using the json_encode and json_code functions for getting the PHP objects (the Nostr events) as a json string.

Thank you nostr:npub1qe3e5wrvnsgpggtkytxteaqfprz0rgxr8c3l34kk3a9t7e2l3acslezefe for maintaining nostr-php. I think i will check it and see if i can help in one of the issues.

We need better relay error handling 🤓

Yes, some relays might give weird responses 😅

I think it is one of the reasons that nostr-tools library has two validation function validStructure and validSignature

Are those functions used before sending an event?

I started using NDK (which is comparable with nostr-tools imo) a couple of weeks ago, still learning a lot what's in it.

Yes, in nostr-filter-relay, the functions are used before sending events and also when receiving events from relays

Oh same, i just recently learn using NDK. I think NDK might be easier to learn especially for frontend devs.

Cool. A verify function for events was recently added in nostr-php by nostr:npub100mahqlhxg50thmt5dyynu40nl25hat9kkkknzk8pqjfkvgq0xsqtdfyy5 which I rewrote a bit yesterday.