Guides
Wallet Backup & Recovery

Wallet Backup & Recovery

Lost your phone? Switched devices? This guide shows you how to back up your Veridex wallet so you can recover it anywhere β€” even if your original device is gone.

What gets backed up? Your passkey credentials (public keys, key hashes, credential IDs) β€” the information needed to identify your wallet. The actual passkey private keys live in your device's secure enclave and are never extracted. Recovery works because your passkey syncs via your platform (iCloud Keychain, Google Password Manager) or because you've added backup devices.


How It Works (Plain English)

Think of it like this:

  1. Your passkey = the key to your house. It lives on your device (phone, laptop).
  2. Your credentials = a list of all the locks that key can open (wallet addresses, key hashes).
  3. Backup = you write down that list, put it in a locked box (encrypted), and store the box in the cloud (relayer).
  4. The lock on the box = your passkey's PRF output (a secret your authenticator generates deterministically). Only your passkey can open it.
  5. Recovery = you use your passkey on a new device to open the box and get the list back.
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     encrypt      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     store      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Device  β”‚ ──────────────→  β”‚ Encrypted β”‚ ────────────→  β”‚ Relayer  β”‚
β”‚ Creds   β”‚   (PRF key)      β”‚  Archive  β”‚               β”‚ (cloud)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     fetch       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     decrypt
          β”‚ New      β”‚ ←────────────  β”‚ Relayer  β”‚ ←────────────
          β”‚ Device   β”‚   (PRF key)    β”‚ (cloud)  β”‚   restore!
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Prerequisites

  • @veridex/sdk installed (npm install @veridex/sdk ethers)
  • An active passkey (you've already registered β€” see Create Wallet)
  • A browser that supports WebAuthn (Chrome, Safari, Firefox, Edge)

Step 1: Check Platform Support

Before backing up, check if your device supports PRF (the strongest encryption method):

import { WalletBackupManager } from '@veridex/sdk';
 
const support = await WalletBackupManager.checkPlatformSupport();
 
if (!support.webauthnSupported) {
  console.log('WebAuthn not supported β€” backup not available');
} else if (support.prfSupported) {
  console.log('Full PRF support β€” your backup will be strongly encrypted');
} else {
  console.log('PRF not supported β€” backup will use a weaker fallback');
  // Still works! Just less secure.
}
⚠️

What is PRF? PRF (Pseudo-Random Function) is a WebAuthn extension that lets your authenticator generate a deterministic secret. This secret becomes the encryption key for your backup. Without PRF, the SDK falls back to using your credential ID as the key source β€” this works but is less secure because credential IDs are not secret.

Which Browsers Support PRF?

BrowserPRF Support
Chrome 116+Yes
Safari 17+Yes
FirefoxNot yet
Edge 116+Yes

Step 2: Create a Backup

import { WalletBackupManager } from '@veridex/sdk';
import { createSDK } from '@veridex/sdk';
 
// Initialize
const sdk = createSDK('base', {
  network: 'testnet',
  relayerUrl: 'https://relayer.veridex.network',
});
 
// Authenticate first (you need an active credential)
const { credential } = await sdk.passkey.authenticate();
 
// Create the backup manager
const backup = new WalletBackupManager({
  passkey: sdk.passkey,
  relayerUrl: 'https://relayer.veridex.network/api/v1',
});
 
// Back up your credentials
const result = await backup.backupCredentials(credential.keyHash);
console.log('Backup complete!');
console.log('Archive ID:', result.archiveId);
console.log('Credentials backed up:', result.credentialCount);

What happens when you press the button:

  1. Your browser asks for biometric verification (FaceID/TouchID)
  2. The passkey generates a PRF seed (a deterministic secret)
  3. The SDK derives an AES-256-GCM encryption key from that seed
  4. All your stored credentials are encrypted
  5. The encrypted blob is uploaded to the Veridex relayer

The relayer cannot read your credentials β€” they're encrypted with a key only your passkey can produce. Even if the relayer is compromised, your data is safe.


Step 3: Recover on a New Device

Got a new phone or laptop? Here's how to get your wallet back:

import { WalletBackupManager, createSDK } from '@veridex/sdk';
 
const sdk = createSDK('base', {
  network: 'testnet',
  relayerUrl: 'https://relayer.veridex.network',
});
 
const backup = new WalletBackupManager({
  passkey: sdk.passkey,
  relayerUrl: 'https://relayer.veridex.network/api/v1',
});
 
// Recover β€” uses your passkey to decrypt the backup
const recovered = await backup.recoverCredentials(keyHash);
console.log('Recovered', recovered.credentials.length, 'credentials!');
 
// Your credentials are now in localStorage β€” you can use the SDK normally
const vault = sdk.getVaultAddress();
console.log('Welcome back! Your vault:', vault);
⚠️

You need your passkey! Recovery requires the same passkey (or a synced copy). If you've lost ALL devices with your passkey and it wasn't synced, you'll need social recovery via guardians (a future feature).


Step 4: Check Backup Status

See if a backup exists and how fresh it is:

const status = await backup.getBackupStatus(keyHash);
 
if (status.hasArchive) {
  console.log('Backup exists');
  console.log('Last updated:', new Date(status.archiveUpdatedAt));
  console.log('PRF supported:', status.prfSupported);
  console.log('Guardians:', status.guardianCount);
} else {
  console.log('No backup found β€” create one!');
}

Adding Extra Devices (Best Practice)

The best protection is having your passkey on multiple devices. If your phone breaks, your laptop still has access.

How to Add a Device

  1. Go to your account page at auth.veridex.network/account
  2. Click "Add Another Device"
  3. Your browser will show a QR code β€” scan it with your other device
  4. The new device creates a passkey linked to the same identity
πŸ’‘

Cross-ecosystem tip: Passkeys sync automatically within the same ecosystem (Apple→Apple, Google→Google). To bridge across ecosystems (e.g., iPhone to Windows PC), use the "Add Another Device" flow — it uses QR/Bluetooth to set up the passkey on the other device.

How Passkey Sync Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Apple Ecosystem                          β”‚
β”‚  iPhone ←──→ iPad ←──→ MacBook                       β”‚
β”‚         (iCloud Keychain syncs passkeys)              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Google Ecosystem                         β”‚
β”‚  Android ←──→ Chrome (Windows) ←──→ Chromebook       β”‚
β”‚         (Google Password Manager syncs passkeys)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Cross-Ecosystem (via Add Device)         β”‚
β”‚  iPhone ──QR/BLE──→ Windows PC                       β”‚
β”‚  Android ──QR/BLE──→ MacBook                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Complete React Example

import { useState, useEffect } from 'react';
import { createSDK, WalletBackupManager } from '@veridex/sdk';
 
export function BackupManager() {
  const [status, setStatus] = useState<'idle' | 'backing-up' | 'recovering' | 'done'>('idle');
  const [backupExists, setBackupExists] = useState(false);
 
  const sdk = createSDK('base', {
    network: 'testnet',
    relayerUrl: 'https://relayer.veridex.network',
  });
 
  const backup = new WalletBackupManager({
    passkey: sdk.passkey,
    relayerUrl: 'https://relayer.veridex.network/api/v1',
  });
 
  // Check backup status on mount
  useEffect(() => {
    const cred = sdk.passkey.getCredential();
    if (cred?.keyHash) {
      backup.getBackupStatus(cred.keyHash).then((s) => {
        setBackupExists(s.hasArchive);
      });
    }
  }, []);
 
  const handleBackup = async () => {
    setStatus('backing-up');
    const cred = sdk.passkey.getCredential();
    if (!cred) return;
    await backup.backupCredentials(cred.keyHash);
    setBackupExists(true);
    setStatus('done');
  };
 
  const handleRecover = async () => {
    setStatus('recovering');
    const cred = sdk.passkey.getCredential();
    if (!cred) return;
    await backup.recoverCredentials(cred.keyHash);
    setStatus('done');
  };
 
  return (
    <div>
      <h2>Wallet Backup</h2>
      {backupExists ? (
        <p>βœ… Backup exists on the Veridex relayer</p>
      ) : (
        <p>⚠️ No backup found</p>
      )}
      <button onClick={handleBackup} disabled={status === 'backing-up'}>
        {status === 'backing-up' ? 'Backing up...' : 'Create Backup'}
      </button>
      <button onClick={handleRecover} disabled={status === 'recovering'}>
        {status === 'recovering' ? 'Recovering...' : 'Recover Wallet'}
      </button>
    </div>
  );
}

What Happens if I Lose Everything?

ScenarioSolution
Lost one device, but passkey synced to anotherUse the other device β€” everything works
Lost device, have backup on relayerUse any synced passkey to recover
Lost all devices, passkey synced via iCloud/GoogleSign in on a new device to restore passkey, then recover
Lost all devices, passkey was NOT syncedSocial recovery via guardians (coming soon)

FAQ