Replies (10)

better than js, that's for sure, but you can't build true nostr apps in php, not unless you either: - don't care about decentralization - want the user to self host their own client both of which may be fine under certain circumstances
because you can't have a full php application that connects to the user's signer, you're gonna need some js for that (or have the user enter their nsec -- terrible idea), and at that point you just have a mostly js application, with some php. I'm aware that there are tools to execute php in the browser, but at that point you're just running javascript with extra steps. if you want a web frontend to use nostr, be decentralized (i.e. the server is not the tool contacting the websockets) and you don't assume every user is gonna self-host the client, there's no way around that.
let me try to explain it; to build a nostr client you need the following: - connect to a websocket - send REQs and read EVENTs - sign events and send those up the socket you can do that in php, especially if you use newer php runtimes, but if you do it, then you are a centralizing force. Users don't connect to the sockets, send requests etc, but rather connect to your php server, which is now acting as the source of truth (so technically you have as much control as you want to decide what events to filter out for example). This is similar to replacing your database with nostr. This might be fine for some applications, honestly, especially those where decentralization is not important, but for users that want to use decentralized apps, you're not helping :) does that make more sense?
Hmmm. Decentralized doesn't mean distributed. It means that there isn't a center hub. PHP has proven to be a highly-decentralizing force because it is used to generate custom webpages, that can be easily maintained, like with Wordpress or October CMS. This is a command-line interface to generate publications, like books. It's meant to be installed on a PC and handle large files from the hard drive. Most software applications are not social media. image
remember that was a caveat I included in the first message > if you want a web frontend to use nostr, be decentralized (i.e. the server is not the tool contacting the websockets) and you don't assume every user is gonna self-host the client, there's no way around that. in the case you're talking about every user is going to "self-host" (tho more like "run") your application, so you're not a centralizing force!
Juraj Hudák's avatar
Juraj Hudák 3 months ago
Your picture is about Centralized, Federated (not Decentralized), Distributed. WordPress is Centralized, but it is possible connect to Federated network, and send data to Decentralized, but it will never be a decentralized solution. image