I'm very new to Solana development and want to integrate various web3 elements into my React Native app.
Currently, the app generates a keypair for a wallet account using the @solana/web3.js
Keypair.generate()
function and allows me to select the account. However, in order to persist the account as being selected after app minmizeminimize/restore and app close/launch events, the account needs to be stored and in the mobile devices files of the mobile device and reloaded from the mobile device files.
I found that React Native offers an "unofficial" library to encrypt and store data but am skeptical about storing a private key in any form on the device.
Is there a proper way of achieving persistence of the selected wallet account? Do I only need to store the public key? What measures are necessary to ensure a secure wallet integration?
P.S. Some apps require a PIN input to access the connected wallet (see Stepn)