Keystore
Backup and recovery
Seed backups are mandatory; DB copies still need the PIN and expose addresses.
Overview
Keystore files and KV blobs are not a substitute for the user's mnemonic / Polyseed backup. Lost PIN with encryption on means sealed secrets are unrecoverable from the DB alone.
What users must back up
- BIP-39 phrase (+
bip39Passphraseif used) - Native Monero Polyseed / Legacy mnemonic
- Imported private keys (if not derived from a seed you still hold)
js
const phrase = wallet.exportMnemonic(); // show once, then clear UI state
// Never send phrases to the Gray3 Cloud APIBacking up the DB
Copying gray-wallets.db (or exporting KV keys) preserves ciphertext + plaintext address rows. Restoring requires the same PIN / encryptionKey. Treat the file as sensitive even though secrets are sealed—metadata reveals addresses.
Recovery flows
| Field | Required | Description |
|---|---|---|
| Fresh device + mnemonic | No | `importMnemonic` / `wallets.monero.restore` into a new keystore |
| Same DB file + PIN | No | Open `GrayKeystore.create({ sqlite: { path }, password })` then `open` |
| Lost PIN | No | Cannot decrypt — wipe with proof of ownership only if you hold the seed |
Factory reset
js
await client.wallets.reset({ password: pin }); // wrong PIN → unauthorized
await client.wallets.reset(); // ok when encryption: false or no storageThrows
| Field | Required | Description |
|---|---|---|
| unauthorized | No | Wrong PIN on reset or open after restore of encrypted DB. |