keep the master private key for xprv output descriptors with an account path, and only warn of conversion to watch only when the xprv has a key origin path
What changed, and why it matters
This commit changes how Sparrow Wallet handles private extended keys (xprv) when users edit wallet output descriptors. Previously, Sparrow warned it would convert any private key to a public key in more situations. Now it only warns when the private key has a key origin path. The goal appears to be preserving the master private key for descriptors that use an account path, while still warning when conversion to watch-only is actually happening. The change is small and the security implications depend on whether users expect their private keys to remain usable after editing descriptors.
Review the drongo submodule diff to understand any related changes in key derivation or descriptor handling. Verify that the narrowed warning condition does not cause users to unintentionally keep private keys in contexts where they expected watch-only conversion. Consider adding tests for descriptor editing with xprv + account path versus xprv + key origin path.
Security signals we found
Private key handling logic changed in wallet settings
Watch-only conversion warning condition narrowed
Submodule update to drongo may contain related key derivation changes, but diff not provided
Evidence from the diff
In SettingsController.editDescriptor(), the warning condition for converting a private extended key to public (watch-only) is narrowed. The old condition warned if the extended key was private AND (there was a key derivation path OR a non-standard child derivation path). The new condition only warns if there is a key derivation path AND the extended key is private. The child derivation path check is moved to a separate warning about non-standard child derivations. A drongo submodule bump is also included but its contents are not supplied.
Changed components
src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.javadrongo submoduleInspect captured patch +2 / −3
### drongo
@@ -1 +1 @@
-Subproject commit 2c703d2048135b23c9faffe4c7cafc57768f26f9
+Subproject commit 7b2ab9cd043a56bb59dc2bad08ee066ac3783a9b
### src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java
@@ -504,8 +504,7 @@ public void editDescriptor(ActionEvent event) {
String extKey = matcher.group(2);
String childDerivationPath = matcher.group(3);
- if(ExtendedKey.Header.getHeaders(Network.get()).stream().anyMatch(header -> header.isPrivateKey() && extKey.startsWith(header.name())) &&
- (keyDerivationPath != null || (childDerivationPath != null && !(childDerivationPath.equals("/0/*") || childDerivationPath.equals("/1/*") || childDerivationPath.equals("/<0;1>/*"))))) {
+ if(keyDerivationPath != null && ExtendedKey.Header.getHeaders(Network.get()).stream().anyMatch(header -> header.isPrivateKey() && extKey.startsWith(header.name()))) {
AppServices.showWarningDialog("Private extended key detected", "Sparrow will convert the provided private key to a public key for use in a watch only wallet.\n\nTo import a private key, use the Master Private Key option when creating a Software Wallet.");
} else if(childDerivationPath != null && !(childDerivationPath.endsWith("/0/*") || childDerivationPath.endsWith("/1/*") || childDerivationPath.endsWith("/<0;1>/*"))) {
AppServices.showWarningDialog("Non standard child derivation detected", "Sparrow does not support non-BIP32 wallets without standard receive and change chains.\n\nThe provided descriptor will be amended if necessary.");Why this scored 38/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.