Skip to content

Instantly share code, notes, and snippets.

@stevenc81
Created January 6, 2020 20:20
Show Gist options
  • Save stevenc81/f466940cac8074756b072a243317ff1f to your computer and use it in GitHub Desktop.
Save stevenc81/f466940cac8074756b072a243317ff1f to your computer and use it in GitHub Desktop.
Ethereum Private Key to Public Key and Address
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