| Crates.io | solana-keytool |
| lib.rs | solana-keytool |
| version | 0.1.1 |
| created_at | 2025-12-04 09:36:05.211118+00 |
| updated_at | 2025-12-09 05:40:34.855235+00 |
| description | A tool to convert Solana keypairs between id.json and base58 format. |
| homepage | |
| repository | https://github.com/maple19out/solana-keytool |
| max_upload_size | |
| id | 1966249 |
| size | 22,722 |
A command-line utility to convert Solana keypairs between the JSON format used by the Solana CLI (id.json) and the base58-encoded string format for private keys.
This tool is intended for development and educational purposes. Do not use it with mainnet private keys in a non-secure environment.
from-base58 command) can cause the key to be stored in your shell's history file (e.g., .bash_history, .zsh_history) in plain text.to-base58 command) can make it visible to anyone looking over your shoulder and it might be logged if you are redirecting output.An attacker who gains access to your computer could potentially steal your keys from these sources. Use this tool with caution and preferably with throwaway development keys.
This tool provides two main functionalities:
~/.config/solana/id.json) and prints the corresponding base58-encoded private key.Clone the repository:
git clone <repository-url>
cd solana-keytool
Build the project:
cargo build --release
The executable will be located at target/release/solana-keytool.
You can run the tool using cargo run -- followed by the desired command and arguments.
to-base58Encodes a 64-byte array from a JSON file to a base58 private key.
Command:
cargo run -- to-base58 --input <path-to-your-id.json>
Arguments:
--input <path> or -i <path>: Specifies the path to the input JSON keypair file. Defaults to id.json if not provided.Example:
# Read from the default solana cli keypair location
cargo run -- to-base58 --input ~/.config/solana/id.json
# Read from a file named my-wallet.json in the current directory
cargo run -- to-base58 --input my-wallet.json
from-base58Decodes a base58 private key and saves it as a JSON file.
Command:
cargo run -- from-base58 <base58-private-key> --output <path-to-output.json>
Arguments:
<base58-private-key>: (Required) The base58-encoded private key string.--output <path> or -o <path>: Specifies the path for the output JSON file. Defaults to id.json if not provided.Example:
# Decode a key and save it to the default id.json
cargo run -- from-base58 5J2J...YourPrivateKey...t5sP
# Decode a key and save it to a specific file
cargo run -- from-base58 5J2J...YourPrivateKey...t5sP --output my-new-wallet.json