#solana #cli #ed25519 #ssh #key-conversion

app ssh_to_solana

Convert GPG-exported ED25519 SSH key to Solana address

2 releases

Uses new Rust 2024

new 0.1.1 Apr 24, 2025
0.1.0 Apr 24, 2025

#76 in Magic Beans

MIT/Apache

5KB
55 lines

SSH to Solana Address Converter

A simple CLI tool that converts GPG-exported ED25519 SSH keys to Solana addresses.

Installation

cargo install --path .

Usage

You can provide the SSH key directly as an argument:

ssh-to-solana "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICKoK0n5DHVMeDCw3XVZUYxhgdQIYJADIyaSF7J8Rz1E openpgp:0x98DF58F5"

Or you can pipe the output from GPG to the tool:

gpg --export-ssh-key 4EDE451FC10722D0C6662C6FB99B8189C7C153F6 | ssh-to-solana

How It Works

  1. The tool extracts the base64-encoded data from the SSH key
  2. Decodes the data to get the binary representation
  3. Extracts the 32-byte ED25519 public key
  4. Base58-encodes the public key to produce a Solana address

License

MIT

Dependencies

~1.4–2MB
~38K SLoC