txsign.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/env python3
  2. #
  3. # MMGen Wallet, a terminal-based cryptocurrency wallet
  4. # Copyright (C)2013-2025 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. help.txsign: txsign help notes for the MMGen Wallet suite
  12. """
  13. from ..cfg import gc
  14. from ..proto.btc.params import mainnet
  15. from ..daemon import CoinDaemon
  16. def help(proto, cfg):
  17. def coind_exec():
  18. return CoinDaemon(cfg, network_id=proto.coin).exec_fn if proto.coin in CoinDaemon.coins else 'bitcoind'
  19. return """
  20. Transactions may contain both {pnm} or non-{pnm} input addresses.
  21. To sign non-{pnm} inputs, a {wd}flat key list is used
  22. as the key source (--keys-from-file option).
  23. To sign {pnm} inputs, key data is generated from a seed as with the
  24. {pnl}-addrgen and {pnl}-keygen commands. Alternatively, a key-address file
  25. may be used (--mmgen-keys-from-file option).
  26. Multiple wallets or other seed files can be listed on the command line in
  27. any order. If the seeds required to sign the transaction’s inputs are not
  28. found in these files (or in the default wallet), the user will be prompted
  29. for seed data interactively.
  30. To prevent an attacker from crafting transactions with bogus {pnm}-to-{pnu}
  31. address mappings, all outputs to {pnm} addresses are verified with a seed
  32. source. Therefore, seed files or a key-address file for all {pnm} outputs
  33. must also be supplied on the command line if the data can’t be found in the
  34. default wallet.
  35. """.format(
  36. wd = f'{coind_exec()} wallet dump or ' if isinstance(proto, mainnet) else '',
  37. pnm = gc.proj_name,
  38. pnu = proto.name,
  39. pnl = gc.proj_name.lower())