From 910a400b18a83f4db36159337090432b7ee1e558 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 7 Nov 2023 11:58:18 +0200 Subject: [PATCH] fix computation of master fingerprint for satochip --- .../com/sparrowwallet/sparrow/io/satochip/SatoCardApi.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/io/satochip/SatoCardApi.java b/src/main/java/com/sparrowwallet/sparrow/io/satochip/SatoCardApi.java index b7b4cbb9..5be4b3ac 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/satochip/SatoCardApi.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/satochip/SatoCardApi.java @@ -139,7 +139,9 @@ public class SatoCardApi extends CardApi { ExtendedKey.Header xtype = Network.get().getXpubHeader(); String xpub = this.cardProtocol.cardBip32GetXpub(keyDerivationString, xtype); ExtendedKey extendedKey = ExtendedKey.fromDescriptor(xpub); - String masterFingerprint = Utils.bytesToHex(extendedKey.getKey().getFingerprint()); + String masterXpub = this.cardProtocol.cardBip32GetXpub("m", xtype); + ExtendedKey masterExtendedKey = ExtendedKey.fromDescriptor(masterXpub); + String masterFingerprint = Utils.bytesToHex(masterExtendedKey.getKey().getFingerprint()); KeyDerivation keyDerivation = new KeyDerivation(masterFingerprint, keyDerivationString); Keystore keystore = new Keystore();