> ## 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.

# exportExternalServerKeyShares

> Exports external server key shares for a wallet address

## Function Signature

```typescript theme={"system"}
exportExternalServerKeyShares(params: {
  accountAddress: string;
  walletMetadata: WalletMetadata;
  password?: string;
}): Promise<ServerKeyShare[]>
```

## Description

Exports external server key shares for a wallet. Verifies the password first, then recovers and returns the plaintext shares.

## Parameters

### Required Parameters

* **`accountAddress`** (`string`) - The wallet address (must include `0x` prefix). Must match `walletMetadata.accountAddress`.
* **`walletMetadata`** ([`WalletMetadata`](/node/reference/types/wallet-metadata)) - The cached metadata for this wallet

### Optional Parameters

* **`password`** (`string`) - Wallet password (required if the wallet is password-encrypted)

## Returns

* **`Promise<ServerKeyShare[]>`** - Array of exported external server key shares

## Example

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

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

const exportedShares = await evmClient.exportExternalServerKeyShares({
  accountAddress,
  walletMetadata,
  password: 'user-password',
});

console.log('Exported shares count:', exportedShares.length);
```

## Error Handling

```typescript theme={"system"}
try {
  const exportedShares = await evmClient.exportExternalServerKeyShares({
    accountAddress: '0xYourWalletAddress',
    password: 'your-wallet-password',
  });
  console.log('External server key shares exported successfully');
} catch (error) {
  console.error('Failed to export external server key shares:', error);
}
```

## Related Functions

* [`getExternalServerKeyShares()`](/node/reference/evm/get-external-server-key-shares) - Get external server key shares
* [`signMessage()`](/node/reference/evm/sign-message) - Sign a message using key shares
