The SDK recovery backup contains two pieces: the 32-byte recovery key and the encrypted recovery envelope. Keep them together in a secret-bearing file or encrypted local store.

Save recovery data

The starter serializes one small JSON record and validates it on import.

Restore from the backup

restoreFromRecoveryData parses the file, rejects malformed keys and envelopes, and asks the SDK to reconstruct the bundle against the active runtime. Run this restore once before submitting the first deposit. A successful roundtrip proves the app saved usable bytes, rather than a label or stale object reference.

Read private balance

After confirmation, balances.get reads the pool’s encrypted deposit events, opens the matching bundles locally, and checks each note’s nullifier.
Refresh this result after a confirmed deposit or withdrawal. If the event or nullifier reader fails, keep the previous display and show the read error.
Anyone holding this backup can control the recovered notes. Keep it out of logs, analytics, URLs, support messages, and cloud clipboard history.
For the field-level envelope shape, see Recovery data.