Key Management
Privacy Boost derives a set of privacy keys from a single seed. These keys give the user a private identity — separate from their public wallet address — that can send, receive, and hold shielded tokens.What Gets Derived
These keys are designed with separation of concerns: the viewing key handles privacy, the nullifying key handles identity, and the auth key handles fund custody. This means a single key being exposed doesn’t give full access — for example, leaking the viewing key reveals your balance but doesn’t allow anyone to spend your funds. For the full security model and threat analysis, see Keys & Encryption.
Your Master Public Key (MPK) and privacy address are derived from these keys. The MPK is your public identity in Privacy Boost — safe to share. The privacy address is what you give to others so they can send you private transfers.
Key Sources
ThekeySource parameter controls where the seed comes from.
walletDerived (recommended)
The SDK asks the wallet to sign a deterministic message and uses the signature as the seed. The same wallet always produces the same signature, so the same privacy keys are derived every time. This is the simplest option because the wallet itself is the backup — there’s nothing extra for the user to write down.mnemonic
The SDK derives keys from a BIP-39 mnemonic phrase. This is useful when you want keys to be portable across different wallets, but the user must securely store the phrase.rawSeed
A raw 32-byte hex seed. Intended for testing.Persistence & Protection
Without persistence, the SDK re-derives keys every time the user opens your app (requiring wallet signature popups). With persistence enabled, keys are encrypted and stored locally so returning users can log in silently. Persistence has two parts: where keys are stored and how they’re protected.Storage
Protection (Unlock Method)
You can require the user to unlock stored keys before they’re used:
When
pin or password is used, authenticate() returns a credentialRequired result so your app can show the appropriate input. See Authentication — PIN / Password Unlock.
When biometric is used, the platform prompt appears automatically.
Configuration
How Persistence Interacts with Key Source
This means a user only needs to provide their mnemonic once. After that, keys are loaded from storage.
Session Export & Import
If you don’t want to use persistence, you can manually save and restore sessions on native platforms:Recovery
Keys are derived deterministically, so recovery is straightforward as long as the original key source is available.
Funds are never lost. Deposits live on-chain in the shielded pool. Once keys are re-derived, the SDK automatically finds and restores your balance.
Common Recovery Scenarios
Cleared app data or reinstalled the app? Re-authenticate with the same key source. A new vault is created automatically. Forgot vault PIN/password? Clear app storage, then re-authenticate with the original key source. The old vault is discarded and a new one is created. No funds are lost. Lost device? Your funds are safe — session data is encrypted on-device. Set up a new device and authenticate with the same wallet or mnemonic. Switching to a new device? Either re-authenticate with the same key source, or on native platforms useexportSession() / importSession() to transfer the session directly.
Next Steps
- Error Handling — Handle SDK errors with structured error codes
- Keys & Encryption — Deep dive into the key hierarchy, privacy addresses, and 3-way ECDH encryption
iOS: Session Storage
Secure Keychain storage and biometric unlock
Android: Session Storage
Android Keystore storage and biometric unlock
React Native: Session Storage
AsyncStorage and Keychain persistence