Created
June 29, 2024 07:49
-
-
Save jongan69/f80721bffaf43785285e8fc400939e82 to your computer and use it in GitHub Desktop.
Solana Wallet generation and base58 string output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use solana_sdk::{signature::Keypair, signer::Signer}; | |
use bs58; | |
fn main() { | |
let wallet = Keypair::new(); | |
let public_key_base58 = bs58::encode(wallet.pubkey().to_bytes()).into_string(); | |
let secret_key_base58 = bs58::encode(wallet.to_bytes()).into_string(); | |
println!("Public Key (Base58): {}\nSecret Key (Base58): {}\n", public_key_base58, secret_key_base58); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment