diff --git a/Altcoin-and-Forkcoin-Support.md b/Altcoin-and-Forkcoin-Support.md index da3e341..c4451a5 100644 --- a/Altcoin-and-Forkcoin-Support.md +++ b/Altcoin-and-Forkcoin-Support.md @@ -16,26 +16,26 @@ #### [Key/address generation for 144 Bitcoin-derived altcoins](#a_kg) -### Introduction +### Introduction Depending on your setup, the instructions on this page may apply to your offline machine, your online machine, or both. If you’re confused as to which, please familiarize yourself with the basics of MMGen by reading the [**Getting Started**][gs] guide. -### Ethereum (ETH), Ethereum Classic (ETC) and ERC20 Tokens +### Ethereum (ETH), Ethereum Classic (ETC) and ERC20 Tokens MMGen supports all operations for Ethereum, Ethereum Classic and ERC20 tokens. In addition, ERC20 token creation and deployment are supported via the `create-token.py` script. -#### Install the Ethereum dependencies +#### Install the Ethereum dependencies From the MMGen repository root, type: $ python3 -m pip install --no-deps --user -r eth-requirements.txt -#### Install and run Geth, Parity or OpenEthereum +#### Install and run Geth, Parity or OpenEthereum MMGen can use either Go-Ethereum (Geth) or OpenEthereum to communicate with the Ethereum network. For information on installing Geth or OE on your @@ -70,7 +70,7 @@ section below. You may require other options as well. Invoke your daemon with the `--help` switch for more complete information. -#### Transacting and other basic operations +#### Transacting and other basic operations Basic operations with ETH, ETC and ERC20 tokens work as described in the [Getting Started][bo] guide, with some differences. Please note the following: @@ -130,7 +130,7 @@ View your EOS tracking wallet: To transact ETH instead of EOS, omit the `--token` and `--token-addr` arguments. -#### Creating and deploying ERC20 tokens +#### Creating and deploying ERC20 tokens ##### Install the Solidity compiler @@ -184,7 +184,7 @@ View your MFT tracking wallet: Other token parameters can be customized too. Type `scripts/create-token.py --help` for details. -### Bitcoin Cash Node (BCH) and Litecoin (LTC) +### Bitcoin Cash Node (BCH) and Litecoin (LTC) Bitcoin Cash Node (BCH) and Litecoin are fully supported by MMGen, on the same level as Bitcoin. @@ -200,7 +200,7 @@ MMGen requires that the bitcoin-bchn 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! -### Monero (XMR) +### Monero (XMR) MMGen’s Monero support includes automated wallet creation/syncing and transaction creation/relaying via the `mmgen-xmrwallet` command. Make sure @@ -244,7 +244,7 @@ have multiple wallets requiring long sync times. `mmgen-xmrwallet` supports transacting via the `sweep` and `transfer` subcommands. Type `mmgen-xmrwallet --help` for details. -### Key/address generation for Zcash (ZEC) +### Key/address generation for Zcash (ZEC) MMGen’s enhanced support for Zcash includes generation of **z-addresses.** @@ -263,7 +263,7 @@ To generate Zcash t-addresses, just omit the `--type` argument: $ mmgen-keygen --coin=zec 1-10 -### Key/address generation for 144 Bitcoin-derived altcoins +### Key/address generation for 144 Bitcoin-derived altcoins To generate key/address pairs for these coins, just specify the coin’s symbol with the `--coin` argument: diff --git a/Getting-Started-with-MMGen.md b/Getting-Started-with-MMGen.md index 38697bd..451514f 100644 --- a/Getting-Started-with-MMGen.md +++ b/Getting-Started-with-MMGen.md @@ -31,9 +31,9 @@ * [With an offline (cold storage) wallet](#a_rbf_onf) * [Keeping your installation up to date](#a_utd) -### Preliminaries +### Preliminaries -#### Before you begin +#### Before you begin Before you begin, note that the filenames, seed IDs and Bitcoin addresses used in this primer are intentionally invalid and are for purposes of illustration @@ -48,7 +48,7 @@ modification they may be used with altcoins and forkcoins for which MMGen supports transaction operations (BCH, LTC, ETH and ETC as of this writing). See [Altcoin-and-Forkcoin-Support][09] for more details. -#### Invocation +#### Invocation The MMGen wallet system is not a single program but a suite of lightweight scripts run from the command line. MMGen’s commands all begin, not @@ -79,7 +79,7 @@ Sample MMGen command invocations: $ mmgen-walletgen $ mmgen-walletgen --quiet --seed-len 128 -#### Configuration file +#### Configuration file Just like Bitcoin Core, MMGen has its own data directory and configuration file. The data directory is `.mmgen` in the user’s home directory and the config @@ -89,7 +89,7 @@ include the maximum transaction fee; the user name, password and hostname used for communicating with your Bitcoin or altcoin daemon; and a number of others. -#### Bob and Alice regtest mode +#### Bob and Alice regtest mode If you just want to quickly try out MMGen, it’s possible to perform all wallet generation, wallet format conversion, address and key generation, and address @@ -107,9 +107,9 @@ it an ideal way to learn to use the MMGen wallet without risking real coins. You may wish to pause here and perform the steps in the tutorial [MMGen Quick Start with Regtest Mode][04] before continuing on. -### Basic Operations +### Basic Operations -#### Generate an MMGen wallet (offline computer) +#### Generate an MMGen wallet (offline computer) *NOTE: MMGen supports a “default wallet” feature. After generating your wallet, you’ll be prompted to make it your default. If you answer ‘y’, the wallet will @@ -158,7 +158,7 @@ your seed phrase to be 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. -#### Generate addresses (offline computer) +#### Generate addresses (offline computer) Now generate ten Segwit-P2SH addresses with your just-created wallet: @@ -266,7 +266,7 @@ of lines as well. Save the file, copy it onto a USB stick and transfer it to your online computer. -#### Import addresses (online computer) +#### Import addresses (online computer) On your online computer, go to your coin daemon’s data directory (`~/.bitcoin` by default for Bitcoin Core) and move any existing `wallet.dat` file out of @@ -326,7 +326,7 @@ have confirmed: 89ABCDEF:S:4 Storage 3 0.4 TOTAL: 1 BTC -#### Create a transaction (online computer) +#### Create a transaction (online computer) 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 @@ -398,7 +398,7 @@ non-change spend amount. 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. -#### Sign a transaction (offline computer) +#### Sign a transaction (offline computer) Now transfer the the raw transaction file to your offline computer and sign it using your default wallet: @@ -409,7 +409,7 @@ using your default wallet: Note that the signed transaction file has a new extension, `.sigtx`. -#### Send a transaction (online computer) +#### Send a transaction (online computer) Now you’re ready for the final step: broadcasting the transaction to the network. Start bitcoind if it’s not already running, and make sure your @@ -454,9 +454,9 @@ BTC plus the transaction fee of 0.0001 BTC. Congratulations! You’ve now mastered the basics of MMGen! To learn about some of MMGen’s more advanced features, continue reading. -### Additional Features +### Additional Features -#### Using the mnemonic, seed and hexseed formats +#### Using the mnemonic, seed and hexseed formats Using your default wallet from the exercises above, generate a mnemonic: @@ -557,7 +557,7 @@ Mnemonics and hexseeds can be used to generate keys even without the MMGen software, using basic command-line utilities, as explained in [this tutorial][03]. -#### Mnemonics, seeds and hexseeds: additional information +#### Mnemonics, seeds and hexseeds: additional information All MMGen commands that take mnemonic, seed or hexseed data may receive the data interactively from the user instead of from a file. This feature allows you to @@ -589,7 +589,7 @@ using the `--outdir` or `-d` option. For example, on a Linux system you can use ensuring that no trace of your secret data remains once your computer’s been powered down. -#### Die roll wallet generation +#### Die roll wallet generation Interactive dieroll wallet generation works just like the interactive mnemonic input described in the preceding section. To generate a new dieroll wallet, @@ -604,7 +604,7 @@ To save the wallet in a format of your choice, use the `-o` option: 50, 75 and 100 rolls of the die are required to create 128, 192 and 256-bit seeds, respectively. -#### BIP39 support +#### BIP39 support BIP39 mnemonic support and usage is identical to that for native MMGen mnemonics described above. Just use the `bip39` format specifier and extension instead of @@ -618,7 +618,7 @@ Restore an MMGen wallet from a BIP39 seed phrase in a file: $ mmgen-walletconv seed.bip39 -#### Monero mnemonic support +#### Monero mnemonic support MMGen has limited support for Monero new-style mnemonics. While they can’t be used as wallets, they’re supported as a password format by the `mmgen-passgen` @@ -637,7 +637,7 @@ default wallet: $ mmgen-passgen -f xmrseed 'foo' 1-10 -#### Incognito wallets +#### Incognito wallets 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. @@ -715,7 +715,7 @@ MMGen wallet, mnemonic or seed file to generate addresses and sign transactions: ... Signed transaction written to file FABCDE[0.3].sigtx -##### Hidden incognito wallets +##### Hidden incognito wallets 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 @@ -760,9 +760,9 @@ Transaction signing uses the same syntax: ... Signed transaction written to file 'ABCDEF[0.1].sigtx' -### Advanced Topics +### Advanced Topics -#### Hot wallets +#### Hot wallets Chances are you’ll want to use MMGen not only for cold storage but for day-to-day transactions too. For this you’ll need to place a portion of your @@ -830,7 +830,7 @@ as it can always be regenerated from its offline parent. If you ever wish to delete it, however, you should do so securely if there are still funds under its control. -#### Transaction Fees +#### Transaction Fees MMGen gives you several options for dealing with transaction fees. @@ -855,7 +855,7 @@ MMGen has a hard maximum fee (currently 0.003 BTC) which is alterable only in th config file. Thus MMGen will never create or broadcast any transaction with a mistakenly or dangerously high fee unless you expressly permit it to. -#### BIP 125 replace-by-fee (RBF) transactions +#### BIP 125 replace-by-fee (RBF) transactions As of version 0.9.1, MMGen supports creating replaceable and replacement transactions in accordance with the BIP 125 replace-by-fee (RBF) specification. @@ -874,7 +874,7 @@ initial and replacement transactions will be created, signed and sent in one operation. In the second, a batch of replacement transactions with incrementally increasing fees will created online and then signed offline. -#### With an online (hot) wallet +#### With an online (hot) wallet Create, sign and send a BIP 125 replaceable transaction with a fee of 50 satoshis per byte: @@ -913,7 +913,7 @@ only thing you have to modify with each iteration is the argument to `--tx-fee`. To reduce your typing even further, use the `--yes` switch to skip all non-essential prompts. -#### With an offline (cold storage) wallet +#### With an offline (cold storage) wallet 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`: @@ -951,7 +951,7 @@ them in turn until you get a confirmation: $ mmgen-txsend 124FFF[0.1,150].sigtx # ...if this doesn’t confirm, then $ mmgen-txsend 73DABB[0.1,200].sigtx -#### Keeping your installation up to date +#### Keeping your installation up to date To make sure you have all the latest features and bugfixes, it’s a good idea to keep your MMGen installation upgraded to the latest version. MMGen does no diff --git a/Install-Bitcoind.md b/Install-Bitcoind.md index 9d2cd3d..b2d52ac 100644 --- a/Install-Bitcoind.md +++ b/Install-Bitcoind.md @@ -17,7 +17,7 @@ synchronize often (once a week, for example) and take care to import your addresses **before** spending into them, then it’s possible to get by with a more low-powered computer as your online machine. -### Download: +### Download: > **Bitcoin Core:** @@ -37,7 +37,7 @@ more low-powered computer as your online machine. >> versions appropriate for your online and offline computers. Windows users >> should choose the executable installer. -### Install (both online and offline computers): +### Install (both online and offline computers): > **Bitcoin Core:** @@ -69,7 +69,7 @@ more low-powered computer as your online machine. >> **Linux:** Unpack the archive and copy the `litecoind` and >> `litecoin-cli` binaries to `/usr/local/bin`. -### Run (both online and offline computers): +### Run (both online and offline computers): > **Windows:** diff --git a/Install-MMGen-on-Microsoft-Windows.md b/Install-MMGen-on-Microsoft-Windows.md index 45fc454..425af8d 100644 --- a/Install-MMGen-on-Microsoft-Windows.md +++ b/Install-MMGen-on-Microsoft-Windows.md @@ -23,7 +23,7 @@ * [MSYS2](#a_us) * [MMGen](#a_um) -## Introduction +## Introduction MMGen is supported on Microsoft Windows via [MSYS2][mh], which provides a Unix-like command-line environment within Windows. Windows 7 and later versions @@ -53,9 +53,9 @@ that’s *already* offline. These steps will be additionally outlined in sections entitled **Offline install.** When doing an online install you may skip over these sections. -## Install MSYS2 and MMGen +## Install MSYS2 and MMGen -### 1. Install MSYS2 +### 1. Install MSYS2 Download the MSYS2 executable installer for your architecture from the [MSYS2 homepage][mh], but ignore the installation instructions there. @@ -63,7 +63,7 @@ homepage][mh], but ignore the installation instructions there. Run the installer, accepting all defaults. At the end of the installation, uncheck “Run MSYS2 now” and click Finish. -### 2. Set up PowerShell as your MSYS2 terminal +### 2. Set up PowerShell as your MSYS2 terminal MMGen is incompatible with the terminal provided by the MSYS2 project. However, it works just fine with Windows’ native PowerShell. @@ -83,9 +83,9 @@ following commands, for example, will produce a listing of the same directory: $ ls 'C:\\msys64\etc' # the path as seen by Windows -### 3. Upgrade MSYS2 +### 3. Upgrade MSYS2 -#### Online users: +#### Online users: > Optionally edit your mirror lists as described in **Offline install** below. @@ -101,7 +101,7 @@ following commands, for example, will produce a listing of the same directory: $ pacman -Su -#### Offline install: +#### Offline install: > You must now download the required database and package files from the > Internet on your online computer and copy them to your offline box. A USB @@ -172,12 +172,12 @@ this folder. > Your system upgrade is now complete. -### 4. Install MSYS2 MMGen dependencies +### 4. Install MSYS2 MMGen dependencies Now that your system’s fully up to date, you’re ready to install the packages specifically required by MMGen. -#### Offline install: +#### Offline install: > As you’ve probably noticed by now, the command `pacman -S ` > installs MSYS2 packages and their dependencies, while `pacman -Sp @@ -208,7 +208,7 @@ Install the MMGen requirements and their dependencies: mingw-w64-x86_64-python-aiohttp \ mingw-w64-x86_64-python-pyreadline3 -### 5. Set up your environment +### 5. Set up your environment Create the `/usr/local/bin` directory. This is where you’ll place various binaries required by MMGen: @@ -229,7 +229,7 @@ path): Save and exit. Close and reopen the terminal window to update your working environment. -### 6. Install the Python ECDSA library (offline install only) +### 6. Install the Python ECDSA library (offline install only) On your online machine: @@ -239,7 +239,7 @@ Copy the downloaded file to your offline machine and install: $ pip3 install --user ecdsa-*.whl -### 7. Install the standalone scrypt package (required for strong password hashing) +### 7. Install the standalone scrypt package (required for strong password hashing) Thanks to a faulty implementation of the `scrypt` function included in Python’s `hashlib`, the standalone `scrypt` module is required for stronger-than-default @@ -271,7 +271,7 @@ Save the file and exit the editor. Now build and install: $ python3 setup.py install --user -### 8. Clone and copy the secp256k1 library (offline install only) +### 8. Clone and copy the secp256k1 library (offline install only) On your online machine, clone the secp256k1 repository from Github: @@ -284,7 +284,7 @@ directory into it: $ cp -a /path/to/secp256k1/repo/secp256k1 ~/.cache/mmgen $ ls ~/.cache/mmgen/secp256k1/autogen.sh # check that the location is correct -### 9. Install MMGen +### 9. Install MMGen Now you’re ready to install MMGen itself. On your online machine, clone the repository: @@ -316,7 +316,7 @@ documentation. occasion. Note that MMGen has a test suite. Refer to the [Test Suite][ts] wiki page for details. -### 10. Install Python Ethereum dependencies (Ethereum users only) +### 10. Install Python Ethereum dependencies (Ethereum users only) If you’ll be using MMGen with Ethereum, then you must install a few dependencies. From the MMGen repository root, type the following: @@ -332,7 +332,7 @@ directory containing the files and install them as follows: $ pip3 install --no-deps --user *.whl -### 11. Install and launch your coin daemons +### 11. Install and launch your coin daemons At this point your MMGen installation will be able to generate wallets, along with keys and addresses for all supported coins. However, if you intend to do @@ -358,7 +358,7 @@ Please note that Ethereum daemons perform rather poorly under Windows due to threading limitations. Unless you have very fast hardware, transacting and syncing the blockchain might be painfully slow. -### 12. You’re done! +### 12. You’re done! Congratulations, your installation is now complete, and you can proceed to [**Getting Started with MMGen**][gs]. Note that all features supported by @@ -371,9 +371,9 @@ Please be aware of the following, however: + The Bitcoin Cash Node daemon cannot handle non-ASCII pathnames. This is an issue with the Bitcoin Cash Node implementation for Windows, not MMGen. -## Keeping your installation up to date +## Keeping your installation up to date -### MSYS2 +### MSYS2 You should periodically upgrade your MSYS2 installation, especially when [new releases][mh] of the installer appear. You can check your currently installed @@ -386,7 +386,7 @@ parts relating to downloading and editing mirrorlists. Note that [Step 4](#a_md) need not be performed, as the MMGen dependencies are already in `pacman`’s database. -### MMGen +### MMGen You should periodically upgrade your MMGen installation from the MMGen public repository, especially when [new releases][mr] appear. You can check your diff --git a/Recovering-Your-Keys-Without-the-MMGen-Software.md b/Recovering-Your-Keys-Without-the-MMGen-Software.md index e5b175c..6fcedaf 100644 --- a/Recovering-Your-Keys-Without-the-MMGen-Software.md +++ b/Recovering-Your-Keys-Without-the-MMGen-Software.md @@ -10,7 +10,7 @@ * [Base-conversion utility](#a_bcu) * [Converting an MMGen mnemonic to hexadecimal format](#a_mh) -#### Introduction +#### Introduction If you’re considering using MMGen and are a Bitcoiner with a normal, healthy degree of paranoia, then the following question will probably come to mind: @@ -27,7 +27,7 @@ combination of circumstances ever occurs. In addition to private keys, this tutorial can also be used to recover passwords generated with the `mmgen-passgen` command. -#### Obtaining the binary seed +#### Obtaining the binary seed To keep things simple, we’ll assume you have a copy of your seed in hexadecimal (mmhex) format. If your backup’s in mnemonic format, skip to the section @@ -73,7 +73,7 @@ into Bitcoin Core or some other wallet. We’ll solve this task using standard command-line utilities available on any Linux or other Unix-like system. -#### Convert the seed to binary (legacy uncompressed addresses) +#### Convert the seed to binary (legacy uncompressed addresses) For the legacy addresses, we begin by converting the seed to binary form and storing it in a file. For that we use `xxd`, a handy tool for converting binary @@ -82,7 +82,7 @@ remove the spaces: $ echo 456d7f5f1c4bfe3bc916b87560ae6a3e | xxd -r -p > myseed.bin -#### Scramble the seed and save to binary (non-legacy and altcoin addresses and passwords) +#### Scramble the seed and save to binary (non-legacy and altcoin addresses and passwords) Other address types and passwords are generated by first “scrambling” the seed with a unique identifier, or “scramble string”, using the HMAC-SHA256 @@ -141,7 +141,7 @@ Now add the ten rounds of sha256: done $ mv scrambled-round10.bin myseed.bin -#### Generating the keys +#### Generating the keys The MMGen key-generating algorithm uses a chain of SHA-512 hashes with double SHA-256 branches to generate the keys from which each address is derived. To @@ -161,7 +161,7 @@ A double SHA-256 hash of the first link gives us the key of our first address: # or, for the password example: bd60b8ba034bbb40498667ee600bc0cc0b99eb19164e8d412a48f16da4e00d6b -#### Checking the result (optional, address example) +#### Checking the result (optional, address example) With `mmgen-tool`, we can easily generate the WIF key and address from this hexadecimal key and see that it’s correct: @@ -203,7 +203,7 @@ And so on and so forth, until we’ve generated all the keys we need: three, in If we’re generating keys for Ethereum and Monero, our work is done: the raw hexadecimal keys are all we need. Otherwise, read on. -#### Converting the hex value to a password (password example) +#### Converting the hex value to a password (password example) If it’s passwords we’re generating, we must now convert our hex key to the desired password format, base58 in our case. For this we can use the homemade @@ -217,7 +217,7 @@ The password is just the last 20 characters of the output: dTsCiRq4ZLMMD5WQVAvv -#### Hex to WIF by hand (address example) +#### Hex to WIF by hand (address example) Since we’ve chosen to convert our hex keys to WIF format manually, we have a bit of work ahead of us. Let’s begin with our just-generated key #1 from seed @@ -304,7 +304,7 @@ clearer: result = numtob58(num) -#### Base-conversion utility +#### Base-conversion utility Adapting our code a bit and putting it in a file gives us have a handy conversion utility we can use for any key: @@ -323,7 +323,7 @@ conversion utility we can use for any key: $ ./hex2b58.py 80b8e58ded53e9ba5a9f4e279a956c061a7da5487bde6a95f1ede0722d287881a00189bba812 L3R8Fn21PsY3PWgT8BMggFwXswA2EZntwEGFS5mfDJpSiLq29a9F -#### Converting an MMGen mnemonic to hexadecimal format +#### Converting an MMGen mnemonic to hexadecimal format Our familiar base-10 system uses a series of ten symbols known as digits to represent numbers from zero to nine: diff --git a/XOR-Seed-Splitting:-Theory-and-Practice.md b/XOR-Seed-Splitting:-Theory-and-Practice.md index 765a7ef..de2ebcc 100644 --- a/XOR-Seed-Splitting:-Theory-and-Practice.md +++ b/XOR-Seed-Splitting:-Theory-and-Practice.md @@ -6,7 +6,7 @@ - [Master Shares](#a_ms) + [Seed Splitting with MMGen](#a_ss) -### XOR Seed Splitting: A Theoretical Introduction +### XOR Seed Splitting: A Theoretical Introduction The bitwise exclusive-or operation (usually denoted as `XOR`, or “![⊕]”) has interesting properties that make it very useful in cryptography. @@ -94,7 +94,7 @@ Join shares 1 through *n* to recover the seed: Knowledge of any combination of *n*-1 shares reveals nothing about the seed. -#### Deterministic Shares +#### Deterministic Shares So we’ve seen that the mathematics behind XOR seed splitting is basically trivial. In practice, though, there are several issues that need to be @@ -160,7 +160,7 @@ algorithm is ideally suited for this: Using these unique pseudorandom values, we can now split and rejoin our seed in the manner described at the end of the previous section. -#### Named Splits +#### Named Splits Now, we’d like to use seed splitting as part of our backup strategy, entrusting shares of our seed with various people we know. Multiple 2-way splits seems @@ -197,7 +197,7 @@ Create a 4-way split “friends” with Bob, Alice and Carol: Thus we’ve ensured the uniqueness of all shares across all possible splits. -#### Master Shares +#### Master Shares As the number of splits we create grows, the question of how to store our shares becomes especially problematic. Each new split creates another new share that @@ -235,7 +235,7 @@ Also note that an additional field, `master`, has been appended to the share identifiers. This is to ensure that the shares of each master share split are unique, and differ from their non-master-share counterparts. -### Seed Splitting with MMGen +### Seed Splitting with MMGen The MMGen wallet implements the seed splitting and joining functionality described above via the commands [`mmgen-seedsplit`][SS] and