This is the third major version (v3) of psf-bch-wallet command-line wallet for Bitcoin Cash (BCH) and SLP tokens.
Version 2 is archived in the psf-bch-wallet-v2 repository.
This software requires node.js v20 or higher. Instructions for installation:
git clone https://github.com/Permissionless-Software-Foundation/psf-bch-wallet
cd psf-bch-wallet
npm install
node psf-bch-wallet.js help
Create a new BCH wallet:
node psf-bch-wallet.js wallet-create -n wallet1 -d "My first wallet"
- Use the
-n
flag to give your wallet a name (required). - And the
-d
flag to give it a description (optional).
List the wallets managed by this application:
node psf-bch-wallet.js wallet-list
- none
Display the addresses for receiving funds to this wallet:
node psf-bch-wallet.js wallet-addrs -n wallet1
- Use the
-n
flag to specify which wallet to use (required).
Check the balance of BCH and SLP tokens held by this wallet.
node psf-bch-wallet.js wallet-balance -n wallet1
- Use the
-n
flag to specify the wallet to check (required).
Use these commands to send BCH and SLP tokens.
Send BCH from the wallet to another address.
node psf-bch-wallet.js send-bch -n wallet1 -q 0.00001 -a bitcoincash:qr2zqrnqdulfmeqs2qe9c5p605lrwe90v5v735s2jl
- Use the
-n
flag to specify the wallet holding BCH (required). - Use the
-q
flag to specify the quantity to send in BCH (required). - Use the
-a
flag to specify the receiver of the BCH (required).
Send an SLP token from the wallet to another address.
node psf-bch-wallet.js send-tokens -n wallet1 -q 0.5 -a simpleledger:qrnwvazrjzytmlv9wyvj4pkkc9k2l0fhvs8u479asy -t 38e97c5d7d3585a2cbf3f9580c82ca33985f9cb0845d4dcce220cb709f9538b0
- Use the
-n
flag to specify the wallet holding tokens (required). - Use the
-q
flag to specify the quantity of tokens to send (required). - Use the
-a
flag to specify the receiver of the tokens (required). - Use the
-t
flag to specify the token ID of the token to send (required).
Use these commands to sign a message to prove ownership of a BCH address, and conversely to verify that a signature is valid.
Sign a message with the private key of a wallet.
node psf-bch-wallet.js msg-sign -n wallet1 -m "test message"
- Use the
-n
flag to specify the wallet holding tokens (required). - Use the
-m
flag to specify a message to sign (required).
Use a signed message to verify that the send possess the private key associated with the public address.
node psf-bch-wallet.js msg-verify -a bitcoincash:qr2zqrnqdulfmeqs2qe9c5p605lrwe90v5v735s2jl -m "This is a test message" -s IOdfv+TQNCNIEJ4uvcUJmX9ZCEbkNNv9ad+TLO/JJxzeWDhqx42iBXMPEnthldl9wGx/Fwdjwp1w9532mSXzENM=
- Use the
-a
flag to specify the BCH address you are verifying ownership of (required). - Use the
-m
flag to specify the clear text message that was signed (required). - Use the
-s
flag to specify the signature to be verified (required).
psf-bch-wallet v2 became too large in scope and as a result the code base grew too complex. The code was also stuck in CommonJS format. Version 3 uses ESM format, and strives to create a much simpler code base, which can be forked to add on new use-cases and thereby grow in scope in a more controlled fashion.
v2 also used the oclif CLI framework, which no longer provides good support for JavaScript-native software. v3 has switched to the Commander.js library.