帖子
分享您的知识。
如何通过 CLI 将私钥转换为新格式
如何使用 Sui CLI 将我的旧私钥转换为新格式并从 Hex 更改为 Bech32?
- Sui
- Move
答案
6安装 Sui CLI 后,使用该命令sui keytool convert
将您的私钥转换为最新格式. 有关< https://docs.sui.io/references/cli/keytool > 详细说明,请参阅此处提供的文档.
你可能有一个来自 ~/.sui/sui_config/sui.keystore 的密钥对文件. 使用以下 CLI 命令:
sui keytool convert-private-key --private-key <hex_key> --output-format bech32
这将输出如下内容:
bech32 encoded private key: sui:ed25519:<base64_bech32>
使用 sui keytool 转换命令将你的十六进制编码的私钥转换为新的 Bech32 格式:
sui keytool convert <your_hex_private_key>
<your_hex_private_key>替换为实际的十六进制编码私钥(不带 0x 前缀).
例如:
sui keytool convert 1b87a727f58830d9ba2bfe6ecdc8fb49aa96fa2a2bbe175e128bfee13f6895ff
如果你想将转换后的密钥导入本地 Sui 密钥库:
sui keytool import --alias <your_alias> <bech32_private_key> <key_scheme>
这会将密钥添加到您的本地密钥库并将其与别名 mykey 关联.
要将旧私钥转换为新格式,您需要使用 Sui CLI. 首先,下载 Sui CLI,这可以通过像 Chocolatey 这样的包管理器来完成,也可以直接下载二进制文件来完成.
To convert your private key to a new format and change from Hex to Bech32 using the Sui CLI, follow these steps:
- sui keytool convert <hex_private_key> --current
- This command will output the private key in the Bech32 format, which can be used with the Sui network.
Some key points to keep in mind:
- Private Key Security: Ensure your private key is stored securely to prevent unauthorized access.
- Bech32 Format: The Bech32 format is used for Sui addresses and private keys, providing better readability and error detection.
By using the Sui CLI, you can easily convert your private key to the new format and take advantage of the Bech32 encoding scheme's benefits.
你知道答案吗?
请登录并分享。
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.