A CLI Mutisig HD Bitcoin Wallet, demo for Bitcore Wallet Service
npm install bitcor-wallet
A simple Command Line Interface Wallet using Bitcore Wallet Service and its official client lib Bitcore Wallet Client.
This can be used to operate Bitcoin and Bitcoin Cash wallets.
``shUse -h or BWS_HOST to setup the BWS URL (defaults to localhost:3001)
#Start a local BWS instance be doing:
git clone https://github.com/bitpay/bitcore/tree/master/packages/bitcore-wallet-service.git bws
cd bws; npm install; npm start
cd bin
* Wallet my wallet [livenet]: 2-of-2 pending
Missing copayers: 1
export WALLET_FILE=pete.dat
wallet status
It is also possible to use Payment Protocol or BIP21. Examples:
wallet send 'bitcoin:?r=https://bitpay.com/i/8rR7ydnLfQGqnRW1mqvXxJ'
wallet send 'bitcoin:1N4zjmp1ojRborDiAu62MyCpaz9wjhPLM?amount=1'
Password protection
It is possible (and recommeded) to encrypt the wallet's credentials (.dat file). this is done be adding the
-p parameter to join or create or genkey. The password will be asked interactively. Following commands that use the crendetials will require the password to work.Password-based key derivation function 2 (PBKDF2) is used to derive the key to encrypt the data. AES is used to do the actual encryption, using the implementation of SJCL.
Airgapped Operation
Air gapped (non connected) devices are supported. This setup can be useful if maximum security is needed, to prevent private keys from being compromised. In this setup, a device is installed without network access, and transactions are signed off-line. Transactions can be pulled from BWS using a
proxy device, then downloaded to a pendrive to be moved to the air-gapped device, signed there, and then moved back the proxy device to be sent back to BWS. Note that Private keys are generated off-line in the airgapped device.`sh
On the Air-gapped device
Generate extended private key (add -t for testnet)
airgapped$ wallet genkey
* Livenet Extended Private Key Created.airgapped$ wallet export -o toproxy --nosign
* Wallet data saved at toproxy without signing capability.
On the proxy machine
proxy$ wallet import toproxy
* Wallet Imported without signing capability.
proxy$ wallet join # Or wallet create
proxy$ wallet address
proxy$ wallet balanceIt is not possible to sign transactions from the proxy device
proxy$ wallet sign
[Error: You do not have the required keys to sign transactions]Export pending transaction to be signed offline
proxy$ wallet txproposals -o txproposals.datBack to air-gapped device
Sign them
airgapped$ wallet airsign txproposals.dat -o signatures.datNOTE: To allow the airgapped device to check the transaction proposals being signed, the public keys of the copayers will be imported from the txproposals archive. That information is exported automatically by the proxy machine, and encrypted using copayer's xpriv derivatives.
Back to proxy machine
Send signatures to BWS
proxy$ wallet sign -i signatures.dat
Transaction 014255.... signed by you.
``See CONTRIBUTING.md on the main bitcore repo for information about how to contribute.
Code released under the MIT license.
Copyright 2013-2019 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.