Sui.

Post

Share your knowledge.

deriss.
Dec 19, 2024
Expert Q&A

How to convert private key to new format via CLI

How can I convert my old private key to a new format and change from Hex to Bech32 using the Sui CLI?

  • Sui
  • Move
4
4
Share
Comments
.

Answers

4
CarlkawIy.
Dec 19 2024, 21:11

Once you have installed the Sui CLI, use the command sui keytool convert to convert your private key to the latest format. Refer to the documentation provided here: https://docs.sui.io/references/cli/keytool for detailed instructions.

2
Best Answer
Comments
.
Xavier.eth.
Dec 19 2024, 19:23

To convert your old private key to the new format, you need to use the Sui CLI. First, download the Sui CLI, which can be done through a package manager like Chocolatey or by downloading the binary directly.

3
Comments
.
HaGiang.
Apr 30 2025, 14:24

Use the sui keytool convert command to convert your Hex-encoded private key to the new Bech32 format:

sui keytool convert <your_hex_private_key>

Replace <your_hex_private_key> with your actual Hex-encoded private key (without the 0x prefix).

For example:

sui keytool convert 1b87a727f58830d9ba2bfe6ecdc8fb49aa96fa2a2bbe175e128bfee13f6895ff

If you want to import the converted key into your local Sui Keystore:

sui keytool import --alias <your_alias> <bech32_private_key> <key_scheme>

This will add the key to your local keystore and associate it with the alias mykey.

3
Comments
.
YJS.
YJS200
Dec 20 2024, 06:09

Currently, there is no alternative method to using the Sui CLI for this conversion process.

0
Comments
.

Do you know the answer?

Please log in and share it.

Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.

351Posts497Answers
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Reward CampaignJuly