-
-
Save oddieis/1f41e608770ada9c83887f6a35c2374c to your computer and use it in GitHub Desktop.
ethereum address generator
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
#!/usr/bin/python | |
# pip install ecdsa | |
# pip install pysha3 | |
from ecdsa import SigningKey, SECP256k1 | |
import sha3 | |
keccak = sha3.keccak_256() | |
priv = SigningKey.generate(curve=SECP256k1) | |
pub = priv.get_verifying_key().to_string() | |
keccak.update(pub) | |
address = keccak.hexdigest()[24:] | |
print("Private key:", priv.to_string().encode('hex')) | |
print("Public key: ", pub.encode('hex')) | |
print("Address: 0x" + address) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment