Post
Share your knowledge.
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
Answers
4Once 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.
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.
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.
Currently, there is no alternative method to using the Sui CLI for this conversion process.
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.
- Why does BCS require exact field order for deserialization when Move structs have named fields?53
- Multiple Source Verification Errors" in Sui Move Module Publications - Automated Error Resolution42
- Sui Transaction Failing: Objects Reserved for Another Transaction24
- How do ability constraints interact with dynamic fields in heterogeneous collections?04