core-js
core-js copied to clipboard
looking for example
I want to generate a nimiq wallet inside my app (each user will be given their own nimiq wallet that they can use to tip other users on my platform).
How would I do this?
I'm using deno (server side) and web components on the client.
Hi there!
Here's a couple considerations you have to make first:
- Will users own the keys to their wallet? If you give custody to them, you can generate and handle the wallet in the client code in the browser (javascript, currently supported). However, you also need to establish and maintain a Nimiq network connection (consensus) in the browser and provide a backup/recovery to the users then.
- If you are creating and managing the wallet for your users, you are managing their crypto, which comes with it's own challenges. First and foremost the Nimi library is not tested and probably won't work out-of-the-box in Deno. Second, you are responsible for your users' money, so depends on how much they are going to store.
Client-side
To create a Nimiq instance, wallet and transactions client-side in the browser's Javascript, you can check out the tutorials in our dev-center: https://www.nimiq.com/developers/#tutorials
Server-side
Either we figure out how to run Nimiq in Deno, or you run a Nimiq node (with NodeJS), which you can then interact with server-side via its RPC server: https://github.com/nimiq/core-js/wiki/JSON-RPC-API. This way you would generate and send transactions on your users' behalf.
Closing this issue as it seems stale.
@ralyodio please feel free to reopen it if you need to add more information.