addrgen.py 660 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python3
  2. #
  3. # MMGen Wallet, a terminal-based cryptocurrency wallet
  4. # Copyright (C)2013-2026 The MMGen Project <mmgen@tuta.io>
  5. # Licensed under the GNU General Public License, Version 3:
  6. # https://www.gnu.org/licenses
  7. # Public project repositories:
  8. # https://github.com/mmgen/mmgen-wallet
  9. # https://gitlab.com/mmgen/mmgen-wallet
  10. """
  11. proto.xchain.addrgen: Cross-chain address generation classes for the MMGen suite
  12. """
  13. from ...addrgen import addr_generator, check_data
  14. from ..btc.common import hash160
  15. class bech32x(addr_generator.base):
  16. @check_data
  17. def to_addr(self, data):
  18. return self.proto.encode_addr_bech32x(hash160(data.pubkey))