Commit graph

162 commits

Author SHA1 Message Date
f840069ecb
update copyright dates 2026-02-11 13:02:12 +00:00
a3eef0128a
Windows/MSYS2 build and testing fixes 2025-09-15 09:28:41 +00:00
730a112f69
extmod/secp256k1mod.c: add sign, verify, pubkey recover funcs 2025-06-29 14:04:46 +00:00
e54f039690
update copyright dates 2025-02-16 14:42:27 +00:00
7131b892e3
minor fixes and cleanups 2025-01-27 16:01:48 +00:00
de6750a34b
whitespace: scripts, setup.py, other 2024-10-18 10:32:11 +00:00
5150ca586b
update file header 2024-10-18 10:32:06 +00:00
f4183a0c9e
macOS: fix include and library paths for extmod build 2024-09-02 09:43:47 +00:00
8e46932475
update copyright dates 2024-01-19 11:05:10 +00:00
48636ff2e0
update headers: mmgen -> mmgen-wallet 2023-11-17 13:35:42 +00:00
5eb3eb84e8
setup.py: cleanups 2023-11-15 10:20:19 +00:00
37e439c856
setup.py: specify libsecp256k1 shared object explicitly for Linux 2023-11-14 16:01:43 +00:00
159e1c8ac7
setup.py: build libsecp256k1 only on MSYS2 platform
For Linux, just use the version provided by the distro:

    # Debian/Ubuntu
    $ sudo apt-get install libsecp256k1-dev

    # ArchLinux:
    $ sudo pacman -S libsecp256k1
2023-11-13 13:44:53 +00:00
3e1db1fb14
setup.py: MSYS2 workaround: build dynamic secp256k1 extension mod 2023-11-13 11:17:29 +00:00
5759ded55a
setup.py: MSYS2 fixes 2023-11-13 11:17:29 +00:00
ac44caf5ab
setup.py: cleanups 2023-11-13 11:17:28 +00:00
4f42233836
pylint throughout (excluding tests) - imports 2023-10-11 12:58:48 +00:00
2449baed2c
whitespace, comments throughout (excluding tests) 2023-10-11 12:58:47 +00:00
ebb77548b7
setup.py: add workaround for MSYS2 UCRT64 env path bug
MMGen now uses UCRT64 as the default MSYS2 configuration (see
doc/wiki/install-mswin/Install-MMGen-on-Microsoft-Windows.md).
2023-05-21 11:34:17 +00:00
82fb37d09c
minor test fixes, minor Windows install fix 2023-05-21 11:34:16 +00:00
0e6ab32bf1
setup.py: Windows build fix 2023-05-19 20:29:09 +00:00
d646099a37
move secp256k1 extension module to proto.secp256k1 2022-10-05 19:22:42 +00:00
d5e8d5b96f
various fixes and cleanups 2022-05-06 12:52:41 +00:00
feffc45fd5
Windows and Windows testing fixes 2022-05-03 21:01:05 +00:00
cd379e01bb
Windows build/install fixes 2022-01-05 11:53:48 +00:00
2872d4b683
f-strings, whitespace (program files) [43 files patched] 2021-09-29 21:17:56 +00:00
c82eb9d149
setup.py,setup.cfg: Windows build fixes 2021-09-26 21:16:55 +00:00
25fb862390
setup.py: fully automate secp256k1 extension module build
The secp256k1 library is now cloned from Github and built automatically.  It’s
linked statically to the extension mod, so that the resulting wheel can run on
a system without libsecp256k1 installed.
2021-09-24 20:07:06 +00:00
4a9571424e
setuptools: migrate from setup.py to setup.cfg
The preferred way to install MMGen is now:

    # cd to repository root
    $ python3 -m build --no-isolation
    $ pip3 install --user dist/*.whl

A user install eliminates reliance on superuser privileges and prevents
conflicts with Python packages that may already be installed on the system.

Python dependencies are automatically installed by pip.
2021-09-23 21:28:06 +00:00
ea81d466a8
move data files to package directory
- The former location of the data files, /usr/local/share/mmgen, is no longer
  used and may be safely deleted.
2021-09-23 21:15:32 +00:00
016f83f0d7
require >= Python 3.7
This means that Ubuntu Bionic (Python 3.6.9) is no longer supported
2021-09-05 18:40:43 +00:00
7f5a1c666d
setup.py: distutils -> setuptools 2021-09-03 20:17:23 +00:00
f379cde0fc
new ClassFlags,ClassOpts classes 2021-08-10 19:38:20 +00:00
bab1242817
minor fixes and cleanups 2021-07-29 14:20:44 +00:00
cb98afda79
new command: mmgen-xmrwallet, replacing mmgen-tool xmrwallet
- `wallets` arg is now 3rd positional arg
- tool keyword args are now command options

Old and new invocation examples:

    OLD: mmgen-tool xmrwallet sync *.akeys.mmenc wallets=3-5
    NEW: mmgen-xmrwallet sync *.akeys.mmenc 3-5

    OLD: mmgen-tool xmrwallet sweep *.akeys.mmenc wallets=3:2 tx_relay_daemon=foo.onion:18081:127.0.0.1:9052
    NEW: mmgen-xmrwallet --tx-relay-daemon=foo.onion:18081:127.0.0.1:9052 sweep *.akeys.mmenc 3:2
2021-06-08 11:46:13 +00:00
ecf489af0e
minor fixes and cleanups 2021-06-08 11:46:05 +00:00
3484222185
move MoneroWalletOps class to new xmrwallet module 2021-05-08 12:44:58 +00:00
21ba2476eb
minor cleanups 2021-04-17 13:27:54 +00:00
cb7f38370b
Update copyright dates 2021-02-19 20:09:06 +03:00
474dd0df20
setup.py: fix module paths 2020-09-21 14:40:50 +00:00
1ff7f3e5ba
various build and testing fixes 2020-06-27 10:22:01 +00:00
4c2410e0d6
new Lockable class; lock global vars after initialization (amended) 2020-05-29 16:10:12 +00:00
c3f185e8b0
eliminate use of global vars g.proto, g.coin, g.rpc and others
This patch eliminates nearly all the global variables that changed during the
execution of scripts.  With a few minor exceptions, global vars are now used
only during initialization or reserved for cfg file / cmdline options and other
unchanging values.

The result is a code base that's much more maintainable and extensible and less
error-prone.  The autosigning code, which supports signing of transactions for
multiple protocols and networks, has been greatly simplified.

Doing away with globals required many changes throughout the code base, and
other related (and not so related) changes and cleanups were made along the
way, resulting in an enormous patch.

Additional code changes include:

    - tx.py: complete reorganization of TX classes and use of nesting

    - protocol.py: separation of Regtest and Testnet into distinct subclasses
      with separate address and transaction files and file extensions

    - new module help.py for the help notes, loaded on demand

    - addr.py: rewrite of the address file label parsing code

    - tx.py,tw.py: use of generators to create formatted text

User-visible changes include:

    - importing of addresses for tokens not yet in the user's tracking wallet
      is now performed with the `--token-addr` option instead of `--token`

Testing:

    Testing this patch requires a full run of the test suite as described on the
    Test-Suite wiki page.
2020-05-28 09:53:34 +00:00
9f1d647f07
new class: MMGenTxFile 2020-05-18 13:25:00 +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
57f12cd1cb
minor changes and fixes throughout 2020-05-10 13:39:53 +00:00
ca1cdacaf1
move wallet classes from seed.py to new module wallet.py 2020-04-09 17:11:59 +00:00
9a888735a6
minor fixes and cleanups 2020-03-13 19:51:08 +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