From 3aa284b576a80c44258a2a9890ff67e6fb4ea150 Mon Sep 17 00:00:00 2001 From: benk10 Date: Tue, 29 Apr 2025 15:01:06 +0300 Subject: [PATCH 1/2] Fix bitcoin new version derivations (#87) --- src-tauri/src/hwi/interface.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/hwi/interface.rs b/src-tauri/src/hwi/interface.rs index 59b2121..e84667b 100644 --- a/src-tauri/src/hwi/interface.rs +++ b/src-tauri/src/hwi/interface.rs @@ -145,7 +145,8 @@ impl HWIClient { path: &DerivationPath, expert: bool, ) -> Result { - let output = self.implementation.get_xpub(&path.to_string(), expert)?; + let prefixed_path = format!("m/{}", path); + let output = self.implementation.get_xpub(&prefixed_path, expert)?; deserialize_obj!(&output) } @@ -155,9 +156,8 @@ impl HWIClient { message: &str, path: &DerivationPath, ) -> Result { - let output = self - .implementation - .sign_message(message, &path.to_string())?; + let prefixed_path = format!("m/{}", path); + let output = self.implementation.sign_message(message, &prefixed_path)?; deserialize_obj!(&output) } @@ -183,7 +183,7 @@ impl HWIClient { start: u32, end: u32, ) -> Result, Error> { - let path_str = path.map(|p| p.to_string()); + let path_str = path.map(|p| format!("m/{}/*", p)); let output = self.implementation.get_keypool( keypool, internal, @@ -222,9 +222,10 @@ impl HWIClient { path: &DerivationPath, address_type: HWIAddressType, ) -> Result { + let prefixed_path = format!("m/{}", path); let output = self .implementation - .display_address_with_path(&path.to_string(), address_type)?; + .display_address_with_path(&prefixed_path, address_type)?; deserialize_obj!(&output) } From 8deff96f409bb5694cad0b79aa303adc19f3b939 Mon Sep 17 00:00:00 2001 From: benk10 Date: Tue, 29 Apr 2025 19:07:09 +0300 Subject: [PATCH 2/2] Fix missing m in derivations --- src-tauri/src/device.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/device.rs b/src-tauri/src/device.rs index 40610db..865976e 100644 --- a/src-tauri/src/device.rs +++ b/src-tauri/src/device.rs @@ -30,11 +30,11 @@ pub fn get_xpubs( } Ok(json!({ - "singleSigPath": ss_path.to_string(), + "singleSigPath": format!("m/{}", ss_path.to_string()), "singleSigXpub": single_sig_xpub.to_string(), - "multiSigPath": ms_path.to_string(), + "multiSigPath": format!("m/{}", ms_path.to_string()), "multiSigXpub": multi_sig_xpub.to_string(), - "taprootPath": tr_path.to_string(), + "taprootPath": format!("m/{}", tr_path.to_string()), "taprootXpub": taproot_xpub.to_string(), "mfp": hwi_state.fingerprint.as_ref().unwrap().to_string().to_uppercase(), }))