Created
January 6, 2020 20:20
-
-
Save stevenc81/f466940cac8074756b072a243317ff1f to your computer and use it in GitHub Desktop.
Ethereum Private Key to Public Key and Address
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
from eth_keys import keys | |
from eth_utils import decode_hex | |
# Private key here | |
priv_key_bytes = decode_hex('0xfbef6fd0f61d054be68aa044d033d83b87ed1bbde658dfa0b4bfdb06e39f6af6') | |
priv_key = keys.PrivateKey(priv_key_bytes) | |
pub_key = priv_key.public_key | |
print(pub_key) | |
print(pub_key.to_address()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment