ledger-hw-app-btc

Crates.ioledger-hw-app-btc
lib.rsledger-hw-app-btc
version0.0.1
sourcesrc
created_at2020-04-25 14:13:45.857607
updated_at2020-04-25 14:13:45.857607
descriptionHelpers for Ledger Bitcoin app
homepage
repositoryhttps://github.com/edouardparis/ledger-hw.git
max_upload_size
id233962
size57,091
Édouard (edouardparis)

documentation

https://docs.rs/ledger-hw-app-btc/

README

Helpers for the Ledger Bitcoin application [WIP]

A transport implementing the ledger_hw trait is needed in most of the helpers.

example:

use bitcoin::util::bip32;
use ledger_hw_app_btc::get_wallet_public_key;
use ledger_hw_app_btc::AddressFormat;
use ledger_hw_transport_hid::HidTransport;
use std::str::FromStr;

#[tokio::main]
async fn main() {
    let transport = HidTransport::new().unwrap();
    let path = bip32::DerivationPath::from_str("m/44'/0'/0'/0/0").unwrap();
    let (pk, address, chaincode) = get_wallet_public_key(&transport, &path, true, AddressFormat::Legacy)
            .await
            .unwrap();
    println!("pk: {}", pk);
    println!("address: {}", address);
    println!("chaincode: {}", chaincode);
}

TODO:

mod wallet

  • get_wallet_public_key
  • get_trusted_input
  • sign_message
    • sign_message_prepare
      • sign_message_prepare_v1
      • sign_message_prepare_v2
    • sign_message_sign
  • start_untrusted_hash_transaction_input [need test]
  • finalize_input [need test]
  • untrusted_hash_sign [need test]

mod util

  • get_firmware_version
Commit count: 45

cargo fmt