coldcard 0.6.0

Coldcard Wallet Interface Library in Rust
Documentation

Coldcard Interface Library

coldcard is a library for interfacing with the Coldcard hardware wallet.

Usage

use coldcard::protocol;

// detect all connected Coldcards
// (do not forget to set the required udev rule on Linux -- see below)
let serials = coldcard::detect()?;

// open a particular one
let (mut coldcard, master_xpub) = serials[0].open(None)?;

// set a passphrase
coldcard.set_passphrase(protocol::Passphrase::new("secret")?)?;

// after the user confirms
let xpub = coldcard.get_passphrase_done()?;

if let Some(xpub) = xpub {
    println!("The new XPUB is: {}", xpub);
}

// secure logout
coldcard.logout()?;

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/.

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

Logging

The log feature enables logging using the log crate. Disabled by default. Use judiciously as logging can leak details into the environment.

CLI

This project also offers a CLI tool. See the project's own crate for more information.

Install it with:

$ cargo install coldcard-cli

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.