Skip to content
Docs

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 (+ bip39Passphrase if 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 API

Backing 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

FieldRequiredDescription
Fresh device + mnemonicNo`importMnemonic` / `wallets.monero.restore` into a new keystore
Same DB file + PINNoOpen `GrayKeystore.create({ sqlite: { path }, password })` then `open`
Lost PINNoCannot 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 storage

Throws

FieldRequiredDescription
unauthorizedNoWrong PIN on reset or open after restore of encrypted DB.