Last active
November 19, 2021 18:08
-
-
Save mattm/acf0ca90bbcc78131f128e1146e5c56b to your computer and use it in GitHub Desktop.
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
require_relative "base58" | |
def bytes_to_base58(bytes) | |
hex = bytes.pack("C*").unpack("H*").first | |
Base58.encode(hex) | |
end | |
keypair_bytes = [4,182,130,247,119,117,227,207,112,73,170,126,222,197,244,99,215,107,255,202,33,43,36,17,104,111,157,246,196,192,174,95,240,23,238,206,118,215,154,238,229,96,11,37,156,123,51,223,5,231,17,117,86,136,103,14,75,95,175,132,148,54,1,46] | |
private_key_bytes = keypair_bytes[0, 32] | |
public_key_bytes = keypair_bytes[32..-1] | |
puts "Keypair:", bytes_to_base58(keypair_bytes) | |
puts "\nPublic Key:", bytes_to_base58(public_key_bytes) | |
puts "\nPrivate Key:", bytes_to_base58(private_key_bytes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment