Last active
August 29, 2015 14:07
-
-
Save drewbug/185ead9645e0e28243a5 to your computer and use it in GitHub Desktop.
ecc notes
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 'openssl' | |
ec = OpenSSL::PKey::EC.new('secp256k1') | |
# ec.generate_key | |
ec.private_key = "85BDCD4EF6319F9996D5499BD011E6094224CD1B9C87599E854F4E4EA408EFA6".to_i(16) | |
ec.public_key = ec.group.generator.mul(ec.private_key) |
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
Wallet import format | |
5JqBptN6DXmJcQJNsFysvGnHiainJ5HMXw9TDpq7NQg2z41ta2Z | |
Converting WIF as Base58 string to byte array | |
8085BDCD4EF6319F9996D5499BD011E6094224CD1B9C87599E854F4E4EA408EFA6FE1A9896 | |
Dropping last 4 checksum bytes | |
8085BDCD4EF6319F9996D5499BD011E6094224CD1B9C87599E854F4E4EA408EFA6 | |
Dropping first byte. This is the private key | |
85BDCD4EF6319F9996D5499BD011E6094224CD1B9C87599E854F4E4EA408EFA6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment