def P2PKH_address_from_pubkey(cls, pubkey): '''Return a coin address given a public key.''' return cls.P2PKH_address_from_hash160(hash160(pubkey))
def identifier(self): '''Return the key's identifier as 20 bytes.''' return hash160(self.pubkey_bytes)
def from_multisig_script(cls, script): return cls.from_P2SH_hash(hash160(script))
def test_hash160(): assert lib_hash.hash160( b'hash_160' ) == b'\xb3\x96\x94\xfc\x978R\xa7)XqY\xbb\xdc\xeb\xac\xa7%\xb8$'
def address(self): '''Convert to an Address object.''' return Address(hash160(self.pubkey), Address.ADDR_P2PKH)