karask/python-bitcoin-utils

How to create P2PKH address

Closed this issue · 1 comments

There are some examples but there's no explanation on how to create P2PKH address from public_key; Here is the file you imported the class but it's not used!

from bitcoinutils.keys import P2pkhAddress, PrivateKey, PublicKey

Please provide some information/examples to create these types of address..

thanks for considering and reading this issue

Hi @hasanparasteh

The P2PKH address is created in line 36 from the public key and stored to "address"; it is a P2pkhAddress object. In line 39 the base64encoding of the address is printed.

Also see

return P2pkhAddress(hash160=addr_string_hex)