> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# storeEncryptedBackupByWalletWithRetry

> Stores encrypted backup for a wallet with automatic retry logic

## Function Signature

```typescript theme={"system"}
storeEncryptedBackupByWalletWithRetry(params: {
  accountAddress: string;
  walletMetadata: WalletMetadata;
  externalServerKeyShares: ServerKeyShare[];
  password?: string;
  backUpToDynamic: boolean;
}): Promise<{
  keySharesWithBackupStatus: Array<{
    share: ServerKeyShare;
    backedUpToClientKeyShareService: boolean;
  }>;
  backupInfo: KeyShareBackupInfo;
}>
```

## Description

Same as [`storeEncryptedBackupByWallet()`](/node/reference/evm/store-encrypted-backup-by-wallet) but retries on transient failures. **Merge the returned `backupInfo`** into your cached `walletMetadata.externalServerKeySharesBackupInfo`.

## Parameters

Same as [`storeEncryptedBackupByWallet()`](/node/reference/evm/store-encrypted-backup-by-wallet).

## Returns

Same as [`storeEncryptedBackupByWallet()`](/node/reference/evm/store-encrypted-backup-by-wallet).

## Example

```typescript theme={"system"}
import { authenticatedEvmClient } from './client';

const evmClient = await authenticatedEvmClient();
const walletMetadata = JSON.parse(await redis.get(`wallet:${accountAddress}`));
const externalServerKeyShares = await vault.read(`wallet:${accountAddress}/shares`);

const { backupInfo } = await evmClient.storeEncryptedBackupByWalletWithRetry({
  accountAddress,
  walletMetadata,
  externalServerKeyShares,
  password: 'user-password',
  backUpToDynamic: true,
});

const updated = { ...walletMetadata, externalServerKeySharesBackupInfo: backupInfo };
await redis.set(`wallet:${accountAddress}`, JSON.stringify(updated));
```

## Related

* [`storeEncryptedBackupByWallet()`](/node/reference/evm/store-encrypted-backup-by-wallet) - Store encrypted backup without retry
* [`recoverEncryptedBackupByWallet()`](/node/reference/evm/recover-encrypted-backup-by-wallet) - Recover encrypted backup
