I would like to create a Bitcoin Wallet.
Part of the process is to store public and private keys in encrypted form in server database.
All keys I am storing is encrypted using user's passcode.
1) Is it safe to store user's passcode in encrypted form in server database. (Thinking that User might forget his passcode so considering one recovery option)
2) Is there any kind of future possibility that I get in trouble if any kind of attack happens or by action of some intruder/admin itself(worst possibility) - the key reveal to the attacker which will lead access and open up all the pub/priv keys from database of that specific User? This way I can not give forget pass-code option to user.
So considering both option Shall I store User's pass-code or not?
What is the best practice to implement this security feature in bitcoin wallet ?
This question is not duplicate of How to securely hash passwords?
as the question reveals ways of doing hashing of password and Here What I am asking is to find a best practise to decrypt pass-code and it's related impact on the system.
For eg. What If user wants to recover his forget password?