Skip to content

Ubuntu 22.04 - ValueError: unsupported hash type ripemd160 #168

@reisenmachtfreude

Description

@reisenmachtfreude

Using Ubuntun 22.04 and Python 3.10.6 the code throws an error

my_key = PrivateKeyTestnet()
print(my_key.address)

 File "/home/user/.local/lib/python3.10/site-packages/bit/wallet.py", line 572, in address
    self._address = public_key_to_address(self._public_key, version=self.version)
  File "/home/user/.local/lib/python3.10/site-packages/bit/format.py", line 121, in public_key_to_address
    return b58encode_check(version + ripemd160_sha256(public_key))
  File "/home/user/.local/lib/python3.10/site-packages/bit/crypto.py", line 19, in ripemd160_sha256
    return new('ripemd160', sha256(bytestr)).digest()
  File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new
    return __get_builtin_constructor(name)(data)
  File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type ripemd160

Using same code in virtual env python3.9 does work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions