Created
November 25, 2017 08:24
-
-
Save banteg/7da85ee45ceaae6bd5447305d99c8c92 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
from ecdsa import SigningKey, SECP256k1 | |
from sha3 import keccak_256 | |
priv = SigningKey.generate(curve=SECP256k1) | |
pub = priv.get_verifying_key().to_string() | |
address = keccak_256(pub).hexdigest()[24:] | |
print(f'private key: 0x{priv.to_string().hex()}') | |
print(f'public key: 0x{pub.hex()}') | |
print(f'address: 0x{address}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment