def address(self, compressed=True, testnet=False):
""" Address property that returns the Base58Check
encoded version of the HASH160.
Args:
compressed (bool): Whether or not the compressed key should
be used.
testnet (bool): Whether or not the key is intended for testnet
usage. False indicates mainnet usage.
Returns:
bytes: Base58Check encoded string
"""
version = '0x'
return version + encode_hex(self.keccak[12:])
# Put the version byte in front, 0x00 for Mainnet, 0x6F for testnet
# version = bytes([self.TESTNET_VERSION]) if testnet else bytes([self.MAINNET_VERSION])
# return base58.b58encode_check(version + self.hash160(compressed))
评论列表
文章目录