1 个不稳定版本
0.0.1 | 2020年4月25日 |
---|
#14 在 #ledger-hardware
21 每月下载次数
46KB
921 代码行
Ledger比特币应用助手 [WIP]
大多数助手需要实现 ledger_hw
特性的传输。
示例
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);
}
待办事项
mod 钱包
- get_wallet_public_key
- get_trusted_input
- sign_message
- sign_message_prepare
- sign_message_prepare_v1
- sign_message_prepare_v2
- sign_message_sign
- sign_message_prepare
- start_untrusted_hash_transaction_input [需要测试]
- finalize_input [需要测试]
- untrusted_hash_sign [需要测试]
mod util
- get_firmware_version
依赖关系
~7.5MB
~100K SLoC