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

# Import TRON Private Keys

> Learn how to import existing TRON private keys into Dynamic's MPC wallet system

## Overview

This guide shows you how to import existing TRON private keys into Dynamic's MPC wallet system. This is useful when migrating from traditional TRON wallets or integrating with existing systems.

## Prerequisites

* [Set up your Dynamic project](/docs/node/quickstart)
* Have your existing TRON private key ready (hex format, with or without `0x`)

## Import Your TRON Private Key

```typescript theme={"system"}
import { authenticatedTronClient } from './client';
import { ThresholdSignatureScheme } from '@dynamic-labs-wallet/node';

const tronClient = await authenticatedTronClient();

const wallet = await tronClient.importPrivateKey({
  privateKey: 'YourTronPrivateKey',
  thresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_TWO,
  password: 'your-secure-password',
  backUpToDynamic: true,
});

console.log('TRON wallet imported:', wallet.walletMetadata.accountAddress);
console.log('Public key:', wallet.rawPublicKey);
console.log('External server key shares:', wallet.externalServerKeyShares);
```

## Verifying the Imported Address

Pass `publicAddressCheck` to verify that the imported key maps to a TRON address you expect. The import fails if the derived address does not match:

```typescript theme={"system"}
const wallet = await tronClient.importPrivateKey({
  privateKey: 'YourTronPrivateKey',
  thresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_TWO,
  publicAddressCheck: 'T...', // Expected TRON address
  password: 'your-secure-password', // Required when backing up to Dynamic
  backUpToDynamic: true,
});
```

## Offline Export

If you need to export the private key from existing key shares without a network call, use `offlineExportPrivateKey()`:

```typescript theme={"system"}
const { derivedPrivateKey } = await tronClient.offlineExportPrivateKey({
  keyShares: wallet.externalServerKeyShares,
  derivationPath: undefined, // optional
});

// derivedPrivateKey is a 0x-prefixed hex private key — keep it out of logs.
```

## Security Considerations

* **Private Key Format**: Ensure your private key is a 32-byte hex string, with or without the `0x` prefix
* **Password Security**: Use a strong, unique password
* **Key Storage**: Never store private keys in plain text after import
* **Backup**: Ensure you have a secure backup of your original private key
* **Key Share Backup**: Use `backUpToDynamic: true` for secure key share storage

## Threshold Signature Schemes

Choose based on your security and availability needs:

* **`TWO_OF_TWO`**: Maximum security, requires both server and Dynamic
* **`TWO_OF_THREE`**: Balanced security and availability

## Next Steps

* [Sign TRON transactions](/docs/node/tron/sign-transactions)
* [Sign TRON messages](/docs/node/tron/sign-messages)
* [Use imported TRON wallets](/docs/node/tron/use-imported-wallets)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.