Commit graph

76 commits

Author SHA1 Message Date
b13acfa3b1
wallet.mmgen: increase salt length to 32 bytes 2026-05-21 12:09:33 +00:00
f840069ecb
update copyright dates 2026-02-11 13:02:12 +00:00
49a11a750b
mmgen-txsend -s: fix crash with XMR compat tx file in txauto dir 2026-01-14 16:27:27 +00:00
4b55f1158e
btc.tx.base.decodeScriptPubKey(): reimplement, parse nulldata correctly 2025-09-29 23:09:17 +00:00
e0d5463ea7
test suite: EtherscanServer: return correct TxID 2025-06-16 14:35:30 +00:00
55e59cee12
RUNE low-level transaction support
Testing:

    $ test/modtest.py rune
2025-06-10 17:47:03 +00:00
ba3b40c5b6
support THORChain address generation
Example:

    $ mmgen-addrgen --coin=rune 1-10

Testing:

    $ test/tooltest2.py -q --coin=rune
    $ test/modtest.py -v bip_hd.multicoin
2025-05-21 09:13:42 +00:00
ff28d39a3c
THORChain ERC20 token swap support
Examples:

    # List available assets:
    $ mmgen-swaptxcreate -S

    # Create a Tether-to-LTC swap transaction for autosigning, connecting to the
    # swap quote server via Tor:
    $ mmgen-swaptxcreate --autosign --proxy=localhost:9050 ETH.USDT 1000 LTC

    # After signing, send the transaction via public Etherscan proxy over Tor:
    $ mmgen-txsend --autosign --quiet --tx-proxy=etherscan --proxy=localhost:9050

    # After sending, check the transaction status and receipt:
    $ mmgen-txsend --autosign --verbose --status

    # Create a Tether-to-DAI swap transaction, with explicit destination account:
    $ mmgen-swaptxcreate ETH.USDT 1000 ETH.DAI E:01234ABC:3

Testing:

    $ test/cmdtest.py -e ethswap
2025-04-27 11:53:49 +00:00
21fb6a8195
cmdtest ethdev: use single dev address for all daemons 2025-04-09 09:16:01 +00:00
6a369f79d7
test suite: replace invalid transaction file 2025-03-17 10:16:18 +00:00
1eb0de7938
ETH: transaction sending via Etherscan
- the HTML transaction broadcast form is used, so no API key is required
- the request can be proxied through Tor
- availability of the service can be checked with the --test option

Example:

    # check availability:
    $ mmgen-txsend --autosign --coin=eth --tx-proxy=etherscan --proxy=localhost:9050 --test

    # send:
    $ mmgen-txsend --autosign --coin=eth --tx-proxy=etherscan --proxy=localhost:9050

Testing:

    $ test/cmdtest.py --coin=eth -e -X txsend_etherscan ethdev
2025-03-15 18:24:54 +00:00
1e422b2c2b
support Rust Ethereum client (Reth)
Tested on Linux only

Testing:

    $ test/cmdtest.py --coin=eth --daemon-id=reth ethdev
2025-03-10 14:28:55 +00:00
7293135db8
test suite: vendor tx_valid.json from Bitcoin Core repo (v28.0) 2024-12-30 11:31:39 +00:00
4ffe5c48d2
tx.file: new transaction file format
- the new format is plain JSON, readable with tools such as `jq`.  Filenames
  and extensions for raw, signed and sent transactions remain unchanged

- reading/writing the legacy format continues to be supported, but new
  transactions cannot be written to it.  This means users who upgrade MMGen
  Wallet to this commit on their online computer(s) must upgrade it on their
  offline signing device(s) as well: upgraded offline installations can
  interoperate with non-upgraded online installations, but not vice-versa

- no additional action is required: this change is transparent to the user

Testing:

    $ test/unit_tests.py tx.txfile
    $ test/cmdtest.py -n main
    $ test/test-release.sh -A autosign
2024-10-12 09:14:45 +00:00
8edc7da5a2
BCH cashaddr: full support
- BCH addresses are now displayed in cashaddr format by default.  This may be
  overridden on the command line with --cashaddr=0, or in the config file by
  setting `bch_cashaddr` to false
- In tracking wallet views, the ‘h’ key toggles between legacy and cashaddr
  address display
- Transaction views display BCH addresses in both formats simultaneously
- The --usecashaddr=0 daemon option is no longer required and should be omitted

Testing:

    $ test/unit_tests.py -v cashaddr bip_hd.multicoin
    $ test/gentest.py --coin=bch -v --type=C 1 test/ref/bitcoin_cash/bchwallet.dump
    $ test/cmdtest.py -e bch_txview_cashaddr1 bch_txview_cashaddr2
    $ test/cmdtest.py --coin=bch -e txsend regtest.view autosign_automount
    $ test/cmdtest.py --coin=bch -n ref3_addr
2024-09-29 11:59:57 +00:00
5f22d2fbde
scripts/create-token.py: support solc version 0.8.26 2024-07-08 10:51:21 +00:00
ea1e8d1228
bip_hd: a minimal, easy-to-use BIP-32/BIP-44 implementation
- this is a work in progress, only a few coins are currently supported

Testing:

    $ test/unit_tests.py -v bip_hd

Examples:

    $ PYTHONPATH=. examples/bip_hd.py
2024-01-26 10:54:03 +00:00
99e7057856
mmgen-tool: new command: decrypt_keystore
command rename: `extract_key_from_geth_wallet` -> `decrypt_geth_keystore`
2023-11-30 10:53:40 +00:00
baa1ae7f98
test.py xmrwallet_txview: add 2 ref TX files 2023-04-30 09:36:01 +00:00
dc685e9ced
mmgen-keygen: new viewkey-address file type
Generate using the --viewkeys option

Testing:

    $ test/unit_tests.py --verbose addrlist.viewkeyaddr
    $ test/tooltest2.py --fork --verbose --coin=xmr viewkeyaddrfile_chksum
    $ test/test.py -e ref_viewkeyaddrfile_gen_xmr ref_viewkeyaddrfile_chk_xmr
2023-04-18 18:35:53 +00:00
164ef9d266
mmgen-xmrwallet: new txview operation 2022-10-07 20:01:18 +00:00
01f52617f6
various fixes and cleanups 2022-05-03 21:01:05 +00:00
096f363dbc
mmgen-tool: add extract_key_from_geth_wallet command
- decrypt the encrypted private key in a Geth keystore wallet and output
  the decrypted key in hexadecimal format

Usage:

    $ mmgen-tool extract_key_from_geth_wallet geth-keystore-wallet.json

Testing:

    $ test/test.py -e tool_extract_key_from_geth_wallet
2022-04-28 11:00:53 +00:00
25efac31bc
message signing: support autosigning
Usage information:

    $ mmgen-autosign --help

Testing:

    $ test/test.py -e autosign_btc
2022-03-30 15:49:45 +00:00
cc3a03911b
unit_tests.py tx: test signed and altcoin transactions 2022-02-05 13:32:54 +00:00
eaeeef97c0
test.py ethdev: update solc to v0.8.7, update precompiled contract data 2021-09-03 20:17:25 +00:00
7412bf56ef
tool.py: fix tool API; test.py: add tool_api test, minor fixes 2020-06-08 17:03:21 +00:00
f9a483f34f
asyncio/aiohttp support
Asynchronous HTTP significantly speeds up operations involving multiple
JSON-RPC calls to the server, such as tracking wallet views for wallets
with a large number of outputs.

This patch adds base-level asyncio infrastructure plus aiohttp support to all
applicable MMGen commands.

The aiohttp package is not currently supported by MSYS2, so Windows users will
have to choose one of the other backends ('curl' is the default).

Tested on: Linux, Armbian, Windows; Python 3.6, 3.7, 3.8

New user features:

    - configurable RPC backends via the 'rpc_backend' option.  Supported
      options are 'aiohttp' (Linux-only), 'httplib', 'requests' and 'curl'

    - configurable RPC queue size via the 'aiohttp_rpc_queue_len' option

The patch also includes a rewrite/redesign of large parts of the MMGen code
base, most importantly:

    - rpc.py - full rewrite of RPC library, new RPCBackends class
    - main_addrimport.py - full rewrite
    - main_autosign.py - LED code now handled by new LEDControl class
    - eth/tw.py, eth/tx.py - reworked logic for resolving token symbols and
      addresses
    - eth/tx.py - separate classes for signed and unsigned transactions

Testing:

    # Set a backend (choose one):
    $ export MMGEN_RPC_BACKEND='aiohttp' # Linux-only
    $ export MMGEN_RPC_BACKEND='curl'    # Windows
    $ export MMGEN_RPC_BACKEND='httplib' # compare performance with 'aiohttp'

    # Bitcoin:
    $ test/unit_tests.py rpc btc
    $ test/test.py main regtest autosign

    # Ethereum:
    $ test/unit_tests.py rpc eth
    $ test/tooltest2.py --coin=eth --testnet=1 txview
    $ test/test.py --coin=eth ethdev

    # Monero wallet:
    $ test/unit_tests.py rpc xmr_wallet
    $ test/test-release.sh -F xmr
2020-05-10 14:07:54 +00:00
04add0dfa5
new mnemonic entry modes, new 'mn2hex_interactive' tool command
Auto-completion functionality for seed phrase entry provides real benefit to the
user, reducing the number of keystrokes required and permitting quick re-entry
of mistyped words.  In addition, unifying the number of keystrokes among words
improves security against acoustic side-channel attacks.  To this end, three
new interactive mnemonic entry modes are introduced by this patch.

Each entry mode is optimized for a particular wordlist.  The “short” mode, for
example, takes advantage of the fact that each word in the Monero wordlist is
uniquely identifiable by its first three letters.  For MMGen’s default Electrum
wordlist, which lacks this unique substring property, the “minimal” mode was
developed to reduce keystrokes to a minimum while retaining the option of
obfuscating entry with pad characters.

Users who prefer not to use auto-completion may specify the “full” mode, which
emulates the previous default behavior.

Overview of the key entry modes:

- 'full' (all wordlists): words are typed in full and entered with the ENTER
  or SPACE key, or by exceeding the pad character limit (see below).

- 'short' (BIP39, Monero): words are entered automatically once user types
  UNIQ_SS_LEN (see below) valid word letters.  3-letter words in the BIP39
  wordlist must be entered with the ENTER or SPACE key, or by exceeding the
  pad character limit.

- 'fixed' (BIP39, Electrum): words are entered automatically once user types
  UNIQ_SS_LEN characters in total.  Words shorter than UNIQ_SS_LEN must be
  padded to fit.  Thus the total number of characters entered is the same for
  all words.

- 'minimal' (Electrum): words are entered automatically once user types the
  minimum number of characters required to uniquely identify a word (varies
  from word to word).  Words that are substrings of other words in the wordlist
  must be entered with the ENTER or SPACE key, or by exceeding the pad
  character limit.  This is the only mode that checks user input letter by
  letter.

Pad character limits by mode:
-----------------------------
  short:   16
  minimal: 16
  full:    longest_word - word_len
  fixed:   uniq_ss_len - word_len

Wordlist parameters:
--------------------
  Parameter        Electrum   BIP39   XMRSEED
  ---------        --------   -----   -------
  uniq_ss_len:     10         4       3
  shortest_word:   3          3       4
  longest word:    12         8       12
  optimum mode:    minimal    fixed   short

Default modes for each wordlist may be configured in 'mmgen.cfg' via the
'mnemonic_entry_modes' option.

Usage / testing:

    $ mmgen-walletconv -i words
    $ mmgen-walletconv -i bip39

    $ mmgen-tool mn2hex_interactive fmt=mmgen mn_len=12 print_mn=1
    $ mmgen-tool mn2hex_interactive fmt=bip39
    $ mmgen-tool mn2hex_interactive fmt=xmrseed

    $ test/unit_tests.py mn_entry
    $ test/test.py -e input
2020-03-12 17:12:43 +00:00
924ccc6012
new CfgFile API for mmgen.cfg and related files
Testing:

  $ test/test.py cfg
2020-03-12 17:01:47 +00:00
cfa16418b3
limited Monero mnemonic seed phrase ('xmrseed') support
- only 256-bit (25-word) new-style mnemonics are supported

Testing:

  $ test/unit_tests.py baseconv
  $ test/tooltest2.py hex2mn mn2hex
  $ test/scrambletest.py pw
  $ test/test.py ref_xmrseed_25_passwdgen_3
  $ test/test.py ref_passwdfile_chk_xmrseed_25

The following operations are supported:

  Generate a random Monero mnemonic:

  $ mmgen-tool mn_rand256 fmt=xmrseed

  Generate a Monero mnemonic from hexadecimal data:

  $ mmgen-tool hex2mn deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef fmt=xmrseed

  Convert the resulting mnemonic back to hexadecimal data:

  $ mmgen-tool mn2hex 'viewpoint donuts ardent template unveil agile meant unafraid urgent athlete rustled mime azure jaded hawk baby jagged haystack baby jagged haystack ramped oncoming point template' fmt=xmrseed

  Note that the result of the reversal does not match the original input.  This
  is because input data is reduced to a spendkey before conversion so that a
  canonical seed phrase is produced.  This is required because Monero seeds,
  unlike ordinary wallet seeds, are tied to a concrete key/address pair.  The
  spendkey can be generated directly using the `hex2wif` command:

  $ mmgen-tool --coin=xmr hex2wif deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef

  Generate a list of passwords in Monero mnemonic format with ID 'mymonero':

  $ mmgen-passgen -f xmrseed 'mymonero' 1-10
2020-02-12 10:38:11 +00:00
3d9bcd7876
test.py ethdev: auto-use precompiled contract data if solc not available 2019-12-08 18:38:31 +00:00
d46eeef998
dieroll wallet: truncate seed to correct length 2019-10-30 09:20:47 +00:00
c778636918
New die roll (base6d) wallet format
- Permits the creation of wallets by repeated rolls of a die: 50 rolls for
  128-bit, 75 for 192-bit, and 100 for 256-bit seeds.  The base6d format
  uses the digits from one to six, so that user doesn't have to subtract
  one from each roll.

Testing:

  $ test/unit_tests.py baseconv
  $ test/test.py ref3 conv

Example:

  NOTE: when creating a real wallet, the following steps must be performed in a
  secure offline environment, and preferably with the use of a text editor and
  a file written in volatile memory (e.g. /dev/shm), rather than the `echo`
  command.  A more private and user-friendly data input method will be provided
  in a forthcoming patch.

  Sample 128-bit data obtained by rolling a die 50 times and entering each roll
  on the keyboard as a digit:

      15146 56446 53415 45431 55141 32115 41325 16311 32553 43533

  Here spaces have been added for greater readability.  Newlines are also
  permitted.

  Save the data in a file with the extension .b6d:

      $ echo 15146 56446 53415 45431 55141 32115 41325 16311 32553 43533 > myseed.b6d

  Convert to MMGen's default wallet format:

      $ mmgen-walletconv -o wallet myseed.b6d

  Convert the wallet back to base6d:

      $ mmgen-walletconv -o dieroll FE3C6545*.mmdat
      Base6d die roll seed data written to file 'FE3C6545[128].b6d'

      $ cat 'FE3C6545[128].b6d'
      15146 56446 53415 45431 55141
      32115 41325 16311 32553 43533
2019-10-28 15:19:54 +00:00
15ac6c6947
new wallet format: PlainHexSeedFile (plain hexadecimal w/o checksum) 2019-10-23 12:25:24 +00:00
8705e57b8f
mmgen-passgen: support BIP39 passwords
Examples:

  Generate three 24-word BIP39 mnemonic seed phrases from your default wallet
  for your Trezor device:

  $ mmgen-passgen --passwd-fmt=bip39 mytrezor 1-3

  Same, but generate 12-word seed phrases:

  $ mmgen-passgen --passwd-fmt=bip39 --passwd-len=12 mytrezor 1-3

Relevant tests:

  $ test/test.py ref ref3
2019-10-16 20:12:58 +03:00
bfcfc8676d
passgen: allow hex passwords of 32 and 48 characters 2019-10-15 16:58:07 +03:00
d7fe969d8c
passgen: code cleanups, new tests, new --passwd-fmt option 2019-10-15 15:51:43 +03:00
8519b68b89
Complete BIP39 mnemonic support
- provided as an alternative to MMGen's native mnemonic format

    # Run the BIP39 unit test:
    $ test/unit_tests.py -v bip39

    # Generate a random 128-bit BIP39 seed phrase:
    $ mmgen-tool mn_rand128 fmt=bip39

    # Export your default wallet to BIP39 format:
    $ mmgen-walletconv -o bip39
    ...
    BIP39 mnemonic data written to file '98831F3A[256].bip39'

    # Generate ten addresses from the exported wallet:
    $ mmgen-addrgen '98831F3A[256].bip39' 1-10
    ...
    Addresses written to file '98831F3A[1-10].addrs'

    # Generate ten addresses directly from your BIP39 seed phrase:
    $ mmgen-addrgen -q -i bip39 1-10
    ...
    Addresses written to file '98831F3A[1-10].addrs'

    # Export subwallet 10L of your default wallet to BIP39 format:
    $ mmgen-subwalletgen -o bip39 10L
    ...
    BIP39 mnemonic data written to file 'A17F8E90[256].bip39'
2019-07-09 15:44:17 +03:00
d0f8c44b20
TrackingWallet: balance caching, Parity light client optimizations
- activated for Ethereum only, but framework exists for all coins
- both session caching and persistent caching in the wallet are supported
- network-destined RPC calls are never repeated in a given invocation
- RPC balance lookups can be suppressed entirely with --cached-balances
2019-07-05 16:03:03 +03:00
0ec3eb1a07
tw.py: new get_tw_label() function; raise exception on bad tw label 2019-07-03 20:40:43 +03:00
d558822941
autosign: print summary of non-MMGen output addresses and amounts
To allow the user to verify that transaction outputs have not been altered
by a compromised online MMGen installation, print a list of non-MMGen output
addresses and amounts for all signed transactions after every autosign run.

With --full-summary, print a full view of each signed transaction instead.
2019-04-24 17:39:22 +03:00
0879e53e74
tooltest2.py - add BTC test vectors
tooltest.py  - bugfixes, remove some commands covered in tooltest2.py
mmgen-tool   - bugfixes, cleanups, rename some commands, change some command
               options
			 - all commands taking binary input can now receive it from file
			   or stdin

+ numerous minor fixes throughout
2019-03-06 23:58:59 +03:00
d4eb8f6ac0
Full Ethereum Classic (ETC) + ERC20 token support
As with ETH transacting support, this feature is in beta phase

All key functionality works, for both ETC and ETC tokens:
- Tracking wallet: getbalance, twview, listaddresses
- TX create, send, sign
- TX bumping
- ERC20 token creation, deployment

For usage details, see https://github.com/mmgen/mmgen/wiki/Altcoin-and-Forkcoin-Support

Differences from ETH:
- Start Parity with --jsonrpc-port=8555 (or --ports-shift=10) and --chain=classic
- Launch MMGen commands with --coin=etc
2018-10-02 21:09:48 +03:00
4df12def5f
autosign: support testnet, ERC20 tokens 2018-07-29 17:24:29 +03:00
e0dad2e108
test/test.py: update eth ref tx files 2018-07-25 14:08:58 +03:00
fad573eccd
tx.py,tw.py: cleanups, support tx inputs from cmdline 2018-07-24 00:17:05 +03:00
9d04a244ec
test.py: rewrite create_ref_tx, update reference tx files 2018-06-05 00:15:52 +03:00
90e89ad291
test.py: update testnet reference address and key-address files 2018-06-04 12:13:52 +03:00
2c97f61ea4
Ethereum autosigning 2018-05-31 22:02:00 +03:00