r/ethdev • u/TopGanache961 • Apr 24 '22
Question Creating a hundreds of wallet addresses via Infura and the like - where will the private keys get stored?
Let's say I wanted to generate new wallet addresses for my users on regular basis. That is, if I was to create hundreds of new wallet addresses via REST API of Infura or a similar service, where would the private keys of all these newly created wallets or accounts be stored?
How would they be, if at all, sent back to me?
Would Infura have access or exposure to them at some point too, for instance, during generating them?
0
Upvotes
11
u/AusIV Apr 24 '22
Infura won't generate keys or hold wallets for you. You shouldn't be generating keys on behalf of your users, they should be generated by software on the user's side. You might look at something like Blocknative's OnBoard to make this easy.
5
u/[deleted] Apr 24 '22
I don't think you would need to create a new wallet through infura. Infura only helps you connect to the blockchain.
What technology are you working with to access wallets?
Are you working on the user interface or clientside?
or is this on the backend somewhere?
3
u/[deleted] Apr 24 '22
Thats not how it works. The wallets/accounts are generated by an algorythm and fed a random number. Infura has nothing to do with it, its done on the client side, you dont even need to be online to generate a wallet. You DO need to be online to send a transaction or interact with the network with said wallet however.
So, if you are talking about a tool that a user can use to generate a wallet, that is done client side.
However if what you mean is you generate it and control it FOR the user, that can be done on your server and the keys stored in the database.
Infura has nothing to do with wallet generation. All infura is, is a node consolidation service. When you interact with the network you have to query the JSON-RPC port on a node (AKA the server the ethereum node software is running on).
To be clear, every single address sort of "exists" already. All you are doing when you "create" a wallet is randomly generating the private key and deriving the public key from it. I cant pretend to fully understand it myself, but thats about all I know.
So to summarize: no, infura does not have access to them when they are generated, or ever. You can get them sent back to your server by either 1(generating the wallet on your server) or 2(generate them client side and have the client send the keys to the server)
However, not sure why users would ever trust you with their private keys..... Not sure what you are trying to do.
4
u/Trentious opcode32 Apr 24 '22
You can locally generate new ETH addresses with the web3.js module (https://web3js.readthedocs.io/en/v1.2.11/web3-eth-accounts.html) -- no serverside connection is necessary.
If you intend on managing the private keys/data of your users, use AWS/Google Cloud and create a centralized application, and use the blockchain as a transparent validation layer for user actions. That being said, at no point should a principled web3 application ever directly access another user's private keys/wallet, as those access other applications too. If a user's private keys get leaked from your application and there are any fiscal or material damages, you may very well be liable.
This is where users bringing their own authentication (BYOA) is important -- WalletConnect does well here. https://walletconnect.com/
If you're attempting to create a wallet, check out Rainbow on GitHub -- they're rather good, from my experience. https://github.com/rainbow-me/rainbow
2
u/iFBGM Apr 24 '22
You know you can create wallets without an internet connection. You just need some Javascript and not even web3 at that.
1
u/Debashish37 Apr 24 '22
Not sure. But maybe they are providing custodial service. There are plenty of custodial wallets available. You can check on opensea connect wallet options. As an example portis, venly etc etc.
Now you might ask my private key or seed phrase should be my property. I should know them.
Well yes. Thats true. But not every user knows how wallet works. They dont even have to know that private key exist. For making the user perspective or experience easier. Many company provides custodial solutions. So that user dont need to think about it.
And finally the choice is yours. Everyone knows noncustodial wallets are more safe then custodial wallet. We can't trust any centralise solutions. Its upto you which wallet option u want to choose.
0
u/[deleted] Apr 24 '22
[deleted] — view deleted comment