Commit graph

738 commits

Author SHA1 Message Date
ef6e03d78b
add missing file wallet.py to master branch 2020-05-06 21:34:35 +00:00
2c073ac0b5
tw.py: remove 'approx' age precision for unspent outputs 2020-05-01 08:29:40 +00:00
744c7b0d54
rpc.py: new calls() method; tw.py: batch date RPC calls; related fixes/cleanups 2020-05-01 08:28:22 +00:00
05653ee47a
mmgen.share.Opts: improve opts parsing 2020-04-14 13:42:08 +00:00
da5742f667
various cleanups throughout 2020-04-12 15:02:52 +00:00
370a972b4b
obj.py, Hilite: cleanups 2020-04-11 15:51:25 +00:00
3610b3ef29
OrderedDict -> dict throughout 2020-04-09 19:34:24 +00:00
701e7a77e5
use relative imports throughout 2020-04-09 19:32:23 +00:00
ca1cdacaf1
move wallet classes from seed.py to new module wallet.py 2020-04-09 17:11:59 +00:00
4fbe2d6574
rename class: SeedSource -> Wallet 2020-04-09 16:38:26 +00:00
1f3195bfd2
rename class: Wallet -> MMGenWallet 2020-04-09 16:09:22 +00:00
f052968e21
seed.py: new SeedSourceMeta metaclass 2020-04-09 10:01:45 +00:00
f231ca6202
seed.py: make wallet classes leaf classes, minor cleanups 2020-04-09 09:55:01 +00:00
f297645796
ImmutableAttr,ListItemAttr: renamed, call signature simplified 2020-04-08 14:13:13 +00:00
090b91baa2
test.py regtest: minor fix 2020-04-08 14:10:45 +00:00
068377cf1b
tool.py: new MMGenToolCmdMeta metaclass
Testing:

    $ test/test.py tool_help
    $ test/tooltest2.py
    $ test/tooltest2.py -A
    $ test/tooltest2.py -f
    $ test/tooltest.py
    $ test/test.py tool
2020-04-08 08:51:19 +00:00
99beeb0d49
tool: minor changes 2020-04-08 08:48:52 +00:00
b671453c13
txcreate,twview,listaddresses: display transaction date
- The `mmgen-tool` `listaddresses` and `twview` commands, as well as the
  unspent outputs menu of `mmgen-txcreate`, can now display the date/time of
  each output in addition to its number of confirmations, block, or age in
  days.  Two date display precisions are available: “approx”, an estimate based
  on the historical average block confirmation interval, and “exact”, the
  timestamp of the block containing the output.  Since display of the exact
  date requires an extra RPC call per output, precision defaults to “approx”.
  The setting also affects the precision of the age-in-days output.

Usage:

    $ mmgen-txcreate -i # 'D' to cycle through display opts, 'x' for exact age
    $ mmgen-tool listaddresses age_fmt=date exact_age=1 # (or age_fmt=date_time)
    $ mmgen-tool twview age_fmt=date exact_age=1        # (or age_fmt=date_time)

Testing:

    $ test/test.py -ne regtest
    $ test/test.py -ne --coin=eth ethdev
2020-04-04 13:18:44 +00:00
de7fba0c19
test suite: relocate some modules, use relative imports 2020-03-16 10:45:00 +00:00
656bb69587
terminal-related fixes and cleanups 2020-03-15 19:45:32 +00:00
d8e1d5f88c
term.py: new MMGenTerm family of classes
Testing:

    $ test/misc/term.py
2020-03-15 19:43:23 +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
987dafd353
opts.py: init sequence, opt checking cleanups/improvements
Testing:

  $ test/test.py opts
2020-03-12 17:10:02 +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
ea83e2595d
test.py: move tool and input tests to their own modules 2020-03-12 16:59:55 +00:00
853a24df21
minor fixes, cleanups and additions 2020-03-12 16:38:02 +00:00
c7d15bcacf
Version bump 2020-03-01 09:12:21 +00:00
6d9a192c54
Version 0.12.0 v0.12.0 2020-02-26 16:49:05 +00:00
1f98c42ab8
Update README, update documentation from wiki 2020-02-25 19:03:47 +00:00
f4d2829a54
Daemon: new 'flags' arg; testing/release: minor fixes 2020-02-25 16:45:27 +00:00
5fe92460ad
release/testing: UTF8 testing fixes, other fixes and improvements 2020-02-22 19:54:03 +00:00
cd3e1e3574
MoneroWalletRPCConnection: use requests library 2020-02-21 13:53:21 +00:00
43fc89e2bb
Daemon: use lockfile, attempt repeated starts before failing 2020-02-21 13:42:56 +00:00
fe7fd06017
[msys2]: use Curl for RPC
Workaround necessitated by severe performance issues with the Python HTTP
module on MSYS2.  Other Python HTTP libraries seem to be affected too.
2020-02-20 20:47:17 +00:00
a27eddef10
rpc.py: minor code cleanups 2020-02-20 20:44:10 +00:00
9a4920a1b5
release/testing: minor fixes and improvements 2020-02-18 20:28:28 +00:00
4fc344dfe5
tool_api: warn on low trust-level altcoins 2020-02-18 15:32:20 +00:00
4493a7b10f
Daemon: hide Windows console 2020-02-18 14:59:55 +00:00
78652dc664
add v0.12.0 release notes 2020-02-18 14:23:31 +00:00
0f8d259cf6
[msys2]: remove mswin_pw_warning 2020-02-18 14:18:56 +00:00
b4a60208e4
test-release.sh: add 'noalt' test group 2020-02-18 14:07:51 +00:00
673b97b3b8
update copyright dates 2020-02-18 14:07:27 +00:00
99a8c46578
[msys2]: support Monero and Monero wallet RPC daemons 2020-02-17 16:54:57 +00:00
f805663041
new Tool API interface
- provides a convenient interface to selected methods in the mmgen.tool module
- Type `pydoc3 mmgen.tool.tool_api` for available methods and call signatures

## Examples:

### Initialize:

    from mmgen.tool import tool_api
    tool = tool_api()

### Utility methods:

    # Skip user entropy gathering (not recommended)
    tool.usr_randchars = 0

    # Generate a random hex secret:
    hexsec = tool.randhex()

    # Reverse the hex string:
    hexsec_rev = tool.hexreverse(hexsec)

    # Get the HASH160 of the value:
    sec_hash160 = tool.hash160(hexsec)

    # Convert the value to base58 format:
    sec_b58 = tool.hextob58(hexsec)

    # Convert the value to base58 check format:
    sec_b58chk = tool.hextob58chk(hexsec)

    # Convert the byte specification '4G' to an integer:
    four_g = tool.bytespec('4G')

    # Convert the byte specification '4GB' to an integer:
    four_gb = tool.bytespec('4GB')

### Key/address generation:

    # List available coins:
    print(' '.join(tool.coins))

    # Initialize a coin/network pair:
    proto = tool.init_coin('btc','mainnet')

    # Print the available address types for current coin/network, along with a
    # description.  If tool.addrtype is unset, the first-listed will be used:
    tool.print_addrtypes()

    # Set the address type to P2PKH with compressed public key:
    tool.addrtype = 'compressed'

    # Generate the key and address:
    wif = tool.hex2wif(hexsec)
    addr = tool.wif2addr(wif)

    # Generate an LTC regtest Segwit key and address:
    proto = tool.init_coin('ltc','regtest')
    tool.addrtype = 'segwit'
    wif = tool.hex2wif(hexsec)
    addr = tool.wif2addr(wif)

    # Generate a random LTC regtest Bech32 key/address pair:
    tool.addrtype = 'bech32'
    wif,addr = tool.randpair()

### Mnemonic seed phrase generation:

    # Generate an MMGen native mnemonic seed phrase:
    mmgen_seed = tool.hex2mn(hexsec)

    # Generate a BIP39 mnemonic seed phrase:
    bip39_seed = tool.hex2mn(hexsec,fmt='bip39')
2020-02-15 14:32:14 +00:00
07131b160a
protocol.py: improve handling of testnet/regtest Bech32 HRP 2020-02-15 14:13:13 +00:00
e1f7a50ba4
minor changes and fixes 2020-02-15 14:11:30 +00:00
3951925a93
reimplement Monero wallet creation/syncing tool
This patch reimplements the `mmgen-tool` commands `keyaddrlist2monerowallets`
and `syncmonerowallets`.

- to communicate with monerod, the helper daemon `monero-wallet-rpc` is now
  used instead of `monero-wallet-cli`.  The helper daemon is started and
  stopped automatically
- wallet sync time is significantly reduced
- commands should now work under MSWin/MSYS2 (testing TBD)
2020-02-12 10:38:27 +00:00
779f522d16
new MoneroWalletDaemon, MoneroWalletRPCConnection classes 2020-02-12 10:38:26 +00:00
ff104847d8
SeedSource.__new__(): cleanups, fixes 2020-02-12 10:38:24 +00:00