Skip to content

Instantly share code, notes, and snippets.

View ECBSJ's full-sized avatar

ECBSJ ECBSJ

View GitHub Profile
@circulosmeos
circulosmeos / easy-bitcoin-address-from-public-key.py
Last active August 6, 2023 15:20
Easily generate the bitcoin address from the public key using Python (compatible with Python 2 and 3)
#!/usr/bin/env python
# https://en.bitcoin.it/wiki/Protocol_documentation#Addresses
import hashlib
import base58
# ECDSA bitcoin Public Key
pubkey = '0450863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b23522cd470243453a299fa9e77237716103abc11a1df38855ed6f2ee187e9c582ba6'
# See 'compressed form' at https://en.bitcoin.it/wiki/Protocol_documentation#Signatures
compress_pubkey = False