nem-toolchain Command line toolchain for NEM blockchain


nem-toolchain is a command-line toolchain for NEM blockchain.

Main features:

  • Generate new accounts for mijin, mainnet, testnet.
  • Show accounts details for any given private key.
  • Find vanity address by a given list of prefixes.

Quick demo:

Quick Start

nem-toolchain is distributed in a binary form and can be installed manually via the tarball releases or one of the options below.

The quickest way to get nem is to run the following command, which installs to the local bin by default.

$ curl -sL | bash

Or, if you want to lock at specific version:

$ curl -sL | VERSION=vX.Y.Z bash

Verify installation with:

$ bin/nem -v

You can include the bin directory in your PATH to simplify further usage:

export PATH=$PATH:./bin

Environment Variables

nem-toolchain can use environment variable NEM_CHAIN to know about used chain by default:

$ export NEM_CHAIN=testnet

There is also the shorter alternative for NEM_CHAIN - CHAIN.


To view details for a nem command at any time use nem help or nem help <command>.

   nem - command-line toolchain for NEM blockchain

   nem [global options] command [command options] [arguments...]

   0.2.0 (5d14f67a97402e9c0e2565071106ca41dbff6a6f / 2017-10-05T11:01:08Z)

     account  Account related bundle of actions
     help, h  Shows a list of commands or help for one command

   --chain CHAIN  chain id from CHAIN: [mainnet|mijin|testnet] (default: "mainnet") [$NEM_CHAIN, $CHAIN]
   --help, -h     show help
   --version, -v  print the version


Account related bundle of actions.

   nem account - Account related bundle of actions

   nem account command [command options] [arguments...]

     generate  Generate a new account
     info      Show info for given account
     vanity    Find vanity address by a given list of prefixes

   --help, -h  show help


New accounts

How to create a new account for testnet:

$ nem --chain testnet account generate
Public key: bda2ddf2cdb65267aad0032435c5669f4391f02c681aed62b06762ddda97f1c1
Private key: 7d77192b3cc6f3770ffae4f7a85f3c40bca1256abfa1e59a3cf57cefd260af80

Instead of option you can specify the desired network via environment variables:

$ NEM_CHAIN=testnet nem account generate

How to create multiple accounts and strip the output to private keys only:

$ nem --chain testnet account generate -n 2 --strip

Accounts info

How to show account details by given zero private key for testnet:

$ echo "0000000000000000000000000000000000000000000000000000000000000000" |\
    nem --chain testnet account info
Public key: 462ee976890916e54fa825d26bdd0235f5eb5b6a143c199ab0ae5ee9328e08ce
Private key: 0000000000000000000000000000000000000000000000000000000000000000

You can also constraint the command output to show only public key (--public) or public address (--address).

Vanity address

How to find vanity address with predefined prefix TCGQQK for testnet using a placeholder character _ and a non-significant delimiter character -:

$ nem --chain testnet account vanity --skip-estimate TCGQQK-______
Public key: c342dbf7cdd3096c4c3910c511a57049e62847dd5030c7e644bc855acc1fd626
Private key: 4e017065d62f10223b989ff3f75a845fbe3df73d6c0e6d67cc4c59bea3213002

If you would like to search for multiple prefixes at the same time and without digits at all:

$ nem --chain testnet account vanity --skip-estimate --no-digits TABC TACB TBAC TBCA TCAB TCBA
Public key: bb326c920bb5b42d5d99df602bb82fdcdd922911ef3b46e73af654babba43698
Private key: 2d9a61cee0a3b210c2cde438b7f620931049320fd8dffbda04e28e9dd0fbfdef

Or you can go further and customize excluded characters and define prefixes with the help of brace expansion mechanism:

> nem --chain testnet account vanity --exclude 246 _{ABC,ACB,BAC,BCA,CAB,CBA}
Calculate accounts rate... 18475 accounts/sec
Estimate search times: 0s (50%), 2s (80%), 5s (99.9%)
Public key: b2b32e526d9105d937c731d1a0f470acfae8ce1bc22f100d1210f962557feda0
Private key: 6720d6a3d1601684c648d3f1fc2aa1109cb655c3fe0f86e458e55f8d7319b1e7

As you can see from the last output, nem-toolchain can show specified search complexity and calculates estimate times for three predefined accuracies: 50%, 80% and 99.9%.

Important notes:

  1. Mainnet addresses start with N, Mijin - with M, Testnet - with T.
  2. Second symbols are A, B, C, or D only, so for mainnet you won’t find addresses that start with NE or N4.
  3. The digits 0, 1, 8 and 9 are not part of Base32 encoding and will not appear in any address.


If you have general questions about NEM blockchain, please take a look at official FAQs.

Where can I download the official client?

NEM NanoWallet here.