A hacker-friendly, command line BCH and SLP wallet built with bch-js
Last updated a day ago by chris.troutner .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install slp-cli-wallet 
SYNC missed versions from official npm registry.

Warning: This is an experimental 'hacker-friendly' wallet. It has been tested only for the most common use-cases. It has been known to burn SLP tokens. Do not use this wallet for tokens with value.


This is an npm library and Bitcoin Cash (BCH) wallet that runs on the command line. Add this library to your app to instantly give it the ability to transact on the BCH network! New to Bitcoin Cash? Learn the basics with Mastering Bitcoin Cash.

This project has the following goals:

  • Create a code base for a wallet that is easily forkable and extensible by JavaScript developers.
  • Provide a high-level abstraction to make it easy for new developers to add BCH and SLP wallet functionality into their apps.

If you want a wallet with a graphical user interface, check out Badger Wallet. BCH functionality is implemented in both wallets with BITBOX, and the command line interface for this project is built with oclif.

Also, be sure to check out the design decisions and trade-offs that went into the creation of this project in the docs directory

Build Status Coverage Status semantic-release Greenkeeper badge

NPM Usage

The npm library can be included in your own app to instantly give it the ability to send and receive BCH transactions, including SLP tokens. Here is an example of how to include it in your own app. This example will generate a new HD wallet.

// Instantiate the Create Wallet class from this library.
const CreateWallet = require('slp-cli-wallet/src/commands/create-wallet')
const createWallet = new CreateWallet()

const walletFile = './wallet.json'

async function makeNewWallet() {
  const wallet = await createWallet.createWallet(walletFile)

  console.log(`wallet: ${JSON.stringify(wallet,null,2)}`)

Install Dev Environment

While this npm library can be used globally, the intended audience is developers familiar with the usage of npm and git. Here is how to set up your own developer environment:

  • Clone this repo with git clone.
  • Install npm dependencies with npm install
  • Execute the commands like this: ./bin/run help

Running the wallet this way, you can edit the behavior of the wallet by making changes to the code in the src/commands directory.

Command Line Usage

$ npm install -g slp-cli-wallet
$ slp-cli-wallet COMMAND
running command...
$ slp-cli-wallet (-v|--version|version)
slp-cli-wallet/2.0.6 linux-x64 node-v10.20.1
$ slp-cli-wallet --help [COMMAND]
  $ slp-cli-wallet COMMAND


slp-cli-wallet burn-tokens

Burn SLP tokens.

  $ slp-cli-wallet burn-tokens

  -n, --name=name        Name of wallet
  -q, --qty=qty
  -t, --tokenId=tokenId  Token ID

See code: src/commands/burn-tokens.js

slp-cli-wallet create-wallet

Generate a new HD Wallet.

  $ slp-cli-wallet create-wallet

  -n, --name=name  Name of wallet
  -t, --testnet    Create a testnet wallet

See code: src/commands/create-wallet.js

slp-cli-wallet derivation

Display or set the derivation path used by the wallet.

  $ slp-cli-wallet derivation

  -n, --name=name  name to print
  -s, --save=save  save a new derivation path

  This command is used to display the derivation path used by the wallet. The -s
  flag can be used to save a new derivation path.

  Common derivation paths used:
  145 - BIP44 standard path for Bitcoin Cash
  245 - BIP44 standard path for SLP tokens
  0 - Used by common software like the wallet and

  Wallets use the 245 derivation path by default.

See code: src/commands/derivation.js

slp-cli-wallet get-address

Generate a new address to recieve BCH.

  $ slp-cli-wallet get-address

  -n, --name=name  Name of wallet
  -t, --token      Generate a simpledger: token address

See code: src/commands/get-address.js

slp-cli-wallet get-key

Generate a new private/public key pair.

  $ slp-cli-wallet get-key

  -n, --name=name  Name of wallet

See code: src/commands/get-key.js

slp-cli-wallet hello

Example command from oclif

  $ slp-cli-wallet hello

  -n, --name=name  name to print

  Leaving it here for future reference in development.

See code: src/commands/hello.js

slp-cli-wallet help [COMMAND]

display help for slp-cli-wallet

  $ slp-cli-wallet help [COMMAND]

  COMMAND  command to show help for

  --all  see all commands in CLI

See code: @oclif/plugin-help

slp-cli-wallet list-wallets

List existing wallets.

  $ slp-cli-wallet list-wallets

See code: src/commands/list-wallets.js

slp-cli-wallet remove-wallet

Remove an existing wallet.

  $ slp-cli-wallet remove-wallet

  -n, --name=name  Name of wallet

See code: src/commands/remove-wallet.js

slp-cli-wallet send

Send an amount of BCH

  $ slp-cli-wallet send

  -a, --sendAddr=sendAddr  Cash address to send to
  -b, --bch=bch            Quantity in BCH
  -n, --name=name          Name of wallet

See code: src/commands/send.js

slp-cli-wallet send-all

Send all BCH in a wallet to another address. Degrades Privacy

  $ slp-cli-wallet send-all

  -a, --sendAddr=sendAddr  Cash address to send to
  -i, --ignoreTokens       Ignore and burn tokens
  -n, --name=name          Name of wallet

  Send all BCH in a wallet to another address.

  This method has a negative impact on privacy by linking all addresses in a
  wallet. If privacy of a concern, CoinJoin should be used.
  This is a good article describing the privacy concerns:

See code: src/commands/send-all.js

slp-cli-wallet send-tokens

Send SLP tokens.

  $ slp-cli-wallet send-tokens

  -a, --sendAddr=sendAddr  Cash or SimpleLedger address to send to
  -n, --name=name          Name of wallet
  -q, --qty=qty
  -t, --tokenId=tokenId    Token ID

See code: src/commands/send-tokens.js

slp-cli-wallet sign-message

Sign message

  $ slp-cli-wallet sign-message

  -i, --sendAddrIndex=sendAddrIndex    Adress index
  -n, --name=name                      Name of wallet
  -s, --signTheMessage=signTheMessage  Sign message

See code: src/commands/sign-message.js

slp-cli-wallet sweep

Sweep a private key

  $ slp-cli-wallet sweep

  -a, --address=address  Address to sweep funds to.
  -b, --balanceOnly      Balance only, no claim.
  -t, --testnet          Testnet
  -w, --wif=wif          WIF private key

  Sweeps a private key in WIF format.
  Supports SLP token sweeping, but only one token class at a time. It will throw
  an error if a WIF contains more than one class of token.

See code: src/commands/sweep.js

slp-cli-wallet update-balances

Poll the network and update the balances of the wallet.

  $ slp-cli-wallet update-balances

  -i, --ignoreTokens  Ignore and burn tokens
  -n, --name=name     Name of wallet

See code: src/commands/update-balances.js

Current Tags

  • 2.0.6                                ...           latest (a day ago)

27 Versions

  • 2.0.6                                ...           a day ago
  • 2.0.5                                ...           15 days ago
  • 2.0.4                                ...           a month ago
  • 2.0.3                                ...           2 months ago
  • 2.0.2                                ...           3 months ago
  • 1.9.5                                ...           3 months ago
  • 1.9.4                                ...           3 months ago
  • 1.9.3                                ...           4 months ago
  • 1.9.2                                ...           5 months ago
  • 1.9.1                                ...           5 months ago
  • 1.9.0                                ...           5 months ago
  • 1.8.0                                ...           6 months ago
  • 1.7.12                                ...           6 months ago
  • 1.7.11                                ...           6 months ago
  • 1.7.10                                ...           6 months ago
  • 1.7.9                                ...           7 months ago
  • 1.7.8                                ...           8 months ago
  • 1.7.7                                ...           8 months ago
  • 1.7.6                                ...           8 months ago
  • 1.7.5                                ...           8 months ago
  • 1.7.4                                ...           8 months ago
  • 1.7.3                                ...           8 months ago
  • 1.7.2                                ...           8 months ago
  • 1.7.1                                ...           8 months ago
  • 1.7.0                                ...           8 months ago
  • 1.6.0                                ...           8 months ago
  • 1.5.0                                ...           8 months ago
Maintainers (1)
Today 0
This Week 9
This Month 9
Last Day 9
Last Week 0
Last Month 11
Dependencies (9)
Dev Dependencies (14)
Dependents (0)

Copyright 2014 - 2017 © |