Passphrase
If the hidden wallet is enabled, the passphraseState
parameter needs to be passed in API calls as a common parameter. passphraseState
is the identifier for the hidden wallet, which can be got by calling the getPassphraseState
API.
For the same hidden wallet, the value of passphraseState
remains the same. Therefore, you can persist the passphraseState
to pass it in subsequent API calls.
The hardware temporarily caches the passphrase internally, but the cache may become invalid when the screen is locked, turned off, or when the cache limit is reached. If the cache is valid, passphrase does not need to be entered again in subsequent API calls. If the cache is not present, the passphrase needs to be entered again.
You can know when you need to enter a passphrase by listening to the “ui-request_passphrase
” event.
Examples of passphrase
The complete passphrase process
Enter the passphrase in the software
You can prompt the user to quickly input the passphrase by popping up an input box after the UI event trigger of passphrase. Entering the Passphrase in the software is not recommended. While it can improve user input experience, it compromises some security aspects.
You only need to return the result of passphrase through the uiResponse API like this.
Last updated