txsign.py 1.6 KB

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