· 6 years ago · Feb 02, 2019, 03:34 AM
1#!/usr/bin/env python3
2
3import bitcoin
4from bitcoin.wallet import P2PKHBitcoinAddress
5from bitcoin.core import x
6from bitcoin.core import CoreMainParams
7
8class CoinParams(CoreMainParams):
9 MESSAGE_START = b'\x24\xe9\x27\x64'
10 DEFAULT_PORT = 7770
11 BASE58_PREFIXES = {'PUBKEY_ADDR': 60,
12 'SCRIPT_ADDR': 85,
13 'SECRET_KEY': 188}
14
15bitcoin.params = CoinParams
16PUBKEY = input('pubkey:')
17
18print(P2PKHBitcoinAddress.from_pubkey(x(PUBKEY)))