pybit/py3/block.py
def P2PKH(pk: hex,
              debug: bool=False) -> str:
        """
        pk = public key in hex
        """
        # Add version
        pk = b"\00" + pk
        if debug:
            print("{0}pk + ver: {1}".format(" "*6, codecs.encode(pk, "hex")))

        # Hash
        h = hash_SHA256_twice(pk)
        if debug:
            print("{0}hash: {1}".format(" "*6, codecs.encode(h, "hex")))
        # Add first 4 bytes of second hash to pk (already hex)
        pk = pk + h[0:4]
        if debug:
            print("{0}pk + checksum: {1}".format(
                            " "*6, codecs.encode(pk, "hex")))

        # Convert to base 58 (bin -> base58)
        b58 = base58.b58encode(pk)
        if debug:
            print("{0}b58: {1}".format(" "*6, b58))

        return b58

        pk = public key in hex
        
pk = public key in hex
pk = public key in hex
def P2PKH(pk: hex,
              debug: bool=False) -> str:
        pk = b"\00" + pk
        if debug:
            print("{0}pk + ver: {1}".format(" "*6, codecs.encode(pk, "hex")))
        h = hash_SHA256_twice(pk)
        if debug:
            print("{0}hash: {1}".format(" "*6, codecs.encode(h, "hex")))
        pk = pk + h[0:4]
        if debug:
            print("{0}pk + checksum: {1}".format(
                            " "*6, codecs.encode(pk, "hex")))
        b58 = base58.b58encode(pk)
        if debug:
            print("{0}b58: {1}".format(" "*6, b58))
        return b58
def P2PKH ( pk : hex , debug : bool = False ) -> str : pk = b"\00" + pk if debug : print ( "{0}pk + ver: {1}" . format ( " " * 6 , codecs . encode ( pk , "hex" ) ) ) h = hash_SHA256_twice ( pk ) if debug : print ( "{0}hash: {1}" . format ( " " * 6 , codecs . encode ( h , "hex" ) ) ) pk = pk + h [ 0 : 4 ] if debug : print ( "{0}pk + checksum: {1}" . format ( " " * 6 , codecs . encode ( pk , "hex" ) ) ) b58 = base58 . b58encode ( pk ) if debug : print ( "{0}b58: {1}" . format ( " " * 6 , b58 ) ) return b58
pk = public key in hex
pk = public key in hex
"""
        pk = public key in hex
        """ # Add version # Hash # Add first 4 bytes of second hash to pk (already hex) # Convert to base 58 (bin -> base58)
pk
hex
debug
bool