Version 0.9.6

This commit is contained in:
MMGen 2018-01-14 17:24:36 +03:00
commit 83e9899b38
Signed by untrusted user who does not match committer: mmgen
GPG key ID: 62DBE9E5212F05BE
69 changed files with 544 additions and 390 deletions

View file

@ -109,7 +109,7 @@ future use in an address file, which addresses may safely be made public.
> #### [Recovering your keys without the MMGen software][r]
> #### [Forkcoin and Altcoin support (BCH,LTC,ETH,ETC,DASH,ZEC)][x]
> #### [Forkcoin and Altcoin support (BCH,LTC,ETH,ETC,ZEC,XMR and 144 Bitcoin-derived alts)][x]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software

View file

@ -73,15 +73,16 @@ binaries are available for Bitcoin Core, Bitcoin ABC and Litecoin. See the
$ cd src
$ sudo install -sv litecoind litecoin-cli /usr/local/bin
> To simplify the starting and stopping of several daemons on the same machine,
> download and use the node start and stop scripts from the MMGenLive project:
Refer to [Run][02] on the binary installation page for instructions on running
your coin daemon(s).
Alternatively, you may download and use the node start and stop scripts from the
MMGenLive project, which simplify starting and stopping multiple daemons on the
same machine:
$ curl -O 'https://raw.githubusercontent.com/mmgen/MMGenLive/master/home.mmgen/bin/mmlive-node-{start,stop}'
$ sudo install -v mmlive-node-{start,stop} /usr/local/bin
Refer to [Run][02] on the binary installation page for instructions on running
your coin daemon(s).
[01]: Install-Bitcoind
[02]: Install-Bitcoind#a_r
[bu]: https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md

View file

@ -2,11 +2,11 @@
> Install required Debian/Ubuntu packages:
$ sudo apt-get install python-pip python-dev python-pexpect python-ecdsa python-scrypt libssl-dev git autoconf libtool wipe python-setuptools libgmp-dev
$ sudo apt-get install python-dev python-pexpect python-ecdsa python-scrypt libssl-dev git autoconf libtool wipe python-setuptools libgmp-dev python-crypto python-nacl python-pysha3 python-pip
> Install the Python Cryptography Toolkit:
> Install fast ed25519 Python package (optional, but recommended for Monero addresses):
$ sudo -H pip install pycrypto
$ sudo pip install ed25519ll
> Install the secp256k1 library:

View file

@ -8,8 +8,8 @@ the preferred way for all non-Linux users to run MMGen.***
Enter your MSYS environment, create the directory `/build` and move to it.
This is where you'll be unpacking and building archives:
$ mkdir /build
$ cd /build
$ mkdir /build
$ cd /build
If the machine you're installing on is online, you can download the various
tarballs and zipped archives you need from the Internet exactly as described in
@ -27,11 +27,11 @@ archive would thus look something like this:
Grab the v1.0.x [tarball][06] from openssl.org, unpack and build:
$ tar -xzf <path to openssl archive>/openssl-1.0.2j.tar.gz
$ cd openssl-1.0.2j
$ ./Configure mingw64 --openssldir=/usr
$ make
$ make install
$ tar -xzf <path to openssl archive>/openssl-1.0.2j.tar.gz
$ cd openssl-1.0.2j
$ ./Configure mingw64 --openssldir=/usr
$ make
$ make install
### 3. Build the Scrypt Python module:
@ -39,90 +39,119 @@ The latest scrypt tarball available from [Python][07] at this writing
(scrypt-0.8.0.tar.gz) has missing files and doesn't build, so grab the latest
[zipfile][07z] from the scrypt source repository, unzip and build:
$ cd /build
$ unzip <path to scrypt archive>/91d194b6a6bd.zip
$ cd mhallin-py-scrypt-91d194b6a6bd
$ cd /build
$ unzip <path to scrypt archive>/91d194b6a6bd.zip
$ cd mhallin-py-scrypt-91d194b6a6bd
Open the file `setup.py` in your text editor. Change the line reading
from setuptools import setup, Extension
from setuptools import setup, Extension
to read
from distutils.core import setup, Extension
from distutils.core import setup, Extension
Right before the line beginning with
scrypt_module = Extension(
scrypt_module = Extension(
add the following lines (with no indentation):
library_dirs = [r'c:\mingw64\x86_64-w4-mingw32\lib','/msys/lib']
includes = [r'c:\msys\include']
library_dirs = [r'c:\mingw64\x86_64-w4-mingw32\lib','/msys/lib']
includes = [r'c:\msys\include']
Save `setup.py`, build and install:
$ python setup.py build --compiler=mingw32
$ python setup.py install
$ python setup.py build --compiler=mingw32
$ python setup.py install
Now, to solve a problem with the interpreter not finding the scrypt extension
module, we have to do this little fixup:
$ cd /mingw/opt/lib/python2.7/site-packages
$ unzip scrypt*.egg
$ cd /mingw/opt/lib/python2.7/site-packages
$ unzip scrypt*.egg
### 4. Build the pycrypto Python module:
Download the latest pycrypto [tarball][02] from the Python website and unpack it:
$ cd /build
$ tar -xzf <path to pycrypto archive>/pycrypto-2.6.1.tar.gz
$ cd pycrypto-2.6.1
$ cd /build
$ tar -xzf <path to pycrypto archive>/pycrypto-2.6.1.tar.gz
$ cd pycrypto-2.6.1
Open the file `setup.py` in your text editor. Remove *exactly* four spaces at
the beginning of this line:
self.__remove_extensions(["CryptoPublicKey._fastmath"])
self.__remove_extensions(["CryptoPublicKey._fastmath"])
to move it one level of indentation to the left. Save the file and exit the
editor. Now build and install:
$ python setup.py build --compiler=mingw32
$ python setup.py install
$ python setup.py build --compiler=mingw32
$ python setup.py install
### 5. Install the ecdsa Python module:
Grab the latest python-ecdsa [tarball][03], unpack and build:
$ cd /build
$ tar -xzf <path to ecdsa archive>/ecdsa-0.13.tar.gz
$ cd ecdsa-0.13
$ python setup.py install
$ cd /build
$ tar -xzf <path to ecdsa archive>/ecdsa-0.13.tar.gz
$ cd ecdsa-0.13
$ python setup.py install
### 6. Install the colorama Python module:
### 6. Install the ed25519ll Python module (required for Monero address generation):
Grab the latest ed25519ll [tarball][43], unpack and build:
$ cd /build
$ tar -xzf <path to ed25519ll archive>/ed25519ll-0.6.tar.gz
$ cd ed25519ll-0.6
Open the file `setup.py` in your text editor. Change the line reading
plat_name = get_platform().replace('-', '_')
to read
plat_name = 'win64'
Exit the editor and run:
$ python setup.py install
### 7. Install the pysha3 Python module (required for Monero and Ethereum address generation):
Grab the latest pysha3 [tarball][44], unpack and build:
$ cd /build
$ tar -xzf <path to pysha3 archive>/pysha3-1.0.2.tar.gz
$ cd pysha3-1.0.2
$ python setup.py install
### 8. Install the colorama Python module:
Grab the latest colorama [tarball][14], unpack and build:
$ cd /build
$ tar -xzf <path to colorama archive>/colorama-0.3.7.tar.gz
$ cd colorama-0.3.7
$ python setup.py install
$ cd /build
$ tar -xzf <path to colorama archive>/colorama-0.3.7.tar.gz
$ cd colorama-0.3.7
$ python setup.py install
### 7. Install the pexpect Python module (needed for test suite):
### 9. Install the pexpect Python module (needed for test suite):
Grab the latest pexpect [tarball][15], unpack and build:
$ cd /build
$ tar -xzf <path to pexpect archive>/pexpect-4.2.1.tar.gz
$ cd pexpect-4.2.1
$ python setup.py install
$ cd /build
$ tar -xzf <path to pexpect archive>/pexpect-4.2.1.tar.gz
$ cd pexpect-4.2.1
$ python setup.py install
### 8. Install sdelete utility (needed for secure wallet deletion):
### 10. Install sdelete utility (needed for secure wallet deletion):
Grab the latest SDelete [zip archive][16], unzip and copy `sdelete.exe` to
your execution path (`c:\windows`, for example).
### 9. Build libsecp256k1:
### 11. Build libsecp256k1:
Libsecp256k1 requires GNU autotools to build, and they're not included in the
MinGW-64 distribution for some reason, so you'll have to retrieve and unpack
@ -134,41 +163,41 @@ them yourself. You'll need these archives:
Unpack them in your /mingw directory and fix up some filenames:
$ cd /mingw
$ tar -xzf <path to>/autoconf2.5-2.68-1-mingw32-bin.tar.lzma
$ tar -xzf <path to>/automake1.11-1.11.1-1-mingw32-bin.tar.lzma
$ tar -xzf <path to>/libtool-2.4-1-mingw32-bin.tar.lzma
$ cd bin
$ cp autoconf-* autoconf
$ cp automake-* automake
$ cp aclocal-* aclocal
$ cp autoreconf-* autoreconf
$ cd /mingw
$ tar -xzf <path to>/autoconf2.5-2.68-1-mingw32-bin.tar.lzma
$ tar -xzf <path to>/automake1.11-1.11.1-1-mingw32-bin.tar.lzma
$ tar -xzf <path to>/libtool-2.4-1-mingw32-bin.tar.lzma
$ cd bin
$ cp autoconf-* autoconf
$ cp automake-* automake
$ cp aclocal-* aclocal
$ cp autoreconf-* autoreconf
Now get the latest libsecp256k1 [zip archive][11] from GitHub, unpack, build and
install:
$ cd /build
$ unzip.exe <path to libsecp256k1 archive>/master.zip
$ cd secp256k1-master
$ ./autogen.sh
$ ./configure
$ make
$ make install
$ cd /build
$ unzip.exe <path to libsecp256k1 archive>/master.zip
$ cd secp256k1-master
$ ./autogen.sh
$ ./configure
$ make
$ make install
### 10. Install MMGen:
### 12. Install MMGen:
Get the [zip archive][10] of the latest stable version from GitHub, unpack and install:
$ cd /build
$ unzip.exe <path to mmgen archive>/stable_mswin.zip
$ cd mmgen-stable_mswin
$ python setup.py build --compiler=mingw32
$ sudo ./setup.py install
$ cd /build
$ unzip.exe <path to mmgen archive>/stable_mswin.zip
$ cd mmgen-stable_mswin
$ python setup.py build --compiler=mingw32
$ sudo ./setup.py install
After first installing and starting the [Bitcoin daemon][77], you may then run
the MMGen test suite to make sure your installation's working:
$ test/test.py -s
$ test/test.py -s
[02]: https://pypi.python.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz#md5=55a61a054aa66812daf5161a0d5d7eda
[03]: https://pypi.python.org/packages/f9/e5/99ebb176e47f150ac115ffeda5fedb6a3dbb3c00c74a59fd84ddf12f5857/ecdsa-0.13.tar.gz#md5=1f60eda9cb5c46722856db41a3ae6670
@ -185,3 +214,5 @@ the MMGen test suite to make sure your installation's working:
[32]: https://sourceforge.net/projects/mingw/files/MinGW/Extension/automake/automake1.11/automake1.11-1.11.1-1/automake1.11-1.11.1-1-mingw32-bin.tar.lzma
[33]: https://sourceforge.net/projects/mingw/files/MinGW/Extension/libtool/libtool-2.4-1/libtool-2.4-1-mingw32-bin.tar.lzma
[77]: Install-Bitcoind
[43]: https://pypi.python.org/packages/8a/34/b27ee501205893cf7cc537b4e6553a557eaaca14c4755aa1eaa500afac57/ed25519ll-0.6.tar.gz#md5=35b3190ffefb631e7c5a45d96d768f80
[44]: https://pypi.python.org/packages/73/bf/978d424ac6c9076d73b8fdc8ab8ad46f98af0c34669d736b1d83c758afee/pysha3-1.0.2.tar.gz#md5=59cd2db7a9988c1f3f6aee40145e0c96

View file

@ -27,7 +27,10 @@
* <a href='#a_rbf_onl'>With an online (hot) wallet</a>
* <a href='#a_rbf_onf'>With an offline (cold storage) wallet</a>
#### <a href='#a_alt'>Forkcoin and Altcoin support (BCH,LTC)</a>
#### <a href='#a_alt'>Forkcoin and Altcoin support</a>
* <a href='#a_bch'>Full support for Bcash (BCH) and Litecoin</a>
* <a href='#a_es'>Enhanced key/address generation support for Zcash (ZEC) and Monero (XMR)</a>
* <a href='#a_kg'>Key/address generation support for ETH, ETC and 144 Bitcoin-derived altcoins</a>
### <a name='a_i'>Preliminaries</a>
@ -67,10 +70,10 @@ options on the command line.
Sample MMGen command invocations:
$ mmgen-txcreate --help
$ mmgen-addrgen --verbose 1-10
$ mmgen-walletgen
$ mmgen-walletgen --quiet --seed-len 128
$ mmgen-txcreate --help
$ mmgen-addrgen --verbose 1-10
$ mmgen-walletgen
$ mmgen-walletgen --quiet --seed-len 128
#### <a name='a_cf'>Configuration file</a>
@ -118,9 +121,9 @@ source in all commands where a seed source is required.*
On your offline computer, generate an MMGen wallet:
$ mmgen-walletgen
...
MMGen wallet written to file '/home/username/.mmgen/89ABCDEF-76543210[256,3].mmdat'
$ mmgen-walletgen
...
MMGen wallet written to file '/home/username/.mmgen/89ABCDEF-76543210[256,3].mmdat'
‘89ABCDEF’ is the Seed ID; ‘76543210’ is the Key ID. These are randomly
generated, so your IDs will of course be different than these.
@ -146,29 +149,31 @@ printed out on paper.
Another highly recommended way to back up your wallet is to generate a mnemonic
or seed file <a href='#a_ms'>as described below </a> and memorize it. If you
have an average or better memory, you'll find memorizing your mnemonic to be
surprisingly easy.
surprisingly easy. And the peace of mind that comes with knowing that your coins
are recoverable **even if you lose all your physical backups** can't be
overestimated.
#### <a name='a_ga'>Generate addresses (offline computer)</a>
Now generate ten Segwit addresses with your just-created wallet:
$ mmgen-addrgen --type=segwit 1-10
...
Addresses written to file '89ABCDEF-S[1-10].addrs'
$ mmgen-addrgen --type=segwit 1-10
...
Addresses written to file '89ABCDEF-S[1-10].addrs'
$ cat '89ABCDEF-S[1-10].addrs'
89ABCDEF SEGWIT {
1 36bNmyYISiptuvJG3X7MPwiiS4HYvD7ksE
2 3AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc
3 3HgYCsfqYzIg7LVVfDTp7gYJocJEiDAy6N
4 34Tu3z1tiexXDonNsFIkvzqutE5E3pTK8s
5 3PeI55vtp2bX2uKDkAAR2c6ekHNYe4Hcq7
6 3FEqfEsSILwXPfMvVvVuUovzTaaST62Mnf
7 3LTTzuhMqPLwQ4IGCwwugny6ZMtUQJSJ1
8 3F9495H8EJLb54wirgZkVgI47SP7M2RQWv
9 3JbrCyt7BdxRE9GX1N7GiEct8UnIjPmpYd
10 3H7vVTk4ejUbQXw45I6g5qvPBSe9bsjDqh
}
$ cat '89ABCDEF-S[1-10].addrs'
89ABCDEF SEGWIT {
1 36bNmyYISiptuvJG3X7MPwiiS4HYvD7ksE
2 3AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc
3 3HgYCsfqYzIg7LVVfDTp7gYJocJEiDAy6N
4 34Tu3z1tiexXDonNsFIkvzqutE5E3pTK8s
5 3PeI55vtp2bX2uKDkAAR2c6ekHNYe4Hcq7
6 3FEqfEsSILwXPfMvVvVuUovzTaaST62Mnf
7 3LTTzuhMqPLwQ4IGCwwugny6ZMtUQJSJ1
8 3F9495H8EJLb54wirgZkVgI47SP7M2RQWv
9 3JbrCyt7BdxRE9GX1N7GiEct8UnIjPmpYd
10 3H7vVTk4ejUbQXw45I6g5qvPBSe9bsjDqh
}
Note that the address range ‘1-10’ specified on the command line is included in
the resulting filename.
@ -183,21 +188,21 @@ installations, and it's unlikely you'll wish to generate them. Compressed
addresses are the preferred choice for Bitcoin Cash (BCH) wallets, since Bitcoin
Cash doesn't support Segwit.
# legacy uncompressed
$ mmgen-addrgen 1-10
...
$ cat '89ABCDEF[1-10].addrs'
89ABCDEF {
1 12GiSWo9zIQgkCmjAaLIrbPwXhKry2jHhj
...
# legacy uncompressed
$ mmgen-addrgen 1-10
...
$ cat '89ABCDEF[1-10].addrs'
89ABCDEF {
1 12GiSWo9zIQgkCmjAaLIrbPwXhKry2jHhj
...
# compressed P2PKH
$ mmgen-addrgen --type=compressed 1-10
...
$ cat '89ABCDEF-C[1-10].addrs'
89ABCDEF COMPRESSED {
1 13jbRxWjswXtaDzLBJDboMcIe6nLohFb9M
...
# compressed P2PKH
$ mmgen-addrgen --type=compressed 1-10
...
$ cat '89ABCDEF-C[1-10].addrs'
89ABCDEF COMPRESSED {
1 13jbRxWjswXtaDzLBJDboMcIe6nLohFb9M
...
Note that for non-legacy address types the code letter is included in the
filename.
@ -215,27 +220,27 @@ provide the addresses with labels. We’ll use the labels ‘Donations’, ‘S
Make a copy of the address file
$ cp '89ABCDEF-S[1-10].addrs' my.addrs
$ cp '89ABCDEF-S[1-10].addrs' my.addrs
and edit it using the text editor of your choice,
$ nano my.addrs
$ nano my.addrs
adding labels to the addresses you’ve chosen to spend to:
# My first MMGen addresses
89ABCDEF SEGWIT {
1 36bNmyYISiptuvJG3X7MPwiiS4HYvD7ksE Donations
2 3AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc Storage 1
3 3HgYCsfqYzIg7LVVfDTp7gYJocJEiDAy6N Storage 2
4 34Tu3z1tiexXDonNsFIkvzqutE5E3pTK8s Storage 3
5 3PeI55vtp2bX2uKDkAAR2c6ekHNYe4Hcq7
6 3FEqfEsSILwXPfMvVvVuUovzTaaST62Mnf
7 3LTTzuhMqPLwQ4IGCwwugny6ZMtUQJSJ1
8 3F9495H8EJLb54wirgZkVgI47SP7M2RQWv
9 3JbrCyt7BdxRE9GX1N7GiEct8UnIjPmpYd
10 3H7vVTk4ejUbQXw45I6g5qvPBSe9bsjDqh
}
# My first MMGen addresses
89ABCDEF SEGWIT {
1 36bNmyYISiptuvJG3X7MPwiiS4HYvD7ksE Donations
2 3AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc Storage 1
3 3HgYCsfqYzIg7LVVfDTp7gYJocJEiDAy6N Storage 2
4 34Tu3z1tiexXDonNsFIkvzqutE5E3pTK8s Storage 3
5 3PeI55vtp2bX2uKDkAAR2c6ekHNYe4Hcq7
6 3FEqfEsSILwXPfMvVvVuUovzTaaST62Mnf
7 3LTTzuhMqPLwQ4IGCwwugny6ZMtUQJSJ1
8 3F9495H8EJLb54wirgZkVgI47SP7M2RQWv
9 3JbrCyt7BdxRE9GX1N7GiEct8UnIjPmpYd
10 3H7vVTk4ejUbQXw45I6g5qvPBSe9bsjDqh
}
Any line beginning with ‘#’ is a comment. Comments may be placed at the ends
of lines as well.
@ -249,22 +254,22 @@ existing 'wallet.dat' file out of harm’s way. Start bitcoind and let it
generate a new 'wallet.dat'; this you’ll use as your tracking wallet. Import
your ten addresses into the new tracking wallet with the command:
$ mmgen-addrimport --batch my.addrs
$ mmgen-addrimport --batch my.addrs
These addresses will now be tracked: any BTC transferred to them will show up in
your listing of address balances. Balances can be viewed using `mmgen-tool
listaddresses` (the `showempty` option requests the inclusion of addresses with
empty balances).
$ mmgen-tool listaddresses showempty=1
MMGenID ADDRESS COMMENT BALANCE
89ABCDEF:S:1 36bNmyYISiptuvJG3X7MPwiiS4HYvD7ksE Donations 0
89ABCDEF:S:2 3AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc Storage 1 0
89ABCDEF:S:3 3HgYCsfqYzIg7LVVfDTp7gYJocJEiDAy6N Storage 2 0
89ABCDEF:S:4 34Tu3z1tiexXDonNsFIkvzqutE5E3pTK8s Storage 3 0
89ABCDEF:S:5 3PeI55vtp2bX2uKDkAAR2c6ekHNYe4Hcq7 0
...
TOTAL: 0 BTC
$ mmgen-tool listaddresses showempty=1
MMGenID ADDRESS COMMENT BALANCE
89ABCDEF:S:1 36bNmyYISiptuvJG3X7MPwiiS4HYvD7ksE Donations 0
89ABCDEF:S:2 3AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc Storage 1 0
89ABCDEF:S:3 3HgYCsfqYzIg7LVVfDTp7gYJocJEiDAy6N Storage 2 0
89ABCDEF:S:4 34Tu3z1tiexXDonNsFIkvzqutE5E3pTK8s Storage 3 0
89ABCDEF:S:5 3PeI55vtp2bX2uKDkAAR2c6ekHNYe4Hcq7 0
...
TOTAL: 0 BTC
*While not covered in this introduction, note that it’s also possible to [import
ordinary Bitcoin addresses into your tracking wallet][01]. This allows you to
@ -282,13 +287,13 @@ them over the Bitcoin network. If you send 0.1, 0.2, 0.3 and 0.4 BTC
respectively, your address listing will look like this after the transactions
have confirmed:
$ mmgen-tool listaddresses
MMGenID COMMENT BALANCE
89ABCDEF:S:1 Donations 0.1
89ABCDEF:S:2 Storage 1 0.2
89ABCDEF:S:3 Storage 2 0.3
89ABCDEF:S:4 Storage 3 0.4
TOTAL: 1 BTC
$ mmgen-tool listaddresses
MMGenID COMMENT BALANCE
89ABCDEF:S:1 Donations 0.1
89ABCDEF:S:2 Storage 1 0.2
89ABCDEF:S:3 Storage 2 0.3
89ABCDEF:S:4 Storage 3 0.4
TOTAL: 1 BTC
#### <a name='a_ct'>Create a transaction (online computer)</a>
@ -303,7 +308,7 @@ To send 0.1 BTC to the a third-party address 3AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,
for example, and send the change back to yourself at address 89ABCDEF:S:5, you’d
issue the following command:
$ mmgen-txcreate 3AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 89ABCDEF:S:5
$ mmgen-txcreate 3AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 89ABCDEF:S:5
'mmgen-txcreate' accepts either MMGen IDs or Bitcoin addresses as arguments.
@ -314,7 +319,7 @@ from the MMGen ID. Thus address ‘89ABCDEF:L:5’ may be expressed as
To send 0.1 BTC to each of addresses 89ABCDEF:S:6 and 89ABCDEF:S:7 and return
the change to 89ABCDEF:S:8, you’d do this:
$ mmgen-txcreate 89ABCDEF:S:6,0.1 89ABCDEF:S:7,0.1 89ABCDEF:S:8
$ mmgen-txcreate 89ABCDEF:S:6,0.1 89ABCDEF:S:7,0.1 89ABCDEF:S:8
As you can see, each send address is followed by a comma and the amount. The
address with no amount is the change address. All addresses belonging to your
@ -330,20 +335,20 @@ criteria: transaction ID, address, amount and transaction age. Your overall
balance in BTC appears at the top of the screen. In our example, the display
will look something like this:
UNSPENT OUTPUTS (sort order: Age) Total BTC: 1
Num TX id Vout Address Amt(BTC) Age(d)
1) e9742b16... 5 3L3kxmi.. 89ABCDEF:S:1 Donations 0.1 1
2) fa84d709... 6 3N4dSGj.. 89ABCDEF:S:2 Storage 1 0.2 1
3) 8dde8ef5... 6 3M1fVDc.. 89ABCDEF:S:3 Storage 1 0.3 1
4) c76874c7... 0 3E8MFoC.. 89ABCDEF:S:4 Storage 3 0.4 1
UNSPENT OUTPUTS (sort order: Age) Total BTC: 1
Num TX id Vout Address Amt(BTC) Age(d)
1) e9742b16... 5 3L3kxmi.. 89ABCDEF:S:1 Donations 0.1 1
2) fa84d709... 6 3N4dSGj.. 89ABCDEF:S:2 Storage 1 0.2 1
3) 8dde8ef5... 6 3M1fVDc.. 89ABCDEF:S:3 Storage 1 0.3 1
4) c76874c7... 0 3E8MFoC.. 89ABCDEF:S:4 Storage 3 0.4 1
Sort options: [t]xid, [a]mount, a[d]dress, [A]ge, [r]everse, [M]mgen addr
Display options: show [D]ays, [g]roup, show [m]mgen addr, r[e]draw screen
'q'=quit view, 'p'=print to file, 'v'=pager view, 'w'=wide view, 'l'=add label:
Sort options: [t]xid, [a]mount, a[d]dress, [A]ge, [r]everse, [M]mgen addr
Display options: show [D]ays, [g]roup, show [m]mgen addr, r[e]draw screen
'q'=quit view, 'p'=print to file, 'v'=pager view, 'w'=wide view, 'l'=add label:
After quitting the menu with 'q', you’ll see the following prompt:
Enter a range or space-separated list of outputs to spend:
Enter a range or space-separated list of outputs to spend:
Here you must choose unspent outputs of sufficient value to cover the send
amount of 0.1 BTC, plus the transaction fee (for more on fees, see ‘Transaction
@ -351,7 +356,7 @@ Fees’ under ‘Advanced Topics’ below). Output #2 is worth 0.2 BTC, which i
sufficient, so we’ll choose that. After several more prompts and confirmations,
your transaction will be saved:
Transaction written to file 'FEDCBA[0.1].rawtx'
Transaction written to file 'FEDCBA[0.1].rawtx'
Note that the transaction filename consists of a unique MMGen Transaction ID
plus the non-change spend amount.
@ -364,9 +369,9 @@ and change addresses. This feature will be appreciated by privacy-conscious use
Now transfer the the raw transaction file to your offline computer and sign it
using your default wallet:
$ mmgen-txsign FEDCBA[0.1].rawtx
...
Signed transaction written to file 'FEDCBA[0.1].sigtx'
$ mmgen-txsign FEDCBA[0.1].rawtx
...
Signed transaction written to file 'FEDCBA[0.1].sigtx'
Note that the signed transaction file has a new extension, '.sigtx'.
@ -377,9 +382,9 @@ network. Start bitcoind if it's not already running, and make sure your
blockchain is fully synced. Then copy the signed transaction file to your
online computer and issue the command:
$ mmgen-txsend FEDCBA[0.1].sigtx
...
Transaction sent: abcd1234....
$ mmgen-txsend FEDCBA[0.1].sigtx
...
Transaction sent: abcd1234....
Like all MMGen commands, 'mmgen-txsend' is interactive, so you’ll be prompted
before the transaction is actually broadcast. If the send was successful, a
@ -389,13 +394,13 @@ in our case).
Once the transaction is broadcast to the network and confirmed, your address
listing should look something like this:
$ mmgen-tool listaddresses minconf=1
MMGenID COMMENT BALANCE
89ABCDEF:S:1 Donations 0.1
89ABCDEF:S:3 Storage 2 0.3
89ABCDEF:S:4 Storage 3 0.4
89ABCDEF:S:5 Storage 1 0.0999
TOTAL: 0.8999 BTC
$ mmgen-tool listaddresses minconf=1
MMGenID COMMENT BALANCE
89ABCDEF:S:1 Donations 0.1
89ABCDEF:S:3 Storage 2 0.3
89ABCDEF:S:4 Storage 3 0.4
89ABCDEF:S:5 Storage 1 0.0999
TOTAL: 0.8999 BTC
Since you’ve sent 0.1 BTC to a third party, your balance has declined by 0.1 BTC
plus the tx fee of 0.0001 BTC. To verify that your transaction’s received its
@ -410,14 +415,14 @@ of MMGen’s more advanced features, continue reading.
Using your default wallet from the exercises above, generate a mnemonic:
$ mmgen-walletconv -o words
...
Mnemonic data written to file '89ABCDEF.mmwords'
$ mmgen-walletconv -o words
...
Mnemonic data written to file '89ABCDEF.mmwords'
$ cat 89ABCDEF.mmwords
pleasure tumble spider laughter many stumble secret bother after search
float absent path strong curtain savior worst suspend bright touch away
dirty measure thorn
$ cat 89ABCDEF.mmwords
pleasure tumble spider laughter many stumble secret bother after search
float absent path strong curtain savior worst suspend bright touch away
dirty measure thorn
Since our seed is 256 bits long, the mnemonic contains 24 words. 128-bit and
192-bit seeds generate shorter mnemonics of 12 and 18 words, respectively.
@ -435,21 +440,21 @@ The mnemonic is a complete representation of your seed and may be used anywhere
where you’d use an MMGen wallet. You can generate addresses with it just as you
do with a wallet:
$ mmgen-addrgen --type=segwit 89ABCDEF.mmwords 1-10
...
Address data written to file '89ABCDEF-S[1-10].addrs'
$ mmgen-addrgen --type=segwit 89ABCDEF.mmwords 1-10
...
Address data written to file '89ABCDEF-S[1-10].addrs'
You can use it to sign transactions:
$ mmgen-txsign FEDCBA[0.1].rawtx 89ABCDEF.mmwords
...
Signed transaction written to file 'FEDCBA[0.1].sigtx'
$ mmgen-txsign FEDCBA[0.1].rawtx 89ABCDEF.mmwords
...
Signed transaction written to file 'FEDCBA[0.1].sigtx'
The mnemonic can also be used to regenerate a lost wallet:
$ mmgen-walletconv 89ABCDEF.mmwords
...
MMGen wallet written to file '89ABCDEF-01234567[256,3].mmdat'
$ mmgen-walletconv 89ABCDEF.mmwords
...
MMGen wallet written to file '89ABCDEF-01234567[256,3].mmdat'
Note that the regenerated wallet has a different Key ID but of course the same
Seed ID.
@ -458,50 +463,50 @@ An alternative to mnemonics, seed files provide yet another way of representing
your seed. They bear the extension '.mmseed' and are generated exactly the same
way as mnemonic files:
$ mmgen-walletconv -o seed
...
Seed data written to file '89ABCDEF.mmseed'
$ mmgen-walletconv -o seed
...
Seed data written to file '89ABCDEF.mmseed'
They can be used just like mnemonics to regenerate a wallet:
$ mmgen-walletconv 89ABCDEF.mmseed
...
MMGen wallet written to file '89ABCDEF-23456701[256,3].mmdat'
$ mmgen-walletconv 89ABCDEF.mmseed
...
MMGen wallet written to file '89ABCDEF-23456701[256,3].mmdat'
Here’s a sample seed file for a 256-bit seed:
$ cat 8B7392ED.mmseed
f4c84b C5ZT wWpT Jsoi wRVw 2dm9 Aftd WLb8 FggQ eC8h Szjd da9L
$ cat 8B7392ED.mmseed
f4c84b C5ZT wWpT Jsoi wRVw 2dm9 Aftd WLb8 FggQ eC8h Szjd da9L
And for a 128-bit seed:
$ cat 8E0DFB78.mmseed
0fe02f XnyC NfPH piuW dQ2d nM47 VU
$ cat 8E0DFB78.mmseed
0fe02f XnyC NfPH piuW dQ2d nM47 VU
As you can see, seed files are short enough to be easily written out by hand or
memorized. And their built-in checksum makes it easy to test your memory using
a simple Unix shell command:
$ echo -n XnyC NfPH piuW dQ2d nM47 VU | tr -d ' '| sha256sum | cut -c 1-6
0fe02f
$ echo -n XnyC NfPH piuW dQ2d nM47 VU | tr -d ' '| sha256sum | cut -c 1-6
0fe02f
Or you can do the same thing with 'mmgen-tool':
$ mmgen-tool str2id6 'XnyC NfPH piuW dQ2d nM47 VU'
0fe02f
$ mmgen-tool str2id6 'XnyC NfPH piuW dQ2d nM47 VU'
0fe02f
Beginning with version 0.9.0, MMGen also supports seed files in hexadecimal
(hexseed) format. Hexseed files are identical to seed files but encoded in
hexadecimal rather than base 58. They bear the extension '.mmhex':
$ cat FE3C6545.mmhex
afc3fe 456d 7f5f 1c4b fe3b c916 b875 60ae 6a3e
$ cat FE3C6545.mmhex
afc3fe 456d 7f5f 1c4b fe3b c916 b875 60ae 6a3e
You can easily check that a hexseed is correct by generating its Seed ID with
standard command-line tools:
$ echo 456d 7f5f 1c4b fe3b c916 b875 60ae 6a3e | tr -d ' ' | xxd -r -p | sha256sum -b | xxd -r -p | sha256sum -b | cut -c 1-8
fe3c6545
$ echo 456d 7f5f 1c4b fe3b c916 b875 60ae 6a3e | tr -d ' ' | xxd -r -p | sha256sum -b | xxd -r -p | sha256sum -b | cut -c 1-8
fe3c6545
Mnemonics and hexseeds can be used to generate keys even without the MMGen
software, using basic command-line utilities, as explained in [this
@ -513,12 +518,12 @@ All MMGen commands that take mnemonic, seed or hexseed data may receive the data
from a prompt instead of a file. Just omit the file name and specify the input
format:
$ mmgen-addrgen -i words 1-10
...
Choose a mnemonic length: 1) 12 words, 2) 18 words, 3) 24 words: 1
Mnemonic length of 12 words chosen. OK? (Y/n): y
Enter your 12-word mnemonic, hitting RETURN or SPACE after each word:
Enter word #1:
$ mmgen-addrgen -i words 1-10
...
Choose a mnemonic length: 1) 12 words, 2) 18 words, 3) 24 words: 1
Mnemonic length of 12 words chosen. OK? (Y/n): y
Enter your 12-word mnemonic, hitting RETURN or SPACE after each word:
Enter word #1:
MMGen prompts you for each of the mnemonic's words individually, checking it for
validity and reprompting if necessary. What you type is not displayed on the
@ -557,28 +562,28 @@ If you plan to store your incognito wallet in an insecure location such as cloud
storage, you’re advised to use a strong scrypt (hash) preset and a strong
password. These can be changed using the 'mmgen-passchg' utility:
$ mmgen-passchg -p 5 89ABCDEF-01234567[256,3].mmdat
...
Hash preset of wallet: '3'
Enter old passphrase for MMGen wallet: <old weak passphrase>
...
Hash preset changed to '5'
Enter new passphrase for MMGen wallet: <new strong passphrase>
...
MMGen wallet written to file '89ABCDEF-87654321[256,5].mmdat'
$ mmgen-passchg -p 5 89ABCDEF-01234567[256,3].mmdat
...
Hash preset of wallet: '3'
Enter old passphrase for MMGen wallet: <old weak passphrase>
...
Hash preset changed to '5'
Enter new passphrase for MMGen wallet: <new strong passphrase>
...
MMGen wallet written to file '89ABCDEF-87654321[256,5].mmdat'
The scrypt preset is the numeral in the wallet filename following the seed
length. As you can see, it’s now changed to '5'. Now export your new toughened
wallet to incognito format, using the `-k` option to leave the passphrase
unchanged:
$ mmgen-walletconv -k -o incog 89ABCDEF-87654321[256,5].mmdat
...
Reusing passphrase at user request
...
New Incog Wallet ID: ECA86420
...
Incognito data written to file '89ABCDEF-87654321-ECA86420[256,5].mmincog'
$ mmgen-walletconv -k -o incog 89ABCDEF-87654321[256,5].mmdat
...
Reusing passphrase at user request
...
New Incog Wallet ID: ECA86420
...
Incognito data written to file '89ABCDEF-87654321-ECA86420[256,5].mmincog'
Incog wallets have a special identifier, the Incog ID, which can be used to
locate the wallet data if you’ve forgotten where you hid it (see the example
@ -587,15 +592,15 @@ should be kept secret.
Incog wallets can also be output to hexadecimal format:
$ mmgen-walletconv -k -o incox 89ABCDEF-87654321[256,5].mmdat
...
Hex incognito data written to file '89ABCDEF-87654321-CA86420E[256,5].mmincox'
$ mmgen-walletconv -k -o incox 89ABCDEF-87654321[256,5].mmdat
...
Hex incognito data written to file '89ABCDEF-87654321-CA86420E[256,5].mmincox'
$ cat 89ABCDEF-87654321-1EE402F4[256,5].mmincox
6772 edb2 10cf ad0d c7dd 484b cc7e 42e9
4fe6 e07a 1ce2 da02 6da7 94e4 c068 57a8
3706 c5ce 56e0 7590 e677 6c6e 750a d057
b43a 21f9 82c7 6bd1 fe96 bad9 2d54 c4c0
$ cat 89ABCDEF-87654321-1EE402F4[256,5].mmincox
6772 edb2 10cf ad0d c7dd 484b cc7e 42e9
4fe6 e07a 1ce2 da02 6da7 94e4 c068 57a8
3706 c5ce 56e0 7590 e677 6c6e 750a d057
b43a 21f9 82c7 6bd1 fe96 bad9 2d54 c4c0
Note that the Incog ID is different here: it’s generated from an init vector,
which is a different random number each time, making the incog data as a whole
@ -608,14 +613,14 @@ the wrong hands.
Your incognito wallet (whether hex or binary) can be used just like any other
MMGen wallet, mnemonic or seed file to generate addresses and sign transactions:
$ mmgen-addrgen --type=segwit 89ABCDEF-87654321-CA86420E[256,5].mmincox 101-110
...
Generated 10 addresses
Addresses written to file '89ABCDEF-S[101-110].addrs'
$ mmgen-addrgen --type=segwit 89ABCDEF-87654321-CA86420E[256,5].mmincox 101-110
...
Generated 10 addresses
Addresses written to file '89ABCDEF-S[101-110].addrs'
$ mmgen-txsign FABCDE[0.3].rawtx 89ABCDEF-87654321-CA86420E[256,5].mmincox
...
Signed transaction written to file FABCDE[0.3].sigtx
$ mmgen-txsign FABCDE[0.3].rawtx 89ABCDEF-87654321-CA86420E[256,5].mmincox
...
Signed transaction written to file FABCDE[0.3].sigtx
##### <a name='a_hi'>Hidden incognito wallets</a>
@ -624,14 +629,14 @@ a specified offset in a file or partition in a single convenient operation, with
the random file being created automatically if necessary. Here’s how you’d
create a 1GB file 'random.dat' and hide a wallet in it at offset 123456789:
$ mmgen-walletconv -k -o hincog -J random.dat,123456789 89ABCDEF-87654321[256,5].mmdat
...
New Incog Wallet ID: ED1F2ACB
...
Requested file 'random.dat' does not exist. Create? (Y/n): Y
Enter file size: 1G
...
Data written to file 'random.dat' at offset 123456789
$ mmgen-walletconv -k -o hincog -J random.dat,123456789 89ABCDEF-87654321[256,5].mmdat
...
New Incog Wallet ID: ED1F2ACB
...
Requested file 'random.dat' does not exist. Create? (Y/n): Y
Enter file size: 1G
...
Data written to file 'random.dat' at offset 123456789
Your ‘random’ file can now be uploaded to a cloud storage service, for example,
or some other location on the Net, preferably non-public one (in a real-life
@ -642,9 +647,9 @@ Now let’s say at some point in the future you download this file to recover
your wallet and realize you’ve forgotten the offset where the data is hidden.
If you’ve saved your Incog ID, you’re in luck:
$ mmgen-tool find_incog_data random.dat ED1F2ACB
...
Incog data for ID ED1F2ACB found at offset 123456789
$ mmgen-tool find_incog_data random.dat ED1F2ACB
...
Incog data for ID ED1F2ACB found at offset 123456789
The search process can be slow, so patience is required. In addition, on
large files ‘false positives’ are a distinct possibility, in which case you’ll
@ -654,13 +659,13 @@ real offset.
Hidden incog wallets are nearly as convenient to use as ordinary ones.
Generating ten addresses with your hidden incog data is as easy as this:
$ mmgen-addrgen -H random.dat,123456789 101-110
$ mmgen-addrgen -H random.dat,123456789 101-110
Transaction signing uses the same syntax:
$ mmgen-txsign -H random.dat,123456789 ABCDEF[0.1].rawtx
...
Signed transaction written to file 'ABCDEF[0.1].sigtx'
$ mmgen-txsign -H random.dat,123456789 ABCDEF[0.1].rawtx
...
Signed transaction written to file 'ABCDEF[0.1].sigtx'
### <a name='a_at'>Advanced Topics</a>
@ -692,9 +697,9 @@ well as addresses, thus functioning as a hot wallet for a range of addresses.
Assuming your hot address range begins at 1001, you could start by creating a
key-address file for a hundred hot addresses like this:
$ mmgen-keygen --type=segwit 1001-1100
...
Secret keys written to file '89ABCDEF-S[1001-1100].akeys.mmenc'
$ mmgen-keygen --type=segwit 1001-1100
...
Secret keys written to file '89ABCDEF-S[1001-1100].akeys.mmenc'
`mmgen-keygen` prompts you for a password to encrypt the key-address file with.
This is a wise precaution, as it provides at least some security for keys that
@ -703,14 +708,14 @@ will be stored on an online machine.
Now copy the key-address file to your online machine and import the addresses
into your tracking wallet:
$ mmgen-addrimport --batch --keyaddr-file '89ABCDEF-S[1001-1100].akeys.mmenc'
$ mmgen-addrimport --batch --keyaddr-file '89ABCDEF-S[1001-1100].akeys.mmenc'
After funding your hot wallet by spending into some addresses in this range you
can do quickie transactions with these funds using the `mmgen-txdo` command:
$ mmgen-txdo -M '89ABCDEF-S[1001-1100].akeys.mmenc' 1AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 89ABCDEF:S:1010
...
Transaction sent: dcea1357....
$ mmgen-txdo -M '89ABCDEF-S[1001-1100].akeys.mmenc' 1AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 89ABCDEF:S:1010
...
Transaction sent: dcea1357....
The `--mmgen-keys-from-file` or `-M` option is required when using a key-address
file in place of a default wallet. Note that your change address
@ -721,7 +726,7 @@ Using `mmgen-txdo` with a default online hot wallet is even simpler. For a hot
wallet with Seed ID 0FDE89AB, for instance, creating and sending a transaction
would look like this:
$ mmgen-txdo 1AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 0FDE89AB:S:10
$ mmgen-txdo 1AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 0FDE89AB:S:10
#### <a name='a_fee'>Transaction Fees</a>
@ -773,11 +778,11 @@ incrementally increasing fees will created online and then signed offline.
Create, sign and send a BIP 125 replaceable transaction with a fee of 50
satoshis per byte:
$ mmgen-txdo --rbf --tx-fee 50s 1AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 0FDE89AB:S:5
...
Signed transaction written to file 'FEDCBB[0.1,50].sigtx'
...
Transaction sent: dcba4321....
$ mmgen-txdo --rbf --tx-fee 50s 1AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 0FDE89AB:S:5
...
Signed transaction written to file 'FEDCBB[0.1,50].sigtx'
...
Transaction sent: dcba4321....
Here you've sent 0.1 BTC to a third-party address and the change back to
yourself at address #5 of your default hot wallet with Seed ID 0FDE89AB.
@ -788,11 +793,11 @@ of the fee in the filename identifies the transaction as replaceable.
If the transaction fails to confirm in your desired timeframe, then create, sign
and send a replacement transaction with a higher fee, say 100 satoshis per byte:
$ mmgen-txbump --send --tx-fee 100s --output-to-reduce c 'FEDCBB[0.1,50].sigtx'
...
Signed transaction written to file 'DAE123[0.1,100].sigtx'
...
Transaction sent: eef01357....
$ mmgen-txbump --send --tx-fee 100s --output-to-reduce c 'FEDCBB[0.1,50].sigtx'
...
Signed transaction written to file 'DAE123[0.1,100].sigtx'
...
Transaction sent: eef01357....
The `--send` switch instructs `mmgen-txbump` to sign and send the transaction
after creating it. The `--output-to-reduce` switch with an argument of 'c'
@ -815,44 +820,48 @@ you'll need to supply it on the command line as a parameter to the `-M` option.
To achieve the same result as in the above example using a cold wallet, just
create the initial transaction with `mmgen-txcreate` instead of `mmgen-txdo`:
$ mmgen-txcreate --rbf --tx-fee 50s 1AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 89ABCDEF:S:5
...
Transaction written to file 'FEDCBC[0.1,50].rawtx'
$ mmgen-txcreate --rbf --tx-fee 50s 1AmkUxrfy5dMrfmeYwTxLxfIswUCcpeysc,0.1 89ABCDEF:S:5
...
Transaction written to file 'FEDCBC[0.1,50].rawtx'
Now create a series of transactions with incrementally increasing fees for
offline signing:
$ mmgen-txbump --tx-fee 100s --output-to-reduce c 'FEDCBC[0.1,50].rawtx'
$ mmgen-txbump --tx-fee 150s --output-to-reduce c 'FEDCBC[0.1,50].rawtx'
$ mmgen-txbump --tx-fee 200s --output-to-reduce c 'FEDCBC[0.1,50].rawtx'
$ mmgen-txbump --tx-fee 100s --output-to-reduce c 'FEDCBC[0.1,50].rawtx'
$ mmgen-txbump --tx-fee 150s --output-to-reduce c 'FEDCBC[0.1,50].rawtx'
$ mmgen-txbump --tx-fee 200s --output-to-reduce c 'FEDCBC[0.1,50].rawtx'
To speed things up, add the `--yes` switch to make `mmgen-txbump` completely
non-interactive.
The result will be four raw transaction files with increasing fees, like this:
FEDCBC[0.1,50].rawtx
3EBB00[0.1,100].rawtx
124FFF[0.1,150].rawtx
73DABB[0.1,200].rawtx
FEDCBC[0.1,50].rawtx
3EBB00[0.1,100].rawtx
124FFF[0.1,150].rawtx
73DABB[0.1,200].rawtx
Copy the files to an empty folder, transfer the folder to your offline machine and batch sign them:
$ mmgen-txsign -d my_folder --yes my_folder/*.rawtx
$ mmgen-txsign -d my_folder --yes my_folder/*.rawtx
Then copy the signed transaction files back to your online machine and broadcast
them in turn until you get a confirmation:
$ mmgen-txsend FEDCBC[0.1,50].sigtx # ...if this doesn't confirm, then
$ mmgen-txsend 3EBB00[0.1,100].sigtx # ...if this doesn't confirm, then
$ mmgen-txsend 124FFF[0.1,150].sigtx # ...if this doesn't confirm, then
$ mmgen-txsend 73DABB[0.1,200].sigtx
$ mmgen-txsend FEDCBC[0.1,50].sigtx # ...if this doesn't confirm, then
$ mmgen-txsend 3EBB00[0.1,100].sigtx # ...if this doesn't confirm, then
$ mmgen-txsend 124FFF[0.1,150].sigtx # ...if this doesn't confirm, then
$ mmgen-txsend 73DABB[0.1,200].sigtx
### <a name='a_alt'>Forkcoin and Altcoin support (BCH,LTC)</a>
### <a name='a_alt'>Forkcoin and Altcoin support</a>
To use MMGen with Bitcoin Cash (BCH) or Litecoin (LTC), first make sure the
Bitcoin ABC or Litecoin daemon is properly installed
([source][si])([binaries][bi]), [running][p8] and synced.
#### <a name='a_bch'>Full support for Bcash (BCH) and Litecoin</a>
Bcash and Litecoin are fully supported by MMGen, on the same level as Bitcoin.
To use MMGen with Bcash or Litecoin, first make sure the respective Bitcoin ABC
and Litecoin daemons are properly installed ([source][si])([binaries][bi]),
[running][p8] and synced.
MMGen requires that the bitcoin-abc daemon be listening on non-standard
[RPC port 8442][p8].
@ -860,6 +869,84 @@ MMGen requires that the bitcoin-abc daemon be listening on non-standard
Then just add the `--coin=bch` or `--coin=ltc` option to all your MMGen
commands. It's that simple!
#### <a name='a_es'>Enhanced key/address generation support for Zcash (ZEC) and Monero (XMR)</a>
MMGen's enhanced key/address generation support for Zcash and Monero includes
**Zcash z-addresses** and automated Monero wallet creation.
Generate ten Zcash z-address key/address pairs from your default wallet:
$ mmgen-keygen --coin=zec --type=zcash_z 1-10
The addresses' view keys are included in the file as well.
NOTE: Since your key/address file will probably be used on an online computer,
you should encrypt it with a good password when prompted to do so. The file can
decrypted as required using the `mmgen-tool decrypt` command. If you choose a
non-standard Scrypt hash preset, take care to remember it.
To generate Zcash t-addresses, just omit the `--type` argument:
$ mmgen-keygen --coin=zec 1-10
Generate ten Monero address pairs from your default wallet:
$ mmgen-keygen --coin=xmr 1-10
In addition to spend and view keys, Monero key/address files also include a
wallet password for each address (the password is the double Sha256 of the spend
key, truncated to 16 bytes). This allows you to easily generate wallets for
each address by running the following command
$ monero-wallet-cli --generate-from-spend-key MyMoneroWallet
and pasting in the key and password data when prompted. Monerod must be
running and `monero-wallet-cli` be located in your executable path.
This process is completely automated by the `mmgen-tool` utility:
$ mmgen-tool keyaddrlist2monerowallet *XMR*.akeys.mmenc
This will generate Monero wallets for each key/address pair in the key/address
file and encrypt them with their respective passwords. No user interaction is
required. By default, wallets are synced to the current block height, as
they're assumed to be empty. This behavior can be overridden:
$ mmgen-tool keyaddrlist2monerowallet *XMR*.akeys.mmenc blockheight=123456
#### <a name='a_kg'>Key/address generation support for ETH, ETC and 144 Bitcoin-derived altcoins</a>
To generate key/address pairs for these coins, just specify the coin's symbol
with the `--coin` argument:
# For DASH:
$ mmgen-keygen --coin=dash 1-10
# For Emercoin:
$ mmgen-keygen --coin=emc 1-10
If it's just the addresses you want, then use `mmgen-addrgen` instead:
$ mmgen-addrgen --coin=dash 1-10
Regarding encryption of key/address files, see the note for Zcash above.
Here's a complete list of supported altcoins as of this writing:
2give,42,611,ac,acoin,alf,anc,apex,arco,arg,aur,bcf,blk,bmc,bqc,bsty,btcd,
btq,bucks,cann,cash,cat,cbx,ccn,cdn,chc,clam,con,cpc,crps,csh,dash,dcr,dfc,
dgb,dgc,doge,doged,dope,dvc,efl,emc,emd,enrg,esp,fai,fc2,fibre,fjc,flo,flt,
fst,ftc,gcr,good,grc,gun,ham,html5,hyp,icash,infx,inpay,ipc,jbs,judge,lana,
lat,ldoge,lmc,ltc,mars,mcar,mec,mint,mobi,mona,moon,mrs,mue,mxt,myr,myriad,
mzc,neos,neva,nka,nlg,nmc,nto,nvc,ok,omc,omni,onion,onx,part,pink,pivx,pkb,
pnd,pot,ppc,ptc,pxc,qrk,rain,rbt,rby,rdd,ric,sdc,sib,smly,song,spr,start,
sys,taj,tit,tpc,trc,ttc,tx,uno,via,vpn,vtc,wash,wdc,wisc,wkc,wsx,xcn,xgb,
xmg,xpm,xpoke,xred,xst,xvc,zet,zlq,zoom,zrc,bch,etc,eth,ltc,xmr,zec
Note that support for these coins is EXPERIMENTAL. Many of them have received
only minimal testing, or no testing at all. At startup you'll be informed of
the level of your selected coin's support reliability as deemed by the MMGen
Project.
[01]: https://github.com/mmgen/mmgen/wiki/Tracking-and-spending-ordinary-Bitcoin-addresses
[02]: https://tpfaucet.appspot.com
[03]: Recovering-Your-Keys-Without-the-MMGen-Software

View file

@ -1,6 +1,6 @@
/*
mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -92,6 +92,8 @@ class AddrGeneratorZcashZ(AddrGenerator):
def to_addr(self,pubhex): # pubhex is really privhex
key = pubhex.decode('hex')
assert len(key) == 32,'{}: incorrect privkey length'.format(len(key))
if g.platform == 'win':
ydie(1,'Zcash z-addresses not supported on Windows platform')
from nacl.bindings import crypto_scalarmult_base
p2 = crypto_scalarmult_base(self.zhash256(key,1))
from mmgen.protocol import _b58chk_encode

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -38,16 +38,16 @@ class g(object):
# Constants:
version = '0.9.599'
release_date = 'December 2017'
version = '0.9.6'
release_date = 'January 2018'
proj_name = 'MMGen'
proj_url = 'https://github.com/mmgen/mmgen'
prog_name = os.path.basename(sys.argv[0])
author = 'The MMGen Project'
email = '<mmgen@tuta.io>'
Cdates = '2013-2017'
keywords = 'Bitcoin, BTC, cryptocurrency, wallet, cold storage, offline, online, spending, open-source, command-line, Python, Linux, Bitcoin Core, bitcoind, hd, deterministic, hierarchical, secure, anonymous, Electrum, seed, mnemonic, brainwallet, Scrypt, utility, script, scriptable, blockchain, raw, transaction, permissionless, console, terminal, curses, ansi, color, tmux, remote, client, daemon, RPC, json, entropy, xterm, rxvt, PowerShell, MSYS, MinGW, mswin, Armbian, Raspbian, Raspberry Pi, Orange Pi, BCash, BCH, Litecoin, LTC, altcoin, ZEC, Zcash, DASH, ETH, Ethereum, Classic, SHA256Compress'
Cdates = '2013-2018'
keywords = 'Bitcoin, BTC, cryptocurrency, wallet, cold storage, offline, online, spending, open-source, command-line, Python, Linux, Bitcoin Core, bitcoind, hd, deterministic, hierarchical, secure, anonymous, Electrum, seed, mnemonic, brainwallet, Scrypt, utility, script, scriptable, blockchain, raw, transaction, permissionless, console, terminal, curses, ansi, color, tmux, remote, client, daemon, RPC, json, entropy, xterm, rxvt, PowerShell, MSYS, MinGW, mswin, Armbian, Raspbian, Raspberry Pi, Orange Pi, BCash, BCH, Litecoin, LTC, altcoin, ZEC, Zcash, DASH, Dashpay, ETH, Ethereum, Classic, SHA256Compress, XMR, Monero, EMC, Emercoin'
max_int = 0xffffffff
stdin_tty = bool(sys.stdin.isatty() or os.getenv('MMGEN_TEST_SUITE'))
http_timeout = 60
@ -169,9 +169,8 @@ class g(object):
key_generator = 2 # secp256k1 is default
hash_presets = {
# Scrypt params:
# ID N p r
# N is a power of two
# Scrypt params:
# ID N p r (N is an exponent of two)
'1': [12, 8, 1],
'2': [13, 8, 4],
'3': [14, 8, 8],

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -364,7 +364,7 @@ class CoinAddr(str,Hilite,InitErrors,MMGenObject):
cls.arg_chk(cls,on_fail)
from mmgen.globalvars import g
try:
assert set(s) <= set(ascii_letters+digits),'contains non-ascii characters'
assert set(s) <= set(ascii_letters+digits),'contains non-alphanumeric characters'
me = str.__new__(cls,s)
va = g.proto.verify_addr(s,hex_width=cls.hex_width,return_dict=True)
assert va,'failed verification'
@ -479,7 +479,7 @@ class TwMMGenID(str,Hilite,InitErrors,MMGenObject):
from mmgen.globalvars import g
assert s.split(':',1)[0] == g.proto.base_coin.lower(),(
"not a string beginning with the prefix '{}:'".format(g.proto.base_coin.lower()))
assert set(s[4:]) <= set(ascii_letters+digits),'contains non-ascii characters'
assert set(s[4:]) <= set(ascii_letters+digits),'contains non-alphanumeric characters'
assert len(s) > 4,'not more that four characters long'
ret,sort_key,idtype = str(s),'z_'+s,'non-mmgen'
except Exception as f:

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# MMGen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -382,7 +382,7 @@ class CoinProtocol(MMGenObject):
'eth': (EthereumProtocol,EthereumTestnetProtocol,2),
'etc': (EthereumClassicProtocol,EthereumClassicTestnetProtocol,2),
'zec': (ZcashProtocol,ZcashTestnetProtocol,2),
'xmr': (MoneroProtocol,MoneroTestnetProtocol,2)
'xmr': (MoneroProtocol,MoneroTestnetProtocol,None)
}
def __new__(cls,coin,testnet):
coin = coin.lower()

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -34,21 +34,23 @@ rpc_password = 'hodltothemoon'
tr_wallet = lambda user: os.path.join(daemon_dir,'wallet.dat.'+user)
common_args = lambda: (
'-rpcuser={}'.format(rpc_user),
'-rpcpassword={}'.format(rpc_password),
'-rpcport={}'.format(rpc_port),
'-regtest',
'-datadir={}'.format(data_dir))
'--rpcuser={}'.format(rpc_user),
'--rpcpassword={}'.format(rpc_password),
'--rpcport={}'.format(rpc_port),
'--regtest',
'--datadir={}'.format(data_dir))
def start_daemon(user,quiet=False,daemon=True,reindex=False):
# requires Bitcoin ABC version >= 0.16.2
add_args = ((),('--usecashaddr=0',))[g.proto.daemon_name=='bitcoind-abc']
cmd = (
g.proto.daemon_name,
'-listen=0',
'-keypool=1',
'-wallet={}'.format(os.path.basename(tr_wallet(user)))
) + common_args()
if daemon: cmd += ('-daemon',)
if reindex: cmd += ('-reindex',)
'--listen=0',
'--keypool=1',
'--wallet={}'.format(os.path.basename(tr_wallet(user)))
) + add_args + common_args()
if daemon: cmd += ('--daemon',)
if reindex: cmd += ('--reindex',)
if not g.debug or quiet: vmsg('{}'.format(' '.join(cmd)))
p = subprocess.Popen(cmd,stdout=PIPE,stderr=PIPE)
err = process_output(p,silent=False)[1]
@ -239,7 +241,7 @@ def get_current_user_win(quiet=False):
return None
def get_current_user_unix(quiet=False):
p = start_cmd('pgrep','-af','{}.*-rpcport={}.*'.format(g.proto.daemon_name,rpc_port))
p = start_cmd('pgrep','-af','{}.*--rpcport={}.*'.format(g.proto.daemon_name,rpc_port))
cmdline = p.stdout.read()
if not cmdline: return None
for k in ('miner','bob','alice'):

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -2,7 +2,7 @@
# -*- coding: UTF-8 -*-
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -107,7 +107,8 @@ s_alts='The following tests will test generation operations for all supported al
ROUNDS=100
ROUNDS_LOW=20
ROUNDS_SPEC=500
t_alts=(
if [ "$MINGW" ]; then
t_alts=(
'test/scrambletest.py'
'test/test.py -n altcoin_ref'
"test/gentest.py --coin=btc 2 $ROUNDS"
@ -118,8 +119,21 @@ t_alts=(
"test/gentest.py --coin=ltc --type=segwit 2 $ROUNDS"
"test/gentest.py --coin=zec 2 $ROUNDS"
"test/gentest.py --coin=etc 2 $ROUNDS"
"test/gentest.py --coin=eth 2 $ROUNDS"
"test/gentest.py --coin=eth 2 $ROUNDS")
else
t_alts=(
'test/scrambletest.py'
'test/test.py -n altcoin_ref'
"test/gentest.py --coin=btc 2 $ROUNDS"
"test/gentest.py --coin=btc --type=compressed 2 $ROUNDS"
"test/gentest.py --coin=btc --type=segwit 2 $ROUNDS"
"test/gentest.py --coin=ltc 2 $ROUNDS"
"test/gentest.py --coin=ltc --type=compressed 2 $ROUNDS"
"test/gentest.py --coin=ltc --type=segwit 2 $ROUNDS"
"test/gentest.py --coin=zec 2 $ROUNDS"
"test/gentest.py --coin=zec --type=zcash_z 2 $ROUNDS_SPEC"
"test/gentest.py --coin=etc 2 $ROUNDS"
"test/gentest.py --coin=eth 2 $ROUNDS"
"test/gentest.py --coin=btc 2:ext $ROUNDS"
"test/gentest.py --coin=btc --type=compressed 2:ext $ROUNDS"
@ -136,7 +150,7 @@ t_alts=(
"test/gentest.py --all 2:pyethereum $ROUNDS_LOW"
"test/gentest.py --all 2:keyconv $ROUNDS_LOW"
"test/gentest.py --all 2:zcash_mini $ROUNDS_LOW")
fi
f_alts='Gen-only altcoin tests completed'
i_monero='Monero'
@ -144,8 +158,9 @@ s_monero='Testing generation and wallet creation operations for Monero'
s_monero='The monerod (mainnet) daemon must be running for the following tests'
ROUNDS=1000
t_monero=(
'cmds/mmgen-keygen --accept-defaults --outdir $TMPDIR --coin=xmr test/ref/98831F3A.mmwords 3,99,2,22-29,101-109'
'cmds/mmgen-tool -q --accept-defaults --outdir $TMPDIR keyaddrlist2monerowallet $TMPDIR/988*XMR*akeys')
'python cmds/mmgen-keygen --accept-defaults --outdir $TMPDIR --coin=xmr test/ref/98831F3A.mmwords 3,99,2,22-29,101-109'
'python cmds/mmgen-tool -q --accept-defaults --outdir $TMPDIR keyaddrlist2monerowallet $TMPDIR/988*XMR*akeys')
[ "$MINGW" ] && t_monero=("$t_monero")
f_monero='Monero tests completed'
i_misc_ni='Miscellaneous operations (non-interactive)'
@ -243,8 +258,12 @@ t_tool=(
'test/tooltest.py --coin=dash cryptocoin'
'test/tooltest.py --coin=doge cryptocoin'
'test/tooltest.py --coin=emc cryptocoin'
'test/tooltest.py --coin=zec cryptocoin'
'test/tooltest.py --coin=zec --type=zcash_z cryptocoin')
'test/tooltest.py --coin=zec cryptocoin')
[ "$MINGW" ] || {
t_tool_len=${#t_tool[*]}
t_tool[$t_tool_len]='test/tooltest.py --coin=zec --type=zcash_z cryptocoin'
}
f_tool='tooltest tests completed'
i_gen='Gentest'

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -2,7 +2,7 @@
# -*- coding: UTF-8 -*-
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -74,12 +74,15 @@ test_data = OrderedDict([
def run_tests():
for test in test_data:
if test == 'zec_zcash_z' and g.platform == 'win':
msg("Skipping 'zec_zcash_z' test for Windows platform")
continue
try: coin,mmtype = test.split('_',1)
except: coin,mmtype = test,None
cmd_name = 'cmds/mmgen-addrgen'
wf = 'test/ref/98831F3A.mmwords'
type_arg = ['--type='+mmtype] if mmtype else []
cmd = [cmd_name,'-qS','--coin='+coin] + type_arg + [wf,'1']
cmd = ['python',cmd_name,'-qS','--coin='+coin] + type_arg + [wf,'1']
vmsg(green('Executing: {}'.format(' '.join(cmd))))
msg_r('Testing: --coin {:4} {:22}'.format(coin.upper(),type_arg[0] if type_arg else ''))
p = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -1251,6 +1251,15 @@ def clean(usr_dirs=[]):
die(1,'%s: invalid directory number' % d)
cleandir(os.path.join('test','data_dir'))
def skip_for_win():
if g.platform == 'win':
import traceback
f = traceback.extract_stack()[-2][-2]
msg("Skipping test '{}': not supported on Windows platform".format(f))
return True
else:
return False
class MMGenTestSuite(object):
def __init__(self):
@ -1897,8 +1906,7 @@ class MMGenTestSuite(object):
# Miscellaneous tests
def autosign(self,name): # tests everything except device detection, mount/unmount
if g.platform == 'win':
msg('Skipping {} (not supported)'.format(name)); return
if skip_for_win(): return
fdata = (('btc',''),('bch',''),('ltc','litecoin'))
tfns = [cfgs['8']['ref_tx_file'][c].format('') for c,d in fdata]
tfs = [os.path.join(ref_dir,d[1],fn) for d,fn in zip(fdata,tfns)]
@ -2070,6 +2078,7 @@ class MMGenTestSuite(object):
self.ref_addrfile_chk(name,ftype='addr',coin='ZEC',subdir='zcash',pfx='-ZEC-C')
def ref_addrfile_chk_zec_z(self,name):
if skip_for_win(): return
self.ref_addrfile_chk(name,ftype='addr',coin='ZEC',subdir='zcash',pfx='-ZEC-Z',
mmtype='z',add_args=['mmtype=zcash_z'])
@ -2089,6 +2098,7 @@ class MMGenTestSuite(object):
self.ref_addrfile_chk(name,ftype='keyaddr',coin='ZEC',subdir='zcash',pfx='-ZEC-C')
def ref_keyaddrfile_chk_zec_z(self,name):
if skip_for_win(): return
self.ref_addrfile_chk(name,ftype='keyaddr',coin='ZEC',subdir='zcash',pfx='-ZEC-Z',
mmtype='z',add_args=['mmtype=zcash_z'])

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2017 Philemon <mmgen-py@yandex.com>
# Copyright (C)2013-2018 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by