What changed, and why it matters
This commit is a small follow-up fix for a previous change that added support for 'silent payment' outputs. Silent payments are a privacy feature where the actual recipient address is computed later, so the transaction output temporarily has no readable address and a non-zero amount. Before this fix, Sparrow would warn users about these outputs as if they were unknown or possibly suspicious scripts. The change tells the wallet: 'If this output is a silent payment we already know about, don't show that warning.' It is a refinement to avoid unnecessary user warnings rather than a fix for a critical security flaw.
Treat as a minor UX/follow-up fix. Review the prior 'precomputed sp outputs' commit to confirm the full silent-payment flow is correctly implemented, and ensure the silentPaymentAddress check cannot be spoofed by a malicious PSBT. No urgent action is indicated by this diff alone.
Security signals we found
UI warning bypass for a known, intentional script type (silent payment outputs)
No cryptographic or transaction-validation changes
Follow-up to a prior feature addition, not a standalone security patch
Potential for user confusion if silent-payment outputs were incorrectly flagged
Evidence from the diff
The patch modifies AppController.java where the wallet builds a list of ‘unknownScriptOutputs’ before signing or broadcasting a transaction. Previously it flagged any output with value > 0 and a script that does not map to an address. Silent Payment (BIP 352) outputs intentionally have an empty script until the recipient’s silent-payment address is resolved, so they were incorrectly flagged. The new code iterates outputs by index, checks the corresponding PSBT output for a silentPaymentAddress field, and skips the warning for those precomputed silent-payment outputs. This prevents a false-positive warning but does not change transaction validation or signing logic.
Changed components
src/main/java/com/sparrowwallet/sparrow/AppController.javaTransaction output warning dialogSilent payment (BIP 352) output handlingInspect captured patch +11 / −2
diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java
index 5c8d4b6..899f7c7 100644
--- a/src/main/java/com/sparrowwallet/sparrow/AppController.java
+++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java
@@ -2062,8 +2062,17 @@ public class AppController implements Initializable {
//Skip the warning for already-confirmed transactions loaded for inspection
if(blockTransaction == null) {
- List<TransactionOutput> unknownScriptOutputs = transaction.getOutputs().stream()
- .filter(o -> o.getValue() > 0 && o.getScript().getToAddress() == null).toList();
+ List<TransactionOutput> unknownScriptOutputs = new ArrayList<>();
+ for(int i = 0; i < transaction.getOutputs().size(); i++) {
+ TransactionOutput txOutput = transaction.getOutputs().get(i);
+ if(txOutput.getValue() > 0 && txOutput.getScript().getToAddress() == null) {
+ //Silent payment outputs have an empty script and non-zero value until the recipient script is computed
+ if(psbt != null && i < psbt.getPsbtOutputs().size() && psbt.getPsbtOutputs().get(i).getSilentPaymentAddress() != null) {
+ continue;
+ }
+ unknownScriptOutputs.add(txOutput);
+ }
+ }
if(!unknownScriptOutputs.isEmpty() && !confirmUnknownScriptOutputs(unknownScriptOutputs)) {
return;
}
Why this scored 35/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.