You just need to refer to the nips and implement your own methods. This is what your asking. nips are as basic as it gets. You'll need to know how to work with web sockets in your chosen language.
Discussion
Just starting basically with NIP-01, hello world as note. I think it will use client side javascript, as it is in the browser for websockets. ChatGPT keeps providing me libraries while I asked do it without libraries in the prompt. It seems the cryptography part for handling nsec/signing is too big/hard to handle for chatgpt to include it directly in the javascript. So I am curious if there is any hello world example , starting point or so with this.
You need to learn about hex keys. Bech32. You will have to use SOME libraries. I mean... You could write it all but you're talking about some very complex operations.
I think I asked it wrongly. I don't want to load those libraries externally from a CDN or so, just seeing everything together in one file so I can understand the process and there are no external dependencies. Such as https://www.bitaddress.org/ is using one file for generating bitcoin keys. ChatGPT told me to use secp256k1 key generation, but Bech32 can be used as well?
Bech32 is how npubs are encoded from hex keys. Secp256k is the right curve for generating nostr keys.
Thanks again. I tried it again, and what I've understood now is that ChatGPT tried to let me use libraries that are for server side (nodejs), so I used browserify to make client side versions of elliptic and bech32 and told chatgpt to use those. The result is at https://gitlab.com/no-limit/hi-plebs/ . Still it's not working. At https://hi-plebs-no-limit-bdb95ca026aabb14656ee72db9d19f41c60c53621bc67.gitlab.io/ a websocket is connecting to a relay well, but when sending a note I am getting "Failed to process private key: EC is not a constructor". Do you know if there is some documentation how to handle the elliptic library with nostr client side? As elliptic file is too big to be fully read by chatgpt.