paicoin
paicoin copied to clipboard
Support for paper key RPC methods
This PR provides support for the following RPC methods:
- restorewallet - restores a wallet from user provided 12-word BIP39 phrase
- dumppaperkey - dumps the current paper key phrase (if wallet has any) from the current wallet
- generatepaperkey - generates a 12-word BIP39 phrase for use in restorewallet or for later use
Backward compatibility is preserved, meaning that if a wallet hasn't been restored through a paper key, it uses existing HD key derivation, seeded by the randomly-generated master key. If a wallet has been restored through a paper key, HD key derivation uses the BIP39 phrase as a seed. Discrimination between the two modes is done by saving the paper key in the wallet and checking if it is there to determine mode.
Additionally, paper key is being encrypted when wallet encryption feature is used.