Overview
Solana's CLI tooling stores keypairs as 64-byte JSON arrays. Wallet applications like Phantom, however, expect their private keys Base58-encoded. solana-private-key-converter does exactly that conversion — accepting either a full 64-byte CLI keypair or a 32-byte seed file and producing both the full-file and seed-only Base58 encodings.
What It Outputs
base58_full_<N>bytes— the entire keypair file Base58-encoded.base58_seed_32bytes— the first 32 bytes of a 64-byte keypair, Base58-encoded.
Output prints to stdout. A safety warning is emitted to stderr on every run.
Requirements
- Rust 1.85+ with edition 2024.
- A Solana keypair JSON file — either the 64-byte CLI format or a 32-byte seed file.
Setup
1. Clone and build
$ git clone https://github.com/hadesbaker/solana-private-key-converter.git
$ cd solana-private-key-converter
$ cargo build --release2. Run against your keypair
$ cargo run --release -- wallet.json
Replace wallet.json with the path to your Solana keypair
file. The Base58 strings print to stdout; the safety warning prints to
stderr — pipe stdout separately if you're capturing output.