15 releases (breaking)

0.12.1 Feb 4, 2024
0.11.1 Jan 24, 2024
0.9.0 Nov 28, 2023
0.8.0 Jul 8, 2023
0.3.0 Jun 13, 2022

#2875 in Magic Beans

Download history 3/week @ 2024-01-05 6/week @ 2024-01-19 8/week @ 2024-01-26 6/week @ 2024-02-16 67/week @ 2024-02-23 15/week @ 2024-03-01 4/week @ 2024-03-08 3/week @ 2024-03-15

90 downloads per month

MIT license

155KB
2.5K SLoC

Coldcard CLI

coldcard-cli is a firmware upgrade and general management tool for the Coldcard hardware wallet.

Install it with:

$ cargo install coldcard-cli

Demo

Usage:

$ coldcard --help

coldcard-cli 0.12.0
Coldcard Wallet CLI Tool

USAGE:
    coldcard [OPTIONS] <SUBCOMMAND>

OPTIONS:
    -h, --help               Print help information
        --serial <SERIAL>    The Coldcard serial number to operate on (default: first one found)
    -V, --version            Print version information
        --xpub <XPUB>        Perform a MITM check against an xpub

SUBCOMMANDS:
    address               Show the address for a derivation path
    auth-token            Authenticate a specific user using a 6-digit token (for HSM)
    backup                Initiate the backup process and create an encrypted 7z file
    bag                   Show the bag number the Coldcard arrived in
    chain                 Show the configured blockchain
    delete-user           Delete a specific HSM user
    help                  Print this message or the help of the given subcommand(s)
    hsm                   Show the current HSM policy
    hsm-start             Starts the HSM mode (with a specific policy)
    install-udev-rules    Installs the udev file required to detect Coldcards on Linux
    list                  List the serial numbers of connected Coldcards
    local-conf            Generate a 6-digit code for PSBT signing in HSM mode
    locker                Get the hex contents of the storage locker (HSM mode only)
    logout                Securely log out of the Coldcard
    message               Sign a text message with a specific derivation path
    passphrase            Set a BIP39 passphrase
    pubkey                Show the pubkey for a derivation path
    reboot                Reboot the Coldcard
    sign                  Sign a spending PSBT transaction
    test                  Test USB connection
    upgrade               Download and upgrade to the latest firmware, or upgrade from file
    user                  Create a new HSM user. The secret is generated on the device
    version               Show the version information of this Coldcard
    xfp                   Show the master fingerprint for this wallet
    xpub                  Show the xpub (default: master)

Linux Specific Instructions

In order to be able to detect a Coldcard device on a Linux system, 51-coinkite.rules must be placed in /etc/udev/rules.d/. This can also be achieved using the install-udev-rules command.

Two mutually exclusive HID backends are supported and can be turned on using the following features:

  • coldcard/linux-static-hidraw (default)
  • coldcard/linux-static-libusb (potential issues with unclear error messages)

Logging

To see log output, run the program with the RUST_LOG=$level environment variable. This uses the env_logger crate.

Library

This project also offers a Rust library. See the coldcard crate for more information.

Contributing

Contributions are welcome. Before making large changes, please open an issue first.

Disclaimer

This is not an official project and comes with no warranty whatsoever.

Dependencies

~12–23MB
~346K SLoC