Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@shrimalmadhur
shrimalmadhur / priv_pub.py
Last active January 23, 2023 00:45
Derive public key from private key
# Reference - https://stackoverflow.com/a/53488466
# pre req with python3
# pip3 install ecdsa
# pip3 install pysha3 # sha3 won't work
from ecdsa import SigningKey, SECP256k1
import sha3, random, binascii
private_key = "<some private key in hex string>"
private_key = bytes(private_key, 'utf-8')