Skip to content

Instantly share code, notes, and snippets.

View whiteneon's full-sized avatar
💭
Expirementing

Gary Bell whiteneon

💭
Expirementing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am whiteneon on github.
  • I am whiteneon (https://keybase.io/whiteneon) on keybase.
  • I have a public key whose fingerprint is 1EBC 6779 13D0 1B82 1010 BF24 3FAD D067 F10A 8471

To claim this, I am signing this object:

@whiteneon
whiteneon / decode58.py
Created April 3, 2022 15:28
Convert Phantom Private Key Export to data for use in Solana CLI Keypair file.
#!/usr/bin/python3
#You need base58 (pip install base58)
#Please note: I'm not a programmer and there are probably more elegant ways to accomplish this, but this does work.
#Usage: Call the script with the filename to store the keypair file as the first argument.
# The private key exported from Phantom Wallet is the second argument.
# I didn't write all this code, 2 main lines including join(map(lambda line were copied from another site,
# credit to original authors.
import base58
import sys
import os.path
@whiteneon
whiteneon / encode58.py
Created April 3, 2022 15:12
Convert Solana CLI Keypair file to Base58 Encoded Private Key for use in Phantom Wallet
#!/usr/bin/python3
#I believe will only work on python3. You need base58 (pip install base58)
#Please note: I'm not a programmer and there are probably more elegant ways to accomplish this, but this does work.
#Usage: Call the script with the keypair file as the first argument.
import base58
import sys
keyfile = sys.argv[1]
file = open(keyfile, 'r')
data = file.read().replace('\n', '').replace('[', '').replace(']', '')
file.close