16 releases (10 breaking)

0.12.2 May 24, 2024
0.12.1 Feb 4, 2024
0.12.0 Jan 31, 2024
0.9.0 Nov 28, 2023
0.3.0 Jun 13, 2022

#14 in #connected

Download history 45/week @ 2024-06-29 98/week @ 2024-07-06 219/week @ 2024-07-13 92/week @ 2024-07-20 171/week @ 2024-07-27 71/week @ 2024-08-03 58/week @ 2024-08-10 151/week @ 2024-08-17 137/week @ 2024-08-24 320/week @ 2024-08-31 451/week @ 2024-09-07 204/week @ 2024-09-14 88/week @ 2024-09-21 133/week @ 2024-09-28 123/week @ 2024-10-05 182/week @ 2024-10-12

559 downloads per month
Used in 5 crates (3 directly)

MIT license

76KB
2K SLoC

Coldcard Interface Library

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

Usage

use coldcard::protocol;

// create an API instance
let mut api = coldcard::Api::new()?;

// detect all connected Coldcards
let serials = api.detect()?;

// get the first serial and open it
let (mut cc, master_xpub) = api.open(&serials[0], None)?;

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

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

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

// secure logout
cc.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/. This can be installed using the CLI tool.

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 crate's own README 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.

Dependencies

~4–13MB
~124K SLoC