Version 0.8.9rc1

This commit is contained in:
philemon 2016-12-08 18:02:28 +03:00
commit 229845c8b6
Signed by untrusted user who does not match committer: mmgen
GPG key ID: 62DBE9E5212F05BE
14 changed files with 313 additions and 221 deletions

View file

@ -1,59 +1,68 @@
#### Note: ## Installing the Bitcoin daemon
> The bitcoin daemon on the **offline computer** is used solely to sign The bitcoin daemon on the **offline computer** is used solely to sign
> transactions and runs without a blockchain. Thus even a low-powered computer transactions and runs without a blockchain. Thus even a low-powered computer
> such as a netbook will suffice as your offline machine. such as a netbook will suffice as your offline machine.
>
> The bitcoin daemon on the **online computer** requires a complete and
> up-to-date blockchain for tracking addresses. Since its work is more CPU and
> disk intensive, a more powerful computer is recommended here. You'll also
> need plenty of free disk space for the rapidly growing blockchain (~30GB at
> the time of writing).
>
> Two blockchain operations are especially resource-intensive: **synchronizing
> the blockchain** and **importing existing addresses with balances**. If you
> synchronize often (once a week, for example) and take care to import your
> addresses **before** spending into them, then it's possible to use a
> low-powered netbook as your online machine.
#### Download: The bitcoin daemon on the **online computer** requires a complete and
up-to-date blockchain for tracking addresses. Since its work is more CPU and
disk intensive, a more powerful computer is recommended here. You'll also
need plenty of free disk space for the rapidly growing blockchain (~100GB at
the time of writing).
Two blockchain operations are especially resource-intensive: **synchronizing
the blockchain** and **importing existing addresses with balances**. If you
synchronize often (once a week, for example) and take care to import your
addresses **before** spending into them, then it's possible to use a
low-powered netbook as your online machine.
### Download:
> Go to the Bitcoin Core [main download page][01]. Choose the 32-bit or 64-bit > Go to the Bitcoin Core [main download page][01]. Choose the 32-bit or 64-bit
> versions appropriate for your respective computers. > versions appropriate for your online and offline computers.
#### Install: ### Install (both online and offline computers):
> **On both the online and offline computers:** > **Windows users:**
> Windows users: run the Windows installer. Linux users: unpack the tar archive >> Run the Windows installer. When it's finished, determine where it installed
> and copy the bitcoind executable in bin/ to your execution path or just run it >> 'bitcoind.exe' (probably in `C:\Program Files\Bitcoin\daemon`) and append
> in place. >> that path to your [PATH variable][05].
#### Run: > **Linux users:**
>> Unpack the tar archive and copy the bitcoind executable in bin/ to your
>> execution path or just run it in place.
### Run (both Windows and Linux):
> **On the online computer:** > **On the online computer:**
> Open a terminal and start bitcoind with the command: >> Open a terminal and start bitcoind with the command:
$ bitcoind -daemon $ bitcoind -daemon
> Warning: If you already have Bitcoin Core installed, **move your existing >> Warning: If you're using an existing Bitcoin Core installation, **move your
> wallet.dat out of harm's way** before starting bitcoind. The new wallet >> wallet.dat out of harm's way** before starting bitcoind. The new wallet now
> now created will be used as your **tracking wallet**. >> created will be used as your **tracking wallet**.
> If you're connected to the Internet, bitcoind will begin downloading and >> If you're connected to the Internet, bitcoind will begin downloading and
> verifying the blockchain. This can take from several hours to several days >> verifying the blockchain. This can take from several hours to several days
> (depending on the speed of your computer) if you're downloading the blockchain >> (depending on the speed of your computer) for an initial download.
> from scratch.
> **On the offline computer:** > **On the offline computer:**
> Open a terminal and start bitcoind with the command: >> Open a terminal and start bitcoind with the command:
$ bitcoind -daemon -maxconnections=0 -listen=0 $ bitcoind -daemon -maxconnections=0 -listen=0
> Note that in the absence of a blockchain the daemon starts very quickly and >> Note that in the absence of a blockchain the offline daemon starts very
> uses practically no CPU once running. >> quickly and uses practically no CPU once running.
>> *Note for Windows users:* Under Windows, the bitcoind daemon doesn't fork to
>> run as a background process, so you'll have to run it in a separate terminal
>> window
[01]: https://bitcoin.org/en/download [01]: https://bitcoin.org/en/download
[bd]: https://bitcoin.org/bin/blockchain/ [bd]: https://bitcoin.org/bin/blockchain/
[05]: Editing-the-user-path-in-Windows

View file

@ -1,59 +1,68 @@
#### Note: ## Installing the Bitcoin daemon
> The bitcoin daemon on the **offline computer** is used solely to sign The bitcoin daemon on the **offline computer** is used solely to sign
> transactions and runs without a blockchain. Thus even a low-powered computer transactions and runs without a blockchain. Thus even a low-powered computer
> such as a netbook will suffice as your offline machine. such as a netbook will suffice as your offline machine.
>
> The bitcoin daemon on the **online computer** requires a complete and
> up-to-date blockchain for tracking addresses. Since its work is more CPU and
> disk intensive, a more powerful computer is recommended here. You'll also
> need plenty of free disk space for the rapidly growing blockchain (~30GB at
> the time of writing).
>
> Two blockchain operations are especially resource-intensive: **synchronizing
> the blockchain** and **importing existing addresses with balances**. If you
> synchronize often (once a week, for example) and take care to import your
> addresses **before** spending into them, then it's possible to use a
> low-powered netbook as your online machine.
#### Download: The bitcoin daemon on the **online computer** requires a complete and
up-to-date blockchain for tracking addresses. Since its work is more CPU and
disk intensive, a more powerful computer is recommended here. You'll also
need plenty of free disk space for the rapidly growing blockchain (~100GB at
the time of writing).
Two blockchain operations are especially resource-intensive: **synchronizing
the blockchain** and **importing existing addresses with balances**. If you
synchronize often (once a week, for example) and take care to import your
addresses **before** spending into them, then it's possible to use a
low-powered netbook as your online machine.
### Download:
> Go to the Bitcoin Core [main download page][01]. Choose the 32-bit or 64-bit > Go to the Bitcoin Core [main download page][01]. Choose the 32-bit or 64-bit
> versions appropriate for your respective computers. > versions appropriate for your online and offline computers.
#### Install: ### Install (both online and offline computers):
> **On both the online and offline computers:** > **Windows users:**
> Windows users: run the Windows installer. Linux users: unpack the tar archive >> Run the Windows installer. When it's finished, determine where it installed
> and copy the bitcoind executable in bin/ to your execution path or just run it >> 'bitcoind.exe' (probably in `C:\Program Files\Bitcoin\daemon`) and append
> in place. >> that path to your [PATH variable][05].
#### Run: > **Linux users:**
>> Unpack the tar archive and copy the bitcoind executable in bin/ to your
>> execution path or just run it in place.
### Run (both Windows and Linux):
> **On the online computer:** > **On the online computer:**
> Open a terminal and start bitcoind with the command: >> Open a terminal and start bitcoind with the command:
$ bitcoind -daemon $ bitcoind -daemon
> Warning: If you already have Bitcoin Core installed, **move your existing >> Warning: If you're using an existing Bitcoin Core installation, **move your
> wallet.dat out of harm's way** before starting bitcoind. The new wallet >> wallet.dat out of harm's way** before starting bitcoind. The new wallet now
> now created will be used as your **tracking wallet**. >> created will be used as your **tracking wallet**.
> If you're connected to the Internet, bitcoind will begin downloading and >> If you're connected to the Internet, bitcoind will begin downloading and
> verifying the blockchain. This can take from several hours to several days >> verifying the blockchain. This can take from several hours to several days
> (depending on the speed of your computer) if you're downloading the blockchain >> (depending on the speed of your computer) for an initial download.
> from scratch.
> **On the offline computer:** > **On the offline computer:**
> Open a terminal and start bitcoind with the command: >> Open a terminal and start bitcoind with the command:
$ bitcoind -daemon -maxconnections=0 -listen=0 $ bitcoind -daemon -maxconnections=0 -listen=0
> Note that in the absence of a blockchain the daemon starts very quickly and >> Note that in the absence of a blockchain the offline daemon starts very
> uses practically no CPU once running. >> quickly and uses practically no CPU once running.
>> *Note for Windows users:* Under Windows, the bitcoind daemon doesn't fork to
>> run as a background process, so you'll have to run it in a separate terminal
>> window
[01]: https://bitcoin.org/en/download [01]: https://bitcoin.org/en/download
[bd]: https://bitcoin.org/bin/blockchain/ [bd]: https://bitcoin.org/bin/blockchain/
[05]: Editing-the-user-path-in-Windows

View file

@ -1,120 +1,186 @@
***Warning: the MMGen installation process on Windows is not for the faint of ***Warning: though the MMGen installation process on Windows has become easier,
heart, success is not guaranteed and the user experience is less than optimal. it still requires patience, and the user experience is less than optimal.
You're urged to use the prebuilt [MMGenLive][20] USB image instead. It's now You're urged to use the prebuilt [MMGenLive][20] USB image instead. It's now
the preferred way for all non-Linux users to run MMGen.*** the preferred way for all non-Linux users to run MMGen.***
##### Note: The following instructions assume you'll be unpacking all archives to `C:\`, the root directory on most Windows installations. If you choose to unpack to another location, the `cd` commands must be adjusted accordingly. ### 1. Create the build directory:
#### 1. Install the Python interpreter: Enter your MSYS environment, create the directory `/build` and move to it.
This is where you'll be unpacking and building archives:
Grab the [Windows 32-bit installer][09] and run it, accepting the defaults. $ mkdir /build
Add the Python base and Scripts directories to your [path][08], e.g. $ cd /build
`C:\Python27;C:\Python27\Scripts`.
#### 2. Build OpenSSL: 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
the instructions below. If you're offline, you'll need to download them first
on another machine and then transfer them to the install computer using a USB
stick, for example.
Grab the [latest tarball][06] from the [openssl.org download page][05] and unpack In either case, you'll probably be downloading the archives to a folder
it. At the MSYS prompt, run: somewhere outside the root of your MSYS filesystem. To access it within MSYS,
use `/c/` for drive `C:`, `/d/` for drive `D:` and so forth. A full path to an
archive would thus look something like this:
`/c/my_downloaded_archives/archive_name.tar.gz`.
$ cd /c/openssl-1.0.1g ### 2. Build OpenSSL:
$ ./config --openssldir=/usr
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
$ make install $ make install
#### 3. Build the Scrypt Python module: ### 3. Build the Scrypt Python module:
Grab the [latest tarball][07] from python.org and unpack it. At the MSYS prompt, The latest scrypt tarball available from [Python][07] at this writing
run: (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 /c/scrypt-0.6.1 $ cd /build
$ unzip <path to scrypt archive>/91d194b6a6bd.zip
$ cd mhallin-py-scrypt-91d194b6a6bd
Open `setup.py` in your text editor and make the following changes: Open the file `setup.py` in your text editor. Change the line reading
> Change the line: from setuptools import setup, Extension
library_dirs = ['c:\OpenSSL-Win32\lib\MinGW'] to read
> to read: from distutils.core import setup, Extension
library_dirs = ['c:\msys\lib','c:\WINDOWS\system32'] Right before the line beginning with
> Change the line: scrypt_module = Extension(
includes = ['c:\OpenSSL-Win32\include'] add the following lines (with no indentation):
> to read: library_dirs = [r'c:\mingw64\x86_64-w4-mingw32\lib','/msys/lib']
includes = [r'c:\msys\include']
includes = ['c:\msys\include'] Save `setup.py`, build and install:
Save the file. At the MSYS prompt, run:
$ python setup.py build --compiler=mingw32 $ python setup.py build --compiler=mingw32
Ignore the warning messages at the end and run:
$ python setup.py install $ python setup.py install
#### 4. Install the Pycrypto Python module: Now, to solve a problem with the interpreter not finding the scrypt extension
module, we have to do this little fixup:
Source code is available from the [Pycrypto home page][00], but it appears to $ cd /mingw/opt/lib/python2.7/site-packages
build only with MS Visual Studio, not MinGW. Until this situation is fixed, $ unzip scrypt*.egg
you can install the precompiled binaries available from [Voidspace][01].
Download and run the [Windows installer][02], accepting the defaults.
#### 5. Install the ecdsa Python module: ### 4. Build the pycrypto Python module:
Grab the [tarball][03] and unpack it. At the MSYS prompt, run: Download the latest pycrypto [tarball][02] from the Python website and unpack it:
$ cd /c/ecdsa-0.11 $ 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"])
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 install
#### 6. Install the bitcoin-python Python module: ### 5. Install the ecdsa Python module:
Grab the [tarball][04] and unpack it. At the MSYS prompt, run: Grab the latest python-ecdsa [tarball][03], unpack and build:
$ cd /c/bitcoin-python-0.3 $ cd /build
$ cp -a src/bitcoinrpc /c/Python27/Lib/site-packages $ tar -xzf <path to ecdsa archive>/ecdsa-0.13.tar.gz
$ cd ecdsa-0.13
This is a workaround for a dependency issue with the package's setup script.
If your Python is installed in a different location, you'll have to adjust the
destination path accordingly.
#### 7. Install the colorama Python module (optional but recommended):
Grab the [tarball][14] and unpack it. At the MSYS prompt, run:
$ cd /c/colorama-0.3.3
$ python setup.py install $ python setup.py install
#### 8. Install MMGen: ### 6. Install the colorama Python module:
Get the [zip archive][10b] from GitHub and unpack it. At the MSYS prompt, run: Grab the latest colorama [tarball][14], unpack and build:
$ cd /c/mmgen-stable_mswin $ 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):
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
### 8. 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:
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
them yourself. You'll need these archives:
> * [autoconf][31]
> * [automake][32]
> * [libtool][33]
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
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
### 10. 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 $ sudo ./setup.py install
Type: If you wish, you may run the MMGen test suite to make sure your installation's
working:
$ echo $PATH $ test/test.py -s
The `C:\Python27;C:\Python27\Scripts` you added to your path in Step 1 of this [02]: https://pypi.python.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz#md5=55a61a054aa66812daf5161a0d5d7eda
page should be included in your PATH variable. If not, then exit MSYS and open [03]: https://pypi.python.org/packages/f9/e5/99ebb176e47f150ac115ffeda5fedb6a3dbb3c00c74a59fd84ddf12f5857/ecdsa-0.13.tar.gz#md5=1f60eda9cb5c46722856db41a3ae6670
a new MSYS window to update your path. [06]: https://www.openssl.org/source/openssl-1.0.2j.tar.gz
[00]: https://www.dlitz.net/software/pycrypto/
[01]: http://www.voidspace.org.uk/python/modules.shtml#pycrypto
[02]: http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win32-py2.7.exe)
[03]: https://pypi.python.org/pypi/ecdsa
[04]: https://pypi.python.org/pypi/bitcoin-python/0.3
[09]: https://www.python.org/ftp/python/2.7.6/python-2.7.6.msi
[08]: Editing-the-user-path-in-Windows
[07]: https://pypi.python.org/pypi/scrypt/ [07]: https://pypi.python.org/pypi/scrypt/
[06]: http://www.openssl.org/source/openssl-1.0.1g.tar.gz [07z]: https://bitbucket.org/mhallin/py-scrypt/get/91d194b6a6bd.zip
[05]: http://www.openssl.org/source/ [10]: https://github.com/mmgen/mmgen/archive/stable_mswin.zip
[10]: https://github.com/mmgen/mmgen/archive/master.zip [14]: https://pypi.python.org/packages/f0/d0/21c6449df0ca9da74859edc40208b3a57df9aca7323118c913e58d442030/colorama-0.3.7.tar.gz#md5=349d2b02618d3d39e5c6aede36fe3c1a
[10b]: https://github.com/mmgen/mmgen/archive/stable_mswin.zip [15]: https://pypi.python.org/packages/e8/13/d0b0599099d6cd23663043a2a0bb7c61e58c6ba359b2656e6fb000ef5b98/pexpect-4.2.1.tar.gz#md5=3694410001a99dff83f0b500a1ca1c95
[11]: http://slproweb.com/download/Win32OpenSSL-1_0_1f.exe [16]: https://download.sysinternals.com/files/SDelete.zip
[12]: http://www.openssl.org/related/binaries.html
[13]: Getting-Started-with-MMGen
[14]: https://pypi.python.org/pypi/colorama
[20]: https://github.com/mmgen/MMGenLive [20]: https://github.com/mmgen/MMGenLive
[11]: https://github.com/bitcoin-core/secp256k1/archive/master.zip
[31]: https://sourceforge.net/projects/mingw/files/MinGW/Extension/autoconf/autoconf2.5/autoconf2.5-2.68-1/autoconf2.5-2.68-1-mingw32-bin.tar.lzma
[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

View file

@ -1,20 +1,21 @@
***Warning: the MMGen installation process on Windows is not for the faint of ***Warning: though the MMGen installation process on Windows is now easier,
heart, success is not guaranteed and the user experience is less than optimal. it still requires patience, and the user experience is less than optimal.
You're urged to use the prebuilt [MMGenLive][00] USB image instead. It's now You're urged to use the prebuilt [MMGenLive][20] USB image instead. It's now
the preferred way for all non-Linux users to run MMGen.*** the preferred way for all non-Linux users to run MMGen.***
Install MMGen on Windows by completing the following three steps: Install MMGen on Windows by completing the following three steps:
> 1. [Install MinGW and MSYS][01], if you haven't already; >> 1. Install MinGW and MSYS ([WinXP][03]|[>=Win7][01]), if you haven't already;
> 2. [Install MMGen's dependencies (excluding the bitcoin daemons) and >> 2. Install MMGen's dependencies (excluding the bitcoin daemons) and MMGen itself ([WinXP][04]|[>=Win7][02]); and
> MMGen itself][02]; and >> 3. [Install the offline and online bitcoin daemons (bitcoind)][07].
> 3. [Install the offline and online bitcoin daemons (bitcoind)][07].
Congratulations, your MMGen installation is now complete! Now move on to Congratulations, your MMGen installation is now complete! Now you can
[**Getting Started with MMGen**][08]. proceed to [**Getting Started with MMGen**][08].
[01]: Install-MinGW-and-MSYS-on-Microsoft-Windows [01]: Install-MinGW-64-and-MSYS-on-Microsoft-Windows
[02]: Install-MMGen-and-Its-Dependencies-on-Microsoft-Windows [02]: Install-MMGen-and-Its-Dependencies-on-Microsoft-Windows
[03]: Install-MinGW-and-MSYS-on-Windows-XP
[04]: Install-MMGen-and-Its-Dependencies-on-Windows-XP
[07]: Install-Bitcoind [07]: Install-Bitcoind
[08]: Getting-Started-with-MMGen [08]: Getting-Started-with-MMGen
[00]: https://github.com/mmgen/MMGenLive [20]: https://github.com/mmgen/MMGenLive

View file

@ -1,18 +1,18 @@
## Table of Contents ## Table of Contents
#### <a href=#01>Basic Operations</a> #### <a href='#a_bo'>Basic Operations</a>
* <a href=#02>Generate a wallet</a> * <a href='#a_gw'>Generate a wallet</a>
* <a href=#03>Generate addresses</a> * <a href='#a_ga'>Generate addresses</a>
* <a href=#04>Import addresses</a> * <a href='#a_ia'>Import addresses</a>
* <a href=#05>Create a transaction</a> * <a href='#a_ct'>Create a transaction</a>
* <a href=#06>Sign a transaction</a> * <a href='#a_sg'>Sign a transaction</a>
* <a href=#07>Send a transaction</a> * <a href='#a_st'>Send a transaction</a>
#### <a href=#10>Additional Features</a> #### <a href='#a_af'>Additional Features</a>
* <a href=#11>Using the mnemonic and seed features</a> * <a href='#a_ms'>Using the mnemonic and seed features</a>
* <a href=#12>Mnemonics and seeds: additional information</a> * <a href='#a_ai'>Mnemonics and seeds: additional information</a>
* <a href=#13>Incognito wallets</a> * <a href='#a_ic'>Incognito wallets</a>
* <a href=#13a>Hidden incognito wallets</a> * <a href='#a_hi'>Hidden incognito wallets</a>
The following primer presupposes you have MMGen installed on two computers, one The following primer presupposes you have MMGen installed on two computers, one
offline and one online. However, if you have an online computer and a few offline and one online. However, if you have an online computer and a few
@ -38,22 +38,23 @@ this primer are fake and for purposes of illustration only. The up arrow (for
repeating commands) and tab key (or Ctrl-I) (for completing commands and repeating commands) and tab key (or Ctrl-I) (for completing commands and
filenames) will speed up your work at the command line greatly. filenames) will speed up your work at the command line greatly.
### <a name=01>Basic Operations</a> ### <a name='a_bo'>Basic Operations</a>
#### <a name=02>Generate a wallet (offline computer):</a> #### <a name='a_gw'>Generate a wallet (offline computer):</a>
*NOTE: Beginning with v0.8.8, MMGen supports a “default wallet” feature. After *NOTE: Beginning with v0.8.8, MMGen supports a “default wallet” feature. After
creating your wallet, MMGen will prompt you to make it your default. If you creating your wallet, MMGen will prompt you to make it your default. If you
answer 'y', the wallet will be stored in your MMGen data directory and used for answer 'y', the wallet will be stored in your MMGen data directory and used for
all future commands that require a wallet or other seed source.* all future commands that require a wallet or other seed source.*
*If you don't want your MMGen wallet stored in your MMGen data directory, then *You may not want this feature if you plan to store your MMGen wallet in another
you may not to want to use this feature. Otherwise, it's recommended, as it location than your MMGen data directory. Otherwise, it's recommended, as it
saves you from having to type your wallet on the command line.* frees you from having to type your wallet on the command line.*
*The following examples suppose that you've chosen to use a default wallet. *The following examples suppose that you've chosen to use a default wallet.
Bear in mind that if you hadn't, the wallet would need to be specified as an Bear in mind that in the absence of a default wallet, the path to a wallet file
argument to all commands where it's relevant.* or other seed source needs to be included in all commands where it's
applicable.*
On your offline computer, generate a wallet: On your offline computer, generate a wallet:
@ -83,7 +84,7 @@ printed out on paper. It can also be exported to more compact forms, the seed
file and mnemonic (discussed below). These formats are short enough to be file and mnemonic (discussed below). These formats are short enough to be
written out by hand or memorized. written out by hand or memorized.
#### <a name=03>Generate addresses (offline computer):</a> #### <a name='a_ga'>Generate addresses (offline computer):</a>
Now generate ten addresses with your just-created wallet: Now generate ten addresses with your just-created wallet:
@ -149,7 +150,7 @@ of lines as well.
Save the file, copy it onto a USB stick and transfer it to your online computer. Save the file, copy it onto a USB stick and transfer it to your online computer.
#### <a name=04>Import addresses (online computer):</a> #### <a name='a_ia'>Import addresses (online computer):</a>
On your online computer, go to your bitcoind data directory and move any On your online computer, go to your bitcoind data directory and move any
existing 'wallet.dat' file out of harm’s way. Start bitcoind and let it existing 'wallet.dat' file out of harm’s way. Start bitcoind and let it
@ -193,7 +194,7 @@ after the transactions have been confirmed:
89ABCDEF:4 Storage 3 0.4 89ABCDEF:4 Storage 3 0.4
TOTAL: 1 BTC TOTAL: 1 BTC
#### <a name=05>Create a transaction (online computer):</a> #### <a name='a_ct'>Create a transaction (online computer):</a>
Now that you have some BTC under MMGen’s control, you’re ready to create a Now that you have some BTC under MMGen’s control, you’re ready to create a
transaction. Note that transactions are harmless until they’re signed and transaction. Note that transactions are harmless until they’re signed and
@ -245,11 +246,11 @@ 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 outputs of sufficient value to cover the send amount of 0.1 Here you must choose unspent outputs of sufficient value to cover the send
BTC, plus the transaction fee. By the way, MMGen calculates fees automatically amount of 0.1 BTC, plus the transaction fee. By the way, MMGen calculates fees
using bitcoind’s 'estimatefee' RPC call, which makes things very convenient. If automatically using bitcoind’s 'estimatefee' RPC call, which makes things very
you want to increase the fee a bit for speedier confirmation, use the convenient. If you want to increase the fee a bit for speedier confirmation,
`--tx-fee-adj` option. Type `mmgen-txcreate --help` for details. use the `--tx-fee-adj` option. Type `mmgen-txcreate --help` for details.
Output #2 is worth 0.2 BTC, which is sufficient, so let’s choose it. After Output #2 is worth 0.2 BTC, which is sufficient, so let’s choose it. After
several more prompts and confirmations, your transaction will be saved: several more prompts and confirmations, your transaction will be saved:
@ -262,7 +263,7 @@ amount.
As you can see, MMGen gives you complete control over your transaction inputs As you can see, MMGen gives you complete control over your transaction inputs
and change addresses. This feature will be appreciated by privacy-conscious users. and change addresses. This feature will be appreciated by privacy-conscious users.
#### <a name=06>Sign a transaction (offline computer):</a> #### <a name='a_sg'>Sign a transaction (offline computer):</a>
Now transfer the the raw transaction file to your offline computer and sign it Now transfer the the raw transaction file to your offline computer and sign it
using your default wallet: using your default wallet:
@ -273,7 +274,7 @@ using your default wallet:
Note that the signed transaction file has a new extension, '.sigtx'. Note that the signed transaction file has a new extension, '.sigtx'.
#### <a name=07>Send a transaction (online computer):</a> #### <a name='a_st'>Send a transaction (online computer):</a>
Now you’re ready for the final step: broadcasting the transaction to the Now you’re ready for the final step: broadcasting the transaction to the
network. Copy the signed transaction file to your online computer, start network. Copy the signed transaction file to your online computer, start
@ -305,9 +306,9 @@ Some of MMGen’s more advanced features are discussed below. Others are
documented in the help screens of the individual MMGen commands: display these documented in the help screens of the individual MMGen commands: display these
by invoking the desired command with the `-h` or `--help` switch. by invoking the desired command with the `-h` or `--help` switch.
### <a name=10>Additional Features</a> ### <a name='a_af'>Additional Features</a>
#### <a name=11>Using the mnemonic and seed features:</a> #### <a name='a_ms'>Using the mnemonic and seed features:</a>
Continuing our example above, generate a mnemonic from the default wallet: Continuing our example above, generate a mnemonic from the default wallet:
@ -386,7 +387,7 @@ Or you can do the same thing with 'mmgen-tool':
$ mmgen-tool str2id6 'XnyC NfPH piuW dQ2d nM47 VU' $ mmgen-tool str2id6 'XnyC NfPH piuW dQ2d nM47 VU'
0fe02f 0fe02f
#### <a name=12>Mnemonics and seeds: additional information</a> #### <a name='a_ai'>Mnemonics and seeds: additional information</a>
MMGen commands that take mnemonic and seed data may receive the data from a MMGen commands that take mnemonic and seed data may receive the data from a
prompt instead of a file. Just omit the file name and specify the input format: prompt instead of a file. Just omit the file name and specify the input format:
@ -407,7 +408,7 @@ using the `-d` option. For example, on a Linux system you can use
ensuring that no trace of this sensitive data remains once your computer’s been ensuring that no trace of this sensitive data remains once your computer’s been
powered down. powered down.
#### <a name=13><a name=incog>Incognito wallets</a> #### <a name='a_ic'>Incognito wallets</a>
An incognito format wallet is indistinguishable from random data, allowing you An incognito format wallet is indistinguishable from random data, allowing you
to hide your wallet at an offset within a random-data-filled file or partition. to hide your wallet at an offset within a random-data-filled file or partition.
@ -485,7 +486,7 @@ MMGen wallet, mnemonic or seed file to generate addresses and sign transactions:
... ...
Signed transaction written to file FABCDE[0.3].sigtx Signed transaction written to file FABCDE[0.3].sigtx
##### <a name=13a><a name=incog>Hidden incognito wallets</a> ##### <a name='a_hi'>Hidden incognito wallets</a>
With the `-o hincog` option, incognito wallet data can be created and hidden at With the `-o hincog` option, incognito wallet data can be created and hidden at
a specified offset in a file or partition in a single convenient operation, with a specified offset in a file or partition in a single convenient operation, with

View file

@ -54,7 +54,7 @@ def magenta(s): return clr_mag+s+clr_reset
def init_color(enable_color=True): def init_color(enable_color=True):
global clr_red,clr_grn,clr_grnbg,clr_yel,clr_cya,clr_blu,clr_pnk,clr_orng,clr_gry,clr_mag,clr_reset global clr_red,clr_grn,clr_grnbg,clr_yel,clr_cya,clr_blu,clr_pnk,clr_orng,clr_gry,clr_mag,clr_reset
if enable_color: if enable_color:
clr_red = _red clr_red = _red
clr_grn = _grn clr_grn = _grn
clr_grnbg = _grnbg clr_grnbg = _grnbg
clr_yel = _yel clr_yel = _yel

View file

@ -36,13 +36,13 @@ class g(object):
sys.exit(ev) sys.exit(ev)
# Variables - these might be altered at runtime: # Variables - these might be altered at runtime:
version = '0.8.8' version = '0.8.9rc1'
release_date = 'November 2016' release_date = 'December 2016'
proj_name = 'MMGen' proj_name = 'MMGen'
prog_name = os.path.basename(sys.argv[0]) prog_name = os.path.basename(sys.argv[0])
author = 'Philemon' author = 'Philemon'
email = '<mmgen-py@yandex.com>' email = '<mmgen@tuta.io>'
Cdates = '2013-2016' Cdates = '2013-2016'
user_entropy = '' user_entropy = ''

View file

@ -195,8 +195,6 @@ def _get_terminal_size_mswin():
msg(yellow('Warning: could not get terminal size. Using fallback dimensions.')) msg(yellow('Warning: could not get terminal size. Using fallback dimensions.'))
return 80,25 return 80,25
def mswin_dummy_flush(fd,termconst): pass
def set_terminal_vars(): def set_terminal_vars():
global get_char,kb_hold_protect,get_terminal_size global get_char,kb_hold_protect,get_terminal_size
if _platform == 'linux': if _platform == 'linux':
@ -205,11 +203,9 @@ def set_terminal_vars():
if os.getenv('MMGEN_PEXPECT_POPEN_SPAWN'): if os.getenv('MMGEN_PEXPECT_POPEN_SPAWN'):
get_char,kb_hold_protect = _get_keypress_unix_stub,_kb_hold_protect_unix_raw get_char,kb_hold_protect = _get_keypress_unix_stub,_kb_hold_protect_unix_raw
get_terminal_size = _get_terminal_size_linux get_terminal_size = _get_terminal_size_linux
# myflush = termios.tcflush # call: myflush(sys.stdin, termios.TCIOFLUSH)
else: else:
get_char = (_get_keypress_mswin_raw,_get_keypress_mswin)[g.hold_protect] get_char = (_get_keypress_mswin_raw,_get_keypress_mswin)[g.hold_protect]
kb_hold_protect = (_kb_hold_protect_mswin_raw,_kb_hold_protect_mswin)[g.hold_protect] kb_hold_protect = (_kb_hold_protect_mswin_raw,_kb_hold_protect_mswin)[g.hold_protect]
if os.getenv('MMGEN_PEXPECT_POPEN_SPAWN'): if os.getenv('MMGEN_PEXPECT_POPEN_SPAWN'):
get_char = _get_keypress_mswin_emu get_char = _get_keypress_mswin_emu
get_terminal_size = _get_terminal_size_mswin get_terminal_size = _get_terminal_size_mswin
# myflush = mswin_dummy_flush

View file

@ -26,12 +26,16 @@ from binascii import hexlify
from mmgen.common import * from mmgen.common import *
def cleandir(d): def cleandir(d):
from shutil import rmtree
try: files = os.listdir(d) try: files = os.listdir(d)
except: return except: return
msg(green("Cleaning directory '%s'" % d)) msg(green("Cleaning directory '%s'" % d))
for f in files: for f in files:
os.unlink(os.path.join(d,f)) try:
os.unlink(os.path.join(d,f))
except:
rmtree(os.path.join(d,f))
def getrandnum(n): return int(hexlify(os.urandom(n)),16) def getrandnum(n): return int(hexlify(os.urandom(n)),16)
def getrandhex(n): return hexlify(os.urandom(n)) def getrandhex(n): return hexlify(os.urandom(n))

View file

@ -272,13 +272,14 @@ class MMGenTX(MMGenObject):
ask_write=ask_write, ask_write=ask_write,
ask_write_default_yes=ask_write_default_yes) ask_write_default_yes=ask_write_default_yes)
def write_to_file(self,add_desc='',ask_write=True,ask_write_default_yes=False): def write_to_file(self,add_desc='',ask_write=True,ask_write_default_yes=False,ask_tty=True):
if ask_write == False: if ask_write == False:
ask_write_default_yes=True ask_write_default_yes=True
self.format() self.format()
fn = '%s[%s].%s' % (self.txid,self.send_amt,self.ext) fn = '%s[%s].%s' % (self.txid,self.send_amt,self.ext)
write_data_to_file(fn,self.fmt_data,self.desc+add_desc, write_data_to_file(fn,self.fmt_data,self.desc+add_desc,
ask_write=ask_write, ask_write=ask_write,
ask_tty=ask_tty,
ask_write_default_yes=ask_write_default_yes) ask_write_default_yes=ask_write_default_yes)
def view_with_prompt(self,prompt=''): def view_with_prompt(self,prompt=''):

View file

@ -18,6 +18,7 @@ help_data = {
'usage': "<tx file>", 'usage': "<tx file>",
'options': """ 'options': """
-h, --help Print this help message -h, --help Print this help message
-S, --stdout Write data to STDOUT instead of file
""" """
} }
@ -97,6 +98,8 @@ tx = MMGenTX()
[tx.txid,send_amt,tx.timestamp],tx.hex,inputs,b2m_map,tx.label = parse_tx_file(cmd_args[0]) [tx.txid,send_amt,tx.timestamp],tx.hex,inputs,b2m_map,tx.label = parse_tx_file(cmd_args[0])
tx.send_amt = Decimal(send_amt) tx.send_amt = Decimal(send_amt)
g.testnet = False
g.rpc_host = 'localhost'
c = bitcoin_connection() c = bitcoin_connection()
# attrs = 'txid','vout','amt','comment','mmid','addr','wif' # attrs = 'txid','vout','amt','comment','mmid','addr','wif'
@ -134,4 +137,4 @@ for e in tx.outputs:
#die(1,'') #die(1,'')
tx.blockcount = find_block_by_time(c,tx.timestamp) tx.blockcount = find_block_by_time(c,tx.timestamp)
tx.write_to_file(ask_write=False) tx.write_to_file(ask_tty=False)

View file

@ -63,8 +63,8 @@ setup(
author_email = 'mmgen-py@yandex.com', author_email = 'mmgen-py@yandex.com',
url = 'https://github.com/mmgen/mmgen', url = 'https://github.com/mmgen/mmgen',
license = 'GNU GPL v3', license = 'GNU GPL v3',
platforms = 'Linux, MS Windows, Raspberry PI', platforms = 'Linux, MS Windows, Raspberry Pi',
keywords = 'Bitcoin, wallet, cold storage, offline storage, open-source, command-line, Python, Bitcoin Core, bitcoind, hd, deterministic, hierarchical, secure, anonymous', keywords = 'Bitcoin, cryptocurrency, wallet, cold storage, offline, online, spending, open-source, command-line, Python, 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',
cmdclass = { 'build_ext': my_build_ext, 'install_data': my_install_data }, cmdclass = { 'build_ext': my_build_ext, 'install_data': my_install_data },
ext_modules = [module1], ext_modules = [module1],
data_files = [('share/mmgen', [ data_files = [('share/mmgen', [
@ -76,10 +76,11 @@ setup(
'mmgen.__init__', 'mmgen.__init__',
'mmgen.addr', 'mmgen.addr',
'mmgen.bitcoin', 'mmgen.bitcoin',
'mmgen.globalvars', 'mmgen.color',
'mmgen.common', 'mmgen.common',
'mmgen.crypto', 'mmgen.crypto',
'mmgen.filename', 'mmgen.filename',
'mmgen.globalvars',
'mmgen.license', 'mmgen.license',
'mmgen.mn_electrum', 'mmgen.mn_electrum',
'mmgen.mn_tirosh', 'mmgen.mn_tirosh',
@ -90,8 +91,8 @@ setup(
'mmgen.term', 'mmgen.term',
'mmgen.test', 'mmgen.test',
'mmgen.tool', 'mmgen.tool',
'mmgen.tx',
'mmgen.tw', 'mmgen.tw',
'mmgen.tx',
'mmgen.util', 'mmgen.util',
'mmgen.main', 'mmgen.main',

View file

@ -36,10 +36,10 @@ opts_data = {
'desc': "Test address generation in various ways", 'desc': "Test address generation in various ways",
'usage':'[options] [spec] [rounds | dump file]', 'usage':'[options] [spec] [rounds | dump file]',
'options': """ 'options': """
-h, --help Print this help message -h, --help Print this help message
-q, --quiet Produce quieter output --, --longhelp Print help message for long options (common options)
--, --testnet Run for testnet rather than mainnet -q, --quiet Produce quieter output
-v, --verbose Produce more verbose output -v, --verbose Produce more verbose output
""", """,
'notes': """ 'notes': """
Tests: Tests:
@ -106,7 +106,7 @@ else:
def match_error(sec,wif,a_addr,b_addr,a,b): def match_error(sec,wif,a_addr,b_addr,a,b):
m = ['','py-ecdsa','keyconv','secp256k1','dump'] m = ['','py-ecdsa','keyconv','secp256k1','dump']
msg_r(red('\nERROR: Addresses do not match!')) qmsg_r(red('\nERROR: Addresses do not match!'))
die(3,""" die(3,"""
sec key : {} sec key : {}
WIF key : {} WIF key : {}
@ -116,13 +116,13 @@ def match_error(sec,wif,a_addr,b_addr,a,b):
if a and b: if a and b:
m = "Comparing address generators '{}' and '{}'" m = "Comparing address generators '{}' and '{}'"
msg(green(m.format(g.key_generators[a-1],g.key_generators[b-1]))) qmsg(green(m.format(g.key_generators[a-1],g.key_generators[b-1])))
from mmgen.addr import get_privhex2addr_f from mmgen.addr import get_privhex2addr_f
gen_a = get_privhex2addr_f(generator=a) gen_a = get_privhex2addr_f(generator=a)
gen_b = get_privhex2addr_f(generator=b) gen_b = get_privhex2addr_f(generator=b)
compressed = False compressed = False
for i in range(1,rounds+1): for i in range(1,rounds+1):
msg_r('\rRound %s/%s ' % (i,rounds)) qmsg_r('\rRound %s/%s ' % (i,rounds))
sec = hexlify(os.urandom(32)) sec = hexlify(os.urandom(32))
wif = hex2wif(sec,compressed=compressed) wif = hex2wif(sec,compressed=compressed)
a_addr = gen_a(sec,compressed) a_addr = gen_a(sec,compressed)
@ -133,10 +133,10 @@ if a and b:
if a != 2 and b != 2: if a != 2 and b != 2:
compressed = not compressed compressed = not compressed
msg(green(('\n','')[bool(opt.verbose)] + 'OK')) qmsg(green(('\n','')[bool(opt.verbose)] + 'OK'))
elif a and not fh: elif a and not fh:
m = "Testing speed of address generator '{}'" m = "Testing speed of address generator '{}'"
msg(green(m.format(g.key_generators[a-1]))) qmsg(green(m.format(g.key_generators[a-1])))
from mmgen.addr import get_privhex2addr_f from mmgen.addr import get_privhex2addr_f
gen_a = get_privhex2addr_f(generator=a) gen_a = get_privhex2addr_f(generator=a)
import time import time
@ -147,7 +147,7 @@ elif a and not fh:
print 'Starting key:', hexlify(seed+pack('I',0)) print 'Starting key:', hexlify(seed+pack('I',0))
compressed = False compressed = False
for i in range(rounds): for i in range(rounds):
if not opt.quiet: msg_r('\rRound %s/%s ' % (i+1,rounds)) qmsg_r('\rRound %s/%s ' % (i+1,rounds))
sec = hexlify(seed+pack('I',i)) sec = hexlify(seed+pack('I',i))
wif = hex2wif(sec,compressed=compressed) wif = hex2wif(sec,compressed=compressed)
a_addr = gen_a(sec,compressed) a_addr = gen_a(sec,compressed)
@ -155,18 +155,18 @@ elif a and not fh:
if a != 2: if a != 2:
compressed = not compressed compressed = not compressed
elapsed = int(time.time() - start) elapsed = int(time.time() - start)
if not opt.quiet: msg('') qmsg('')
msg('%s addresses generated in %s second%s' % (rounds,elapsed,('s','')[elapsed==1])) qmsg('%s addresses generated in %s second%s' % (rounds,elapsed,('s','')[elapsed==1]))
elif a and dump: elif a and dump:
m = "Comparing output of address generator '{}' against wallet dump '{}'" m = "Comparing output of address generator '{}' against wallet dump '{}'"
msg(green(m.format(g.key_generators[a-1],cmd_args[1]))) qmsg(green(m.format(g.key_generators[a-1],cmd_args[1])))
if a == 2: if a == 2:
msg("NOTE: for compressed addresses, 'python-ecdsa' generator will be used") qmsg("NOTE: for compressed addresses, 'python-ecdsa' generator will be used")
from mmgen.addr import get_privhex2addr_f from mmgen.addr import get_privhex2addr_f
gen_a = get_privhex2addr_f(generator=a) gen_a = get_privhex2addr_f(generator=a)
from mmgen.bitcoin import wif2hex from mmgen.bitcoin import wif2hex
for n,[wif,a_addr] in enumerate(dump,1): for n,[wif,a_addr] in enumerate(dump,1):
msg_r('\rKey %s/%s ' % (n,len(dump))) qmsg_r('\rKey %s/%s ' % (n,len(dump)))
sec = wif2hex(wif) sec = wif2hex(wif)
if sec == False: if sec == False:
die(2,'\nInvalid {}net WIF address in dump file: {}'.format(('main','test')[g.testnet],wif)) die(2,'\nInvalid {}net WIF address in dump file: {}'.format(('main','test')[g.testnet],wif))
@ -174,4 +174,4 @@ elif a and dump:
b_addr = gen_a(sec,compressed) b_addr = gen_a(sec,compressed)
if a_addr != b_addr: if a_addr != b_addr:
match_error(sec,wif,a_addr,b_addr,1 if compressed and a==2 else a,4) match_error(sec,wif,a_addr,b_addr,1 if compressed and a==2 else a,4)
msg(green(('\n','')[bool(opt.verbose)] + 'OK')) qmsg(green(('\n','')[bool(opt.verbose)] + 'OK'))

View file

@ -131,6 +131,7 @@ add_spawn_args = ' '.join(['{} {}'.format(
'--'+k.replace('_','-'), '--'+k.replace('_','-'),
getattr(opt,k) if getattr(opt,k) != True else '' getattr(opt,k) if getattr(opt,k) != True else ''
) for k in 'testnet','rpc_host' if getattr(opt,k)]).split() ) for k in 'testnet','rpc_host' if getattr(opt,k)]).split()
add_spawn_args += [ '--data-dir', cfg['tmpdir']] # ignore ~/.mmgen
if opt.system: sys.path.pop(0) if opt.system: sys.path.pop(0)