addrgen.py 690 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python3
  2. #
  3. # mmgen = Multi-Mode GENerator, a command-line cryptocurrency wallet
  4. # Copyright (C)2013-2023 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.eth.addrgen: Ethereum address generation class for the MMGen suite
  12. """
  13. from ...addrgen import addr_generator,check_data
  14. from ...addr import CoinAddr
  15. class ethereum(addr_generator.keccak):
  16. @check_data
  17. def to_addr(self,data):
  18. return CoinAddr(
  19. self.proto,
  20. self.keccak_256(data.pubkey[1:]).hexdigest()[24:] )