Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oddieis/1f41e608770ada9c83887f6a35c2374c to your computer and use it in GitHub Desktop.
Save oddieis/1f41e608770ada9c83887f6a35c2374c to your computer and use it in GitHub Desktop.
ethereum address generator
# -*- 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