Created
April 14, 2025 15:20
-
-
Save jadepark-dev/93b34d6c044a1c335f6fb83eae257c40 to your computer and use it in GitHub Desktop.
SOL
This file contains hidden or 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
// This nodejs script read solana keypair file([1,22,19,45,75,..., ]) and out public key and private key to command line | |
const fs = require('fs') | |
const { Keypair } = require('@solana/web3.js') | |
const bs58 = require('bs58') | |
const keypairData = JSON.parse(fs.readFileSync('./<YOUR_KEYPAIR_FILE>.json')) | |
const keypair = Keypair.fromSecretKey(Uint8Array.from(keypairData)) | |
console.log('Private key (base58):', bs58.encode(keypair.secretKey)) | |
console.log('Public key (base58):', keypair.publicKey.toBase58()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment