Crates.io | coldcard |
lib.rs | coldcard |
version | 0.12.2 |
source | src |
created_at | 2022-04-05 04:10:14.849181 |
updated_at | 2024-05-24 00:08:38.1801 |
description | Coldcard Wallet Interface Library in Rust |
homepage | |
repository | https://github.com/alfred-hodler/rust-coldcard/ |
max_upload_size | |
id | 562417 |
size | 76,376 |
coldcard
is a library for interfacing with the Coldcard hardware wallet over USB.
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()?;
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:
linux-static-hidraw
(default)linux-static-libusb
(potential issues with unclear error messages)The log
feature enables logging using the log
crate. Disabled by default. Use judiciously as logging can leak details into the environment.
This project also offers a CLI tool. See the crate's own README for more information.
Install it with:
$ cargo install coldcard-cli
Contributions are welcome. Before making large changes, please open an issue first.
This is not an official project and comes with no warranty whatsoever.