Hello. I am making a website where the user registers on my platform and get payments. However, I want to make payments through WAVES Platform. I would like to know if it is possible to create a new wallet through API for the user that registered in my website? Thanks in advance!
Am I correct that you will have all private keys of all of your users?
If yes, yes it’s possible. Please, have a look at
POST /addresses node’s API method. This method will create a new address on your node.
Also, it’s possible to create a new seed phrase and then a private, public keys and an address using various libs.
And finally, have you looked at Waves Keeper?
- Waves Address structure: https://docs.wavesplatform.com/en/waves-environment/waves-protocol/data-structures.html#address
- Cryptographic Practical Details: https://docs.wavesplatform.com/en/waves-environment/waves-protocol/cryptographic-practical-details.html
As you can see you can create a new usable address only if you have a seed (or private key).
Having user private keys is a really bad practice.
Sorry, you did not get me. I do not want to get secret key. The user even will not know that he or she will have account in waves. I just want to generate an address and users will withdraw their balances through API in my website.
The address is a derivative of private key. So, you can’t create one without creating another. If you create private key for the user, you know it. You control that account. And you have to save the private key and pass it to the user so the user could withdraw the funds what is impossible without a private key.
In other words, creating the accounts for the users no differ from keeping the users money on one account and send them the required amount on withdraw request.
The better approach, in my opinion, is to give users the ability to create the waves wallets elsewhere (using waves keeper or waves wallet) and put their addresses in the users setting on your site. This will be fair way of dealing with crypto.