I am confused which address format to use: this or NNS wallet. I do want my users easily transfer from NNS Wallet to my app. So, I want hexadecimal. Please, help.
NNS wallet can send to principals as well as ICRC-1 accounts with subaccount (the bech32 encoded ones). It is not limited to legacy ICP accounts (the hex encoded ones).
I would suggest to show ICRC-1 accounts to the users instead of the hex accounts because then it is consistent for the users across all tokens (ICP and others).
Unless you want users to deposit directly from an exchange (CEX) to your app because most CEX still only understand the legacy hex accounts.
What’s your overall setup and goal? Do you have a backend canister that takes deposits from users and issues an individual deposit address to each user? Do you do that for ICP only or also for other tokens?
And does your app consist of frontand and backend?
Can users withdraw as well?
Just wondering what is the total functionality that you need in the end.
Since I have had the exact same problem and probably many other people have to, we have developed a Motoko package for this. Not on mops yet, but in the process of getting there. The package is a class that you use in your canister that issues individual deposit accounts for users, handles all user deposits, consolidates them into a main account, and processes withdrawals from the main account, tracks user credit in the process. It has some advanced features to reduce latency for the user so that the credit can be used as quickly as possible.
It also supports deposits by allowance for users who prefer that.