Command Line Usage¶
HWI is primarily used from the command line.
Users can use the hwi
command directly, or the HWI self-contained binaries can be distributed with third party software and executed by the software.
The usage of hwi
can be found with hwi --help
.
hwi¶
Hardware Wallet Interface, version 2.0.2. Access and send commands to a hardware wallet device. Responses are in JSON format.
usage: hwi [-h] [--device-path DEVICE_PATH] [--device-type DEVICE_TYPE]
[--password PASSWORD] [--stdinpass]
[--chain {main,test,regtest,signet}] [--debug]
[--fingerprint FINGERPRINT] [--version] [--stdin] [--interactive]
[--expert]
{enumerate,getmasterxpub,signtx,getxpub,signmessage,getkeypool,getdescriptors,displayaddress,setup,wipe,restore,backup,promptpin,togglepassphrase,sendpin,installudevrules}
...
optional arguments¶
- -h, --help¶
show this help message and exit
- --device-path <device_path>, -d <device_path>¶
Specify the device path of the device to connect to
- --device-type <device_type>, -t <device_type>¶
Specify the type of device that will be connected. If –device-path not given, the first device of this type enumerated is used.
- --password <password>, -p <password>¶
Device password if it has one (e.g. DigitalBitbox)
- --stdinpass¶
Enter the device password on the command line
- --chain {main,test,regtest,signet}¶
Select chain to work with
- --debug¶
Print debug statements
- --fingerprint <fingerprint>, -f <fingerprint>¶
Specify the device to connect to using the first 4 bytes of the hash160 of the master public key. It will connect to the first device that matches this fingerprint.
- --version¶
show program’s version number and exit
- --stdin¶
Enter commands and arguments via stdin
- --interactive, -i¶
Use some commands interactively. Currently required for all device configuration commands
- --expert¶
Do advanced things and get more detailed information returned from some commands. Use at your own risk.
hwi backup¶
usage: hwi backup [-h] [--label LABEL] [--backup_passphrase BACKUP_PASSPHRASE]
- -h, --help¶
show this help message and exit
- --label <label>, -l <label>¶
The name to give to the device
- --backup_passphrase <backup_passphrase>, -b <backup_passphrase>¶
The passphrase to use for the backup, if applicable
hwi displayaddress¶
usage: hwi displayaddress [-h] (--desc DESC | --path PATH)
[--addr-type {legacy,wit,sh_wit}]
- -h, --help¶
show this help message and exit
- --desc <desc>¶
Output Descriptor. E.g. wpkh([00000000/84h/0h/0h]xpub…/0/0), where 00000000 must match –fingerprint and xpub can be obtained with getxpub. See doc/descriptors.md in Bitcoin Core
- --path <path>¶
The BIP 32 derivation path of the key embedded in the address, default follows BIP43 convention, e.g.
m/84h/0h/0h/1/*
- --addr-type {legacy,wit,sh_wit}¶
The address type to display
hwi getdescriptors¶
usage: hwi getdescriptors [-h] [--account ACCOUNT]
- -h, --help¶
show this help message and exit
- --account <account>¶
BIP43 account
hwi getkeypool¶
usage: hwi getkeypool [-h] [--keypool | --nokeypool] [--internal]
[--addr-type {legacy,wit,sh_wit} | --all]
[--account ACCOUNT] [--path PATH]
start end
- start¶
The index to start at.
- end¶
The index to end at.
- -h, --help¶
show this help message and exit
- --keypool¶
Indicates that the keys are to be imported to the keypool
- --nokeypool¶
Indicates that the keys are not to be imported to the keypool
- --internal¶
Indicates that the keys are change keys
- --addr-type {legacy,wit,sh_wit}¶
The address type (and default derivation path) to produce descriptors for
- --all¶
Generate addresses for all standard address types (default paths:
m/{44,49,84}h/0h/0h/[0,1]/*)
- --account <account>¶
BIP43 account
- --path <path>¶
Derivation path, default follows BIP43 convention, e.g.
m/84h/0h/0h/1/*
with –addr-type wpkh –internal. If this argument and –internal is not given, both internal and external keypools will be returned.
hwi getmasterxpub¶
usage: hwi getmasterxpub [-h] [--addr-type {legacy,wit,sh_wit}]
[--account ACCOUNT]
- -h, --help¶
show this help message and exit
- --addr-type {legacy,wit,sh_wit}¶
Get the master xpub used to derive addresses for this address type
- --account <account>¶
The account number
hwi getxpub¶
usage: hwi getxpub [-h] path
- path¶
The BIP 32 derivation path to derive the key at
- -h, --help¶
show this help message and exit
hwi installudevrules¶
usage: hwi installudevrules [-h] [--location LOCATION]
- -h, --help¶
show this help message and exit
- --location <location>¶
The path where the udev rules files will be copied
hwi restore¶
usage: hwi restore [-h] [--word_count WORD_COUNT] [--label LABEL]
- -h, --help¶
show this help message and exit
- --word_count <word_count>, -w <word_count>¶
Word count of your BIP39 recovery phrase (options: 12/18/24)
- --label <label>, -l <label>¶
The name to give to the device
hwi sendpin¶
usage: hwi sendpin [-h] pin
- pin¶
The numeric positions of the PIN
- -h, --help¶
show this help message and exit
hwi setup¶
usage: hwi setup [-h] [--label LABEL] [--backup_passphrase BACKUP_PASSPHRASE]
- -h, --help¶
show this help message and exit
- --label <label>, -l <label>¶
The name to give to the device
- --backup_passphrase <backup_passphrase>, -b <backup_passphrase>¶
The passphrase to use for the backup, if applicable
hwi signmessage¶
usage: hwi signmessage [-h] message path
- message¶
The message to sign
- path¶
The BIP 32 derivation path of the key to sign the message with
- -h, --help¶
show this help message and exit