For security reasons, the new TronLink extension no longer supports the import of private keys exceeding 64 characters in length.
Therefore, if you have wallets with private keys longer than 64 characters, please make sure you have converted these keys into ones equal to or shorter than 64 characters before importing them.
The steps for converting a private key are as follows:
Step 1: Download and install python3.11
- Download URL for macOS: https://www.python.org/downloads/
- Download URL for Windows: https://www.python.org/downloads/windows/
Note: You can simply select the latest Python version based on your operating system.
Step 2: Open the command line interface (CLI) after Python installation
- For macOS: Click “Launchpad”, search for "Terminal", and then open the CLI editor.
- For Windows: Press WIN+R, enter "cmd" in the Run box, and then click "OK" to open the CLI editor.
Step 3:
1. Enter "python 3" and press the Enter key.
python3
As shown in the figure:
2. Paste the following code to the CLI editor and press the Enter key twice for execution.
def get_valid_key(origin_key):
origin_key = origin_key.replace('0x', '')
if len(origin_key) % 2:
origin_key = origin_key[:len(origin_key) - 1]
big_num = int(origin_key, 16)
big_prime = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
hex_string = '{:064x}'.format(big_num % big_prime)
print('valid private key:', hex_string)
As shown in the figure:
3. Enter get_valid_key('your private key') and press the Enter key. Replace "your private key" with the actual key that needs to be converted.
For example:
If the private key that needs to be converted is: cae63346a7ab9016fda0d31ef7879e1c8c2c9964a9a3c09cd23f0ec0dc32f0a5dc32f0a5
Then enter:
get_valid_key('cae63346a7ab9016fda0d31ef7879e1c8c2c9964a9a3c09cd23f0ec0dc32f0a5dc32f0a5')
Press the Enter key, and you will get the converted private key: a7ab9016fda0d31ef7879e1d8e0327244a409aee516d01977109286e33f725df
As shown in the figure:
You may now import the converted private key into the new TronLink extension.
Note:
- The private key to be converted must be in hexadecimal.
- After successfully importing the converted private key into TronLink, you are advised to transfer your assets stored in this address to another one of yours for asset security reasons.