We are working on a crypto exchange and need to organize deposits and withdrawals.
How would we organize our wallet?
The only HD Wallet I found so far is https://www.npmjs.com/package/eth-hd-wallet.
I am trying to figure out what is the capability/function of a wallet and what we need to implement our self.
For deposits I need to be able to create new addresses for customers. Is the wallet capable of giving me new unused addresses or do I need to write an iterator myself and keep track of the address usage?
For withdrawals I need to create a transaction - do I need to specify sender addresses myself or can the wallet do it automatically?
What are the best practices/design patterns for this? What additional libraries could be useful?
Is a HD Wallet a good idea or should we maybe just keep track of all the addresses?
1 Answer
HD wallet uses bip32, bip39 and bip44 standards. You create extended private and public keys, and use public key for generating new addresses and private key for getting your resources from this addresses.
For example in your exchange you can use bip44 standard with one account for each coin type and a lot of unused addresses in them, so you will generate only one public and private key for each coin and then generate as much as you need addresses.
You can find more detailed info here.