Created
April 6, 2017 15:30
-
-
Save reiven/169f09efd9798995b2d8d7176f8d8889 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