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

# Importing & Exporting Embedded Wallets

## General Setup

### Formatting

| Chain  | ✅ Import Format                | ✅ Export Format            |
| ------ | ------------------------------ | -------------------------- |
| EVM    | Hexadecimal with or without 0x | Hexadecimal without 0x     |
| Solana | Base58-encoded private key     | Base58-encoded private key |
| Sui    | Bech32-encoded private key     | Bech32-encoded private key |

## Importing Wallet Keys

When importing an existing private key into Dynamic's TSS-MPC system, we use Shamir Secret Sharing (SSS) to securely split the key into multiple shares. This process:

1. Takes your existing private key as input
2. Uses SSS to split it into either 2 or 3 shares (depending on your configuration)
3. Distributes the shares between the relevant parties (user, server, and optionally a backup)
4. Securely destroys the original private key

After import, the key exists solely in its distributed form, and all future operations are performed using TSS-MPC. The complete private key is never reconstructed, preserving the security benefits of TSS-MPC while enabling seamless migration from traditional wallets.

## Exporting Wallet Keys

For maximum user control and portability, Dynamic allows users to export their private keys. During export:

1. The key shares are temporarily recombined on the user's device using secure MPC
2. The private key is constructed client side and provided to the user

This ensures users maintain true self-custody and can always access their assets, even outside of Dynamic's ecosystem.

<Note>
  When implementing Dynamic in a custom UI, please ensure you are surfacing this flow to your end-users, so that they always maintain control of their wallet.
</Note>

### Private Key Export Settings

By default, users can export their private keys from embedded wallets. You can control this setting in the [Embedded Wallets dashboard](https://app.dynamic.xyz/dashboard/embedded-wallets/dynamic). Navigate to the **Security** section and toggle **Private Key Exports** to enable or disable private key exports.

<Frame>
  <img src="https://mintcdn.com/dynamic-docs/tU4QJtnK1LxWeTz7/images/dashboard/dashboard-private-key-export-toggle.png?fit=max&auto=format&n=tU4QJtnK1LxWeTz7&q=85&s=525fb8534ae79260f8130e8c7707a348" alt="Private Key Export Toggle" width="2152" height="210" data-path="images/dashboard/dashboard-private-key-export-toggle.png" />
</Frame>

<Note>
  This feature requires the latest SDK version. Make sure to update your SDK before changing this setting.
</Note>

<Warning>
  Consider disabling private key exports if your use case requires additional security controls. Disabling exports prevents users from exporting keys, which can reduce the risk of key exposure but limits user portability. See [Best Practices - Private Key Export Controls](/overview/security/recommendedpaths#private-key-export-controls) for guidance.
</Warning>

To open the export wallet flow on behalf of your users, you can call the revealEmbeddedWalletKey method. This will open the flow described above. Only the end-user will be able to see the private key or seed phrase.

```typescript theme={"system"}
const ExportEmbeddedWalletKeyButtons: FC = () => {
  return (
    <View>
      <TouchableOpacity
        onPress={() =>
          client.ui.wallets.revealEmbeddedWalletKey({
            type: 'private-key',
          })
        }
      >
        Reveal private key
      </TouchableOpacity>
    </View>
  )
}
```

You can read more about the embedded wallets module [here](/react-native/reference/package-references/client#wallets-embedded-submodule).

<Warning>
  You should always provide your end-users with a path to reveal and replicate their keys from their embedded wallet. When using the custom UI embedded wallet flow, please ensure you add a path for users to complete this step using the programmatic option described above.
</Warning>

End-users should be aware that replicating their wallet credentials can expose their wallet to risk if the credentials are not stored securely. Users are advised to store their credentials in a secure location and not share them with anyone. When implementing Dynamic in a custom UI, we recommend communicating these warnings to users.
